How can read all characteristic's value of my BLE device?

后端 未结 3 1247
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-07 06:10

I\'m building an app with Android Studio that can read the value from a device BLE. This device, have 4 services. The fourth services have 3 characteristic. I want to read t

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-07 06:48

    You should not read whole list of characteristics in onServicesDiscovered method, because ble device could havent a time to performs all requests from android client.

    I offer you:

    1. Keep all characteristics in onServicesDiscovered
    2. By turns try reading characteristics in onCharacteristicRead method (at first you read first characteristic, after characteristic has been read, try reading second characteristic and ... )

提交回复
热议问题