V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
5bb864e1fc775087
V2EX  ›  问与答

安卓开发低功耗蓝牙有个小问题请教下

  •  
  •   5bb864e1fc775087 · 2020-02-08 15:44:52 +08:00 · 470 次点击
    这是一个创建于 1710 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我想判断某个 Service 的某个 Characteristic 能不能用 notify 连接

    已知某个 Characteristic 的 property 为 48
    安卓内部类 android.bluetooth.BluetoothGattCharacteristic 里面有个常量 PROPERTY_NOTIFY 的值的十进制为 16

    通过下面这样判断对不对?

    int property = 48
    boolean canNotify = (int)(property & android.bluetooth.BluetoothGattCharacteristic.PROPERTY_NOTIFY) > 0
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2947 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 14:21 · PVG 22:21 · LAX 07:21 · JFK 10:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.