When setting the value to the descriptor instead of putting descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE), put descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE). The callbacks for onCharacteristicChanged are called now.

Can you clarify what "indication" is supposed to do? Based on the docs, I was sure that the right flag to set in this case was ENABLE_NOTIFICATION_VALUE but you're now the second person on this page who has suggested that ENABLE_INDICATION_VALUE is the right flag. What is the difference and use case for each? –  jkraybill Oct 28 '13 at 7:56
 
It depends on the Bluetooth Profile implementation inside the bluetooth device. It either uses "Notification" or "Indication" for posting updates. So you'll have to find out which one your device uses. –  Boni2k Oct 28 '13 at 20:47
 
Like Boni2k said, it depends on the Bluetooth Profile. If your service follows the standard profiles you should be able to find that information [here] (developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx). If you want to know this programatically, you can call the getProperties() method for your characteristic and do a bitwise AND against the property you want to check if it's different than 0, then it supports that activity. –  user2926265 Nov 1 '13 at 14:23
 
What bothers me here is that the Android documentation states that setCharacteristicNotifications works for EITHER notifications or indications. So I assume they are checking the properties internally and writing the correct flags to the characteristic. They also use the method in their example which has worked with some HeartRate monitors. Do you know if the method is flawed? My understanding is that one cannot set BOTH indication/notification flags though some devices may accept that. IF they are doing that then I would say their method IS wrong. –  Brian Reinhold Apr 2 at 9:48
 
http://stackoverflow.com/questions/17910322/android-ble-api-gatt-notification-not-received

Android BLE API: GATT Notification not received的更多相关文章

  1. Android BLE与终端通信(五)——Google API BLE4.0低功耗蓝牙文档解读之案例初探

    Android BLE与终端通信(五)--Google API BLE4.0低功耗蓝牙文档解读之案例初探 算下来很久没有写BLE的博文了,上家的技术都快忘记了,所以赶紧读了一遍Google的API顺便 ...

  2. 【转】蓝牙4.0——Android BLE开发官方文档翻译

    原文网址:http://ricardoli.com/2014/07/31/%E8%93%9D%E7%89%9940%E2%80%94%E2%80%94android-ble%E5%BC%80%E5%8 ...

  3. Android BLE与终端通信(一)——Android Bluetooth基础API以及简单使用获取本地蓝牙名称地址

    Android BLE与终端通信(一)--Android Bluetooth基础API以及简单使用获取本地蓝牙名称地址 Hello,工作需要,也必须开始向BLE方向学习了,公司的核心技术就是BLE终端 ...

  4. Android ble 蓝牙4.0 总结

    本文介绍Android ble 蓝牙4.0,也就是说API level >= 18,且支持蓝牙4.0的手机才可以使用,如果手机系统版本API level < 18,也是用不了蓝牙4.0的哦 ...

  5. Android ble 蓝牙4.0 总结一

    本文介绍Android ble 蓝牙4.0,也就是说API level >= 18,且支持蓝牙4.0的手机才可以使用,如果手机系统版本API level < 18,也是用不了蓝牙4.0的哦 ...

  6. android BLE Peripheral 做外设模拟设备,供ios、android 连接通讯。

    为了能让其它设备可以发现其设备,先启动特定广播.看自己需要什么广播格式. 对于广播可见的mac address: 在调用startAdvertising();时,mac address 就会改变. 并 ...

  7. Android BLE蓝牙详细解读

    代码地址如下:http://www.demodashi.com/demo/15062.html 随着物联网时代的到来,越来越多的智能硬件设备开始流行起来,比如智能手环.心率检测仪.以及各式各样的智能家 ...

  8. Android:BLE智能硬件开发详解

    目录 前言 BLE是个什么鬼 BLE中的角色分工 主要的关键词和概念 GATT(Generic Attribute Profile ) Characteristic Service Android如何 ...

  9. Android BLE 蓝牙低功耗教程,中央BluetoothGatt和周边BluetoothGattServer的实现

    http://blog.csdn.net/wave_1102/article/details/39271693 分类: Android(105) 作者同类文章X Android4.3 规范了BLE的A ...

随机推荐

  1. 移动端的头部标签和meta

    <!DOCTYPE html><!--HTML5 doctype--> <html> <head> <title>xxx</title ...

  2. Oracle 查询字段在什么表

    -- 查询字段在什么表 select * from all_tab_cols t where t.column_name='ABC'; -- 查询字段在什么表并且 判断是否是主键 select * f ...

  3. oracle 如何恢复误删的表记录数据

    --开启行移动功能 ALTER TABLE tablename ENABLE row movement ; --恢复表数据,时间为删除或修改的时间点 flashback table tablename ...

  4. Linux下运行top命令显示的PR\NI\RES\SHR\S\%MEM TIME+都代表什么

    PID 进程号 USER 用户名 PR 优先级 NI nice值.负值表示高优先级,正值表示低优先级 RES 进程使用的.未被换出的物理内存大小,单位Kb S 进程状态: D 不可中断的睡眠状态 R ...

  5. 学习c的第8天

    #include <stdio.h> int main() { char ch; printf("请输入分数等级(A,B,C,D):"); scanf("%c ...

  6. 将CentOS配置成本地yum

    默认的yum是以网络来安装的,在没有网络或者网速不佳的情况下,通过yum来安装软件是意见非常痛苦的事情.其实对于CentOS DVD来说,里面提供的软件就足以满足我们的需要了,而且DVD里的软件版本都 ...

  7. Java迷题:等于,还是不等于?

    等于还是不等于? 看来看下面的一段代码: public static void main(final String[] args) { Integer a = new Integer(100); In ...

  8. windows7安装IE11点击图标没反应

    可以通过修改 Windows 注册表的方式解决: Win+R 打开“运行”后输入 regedit 打开 注册表编辑器 打开注册表编辑器(regedit)以后,找到注册表项HKEY_CURRENT_US ...

  9. 【转】在delphi中实现控件的拖拽

    提示:可以添加一个布尔来控制可否拖动的状态,这里提供所有都能拖动的方法. procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseB ...

  10. delphi 更改不了窗体的标题

    delphi定义变量名千万要注意,不能和关键字同名,今天我无意间定义了一个caption的变量  导致我怎么都不能修改窗的标题.