android - onCharacteristicChanged() callback not called if there are too many packets coming in -
android - onCharacteristicChanged() callback not called if there are too many packets coming in -
i wait oncharacteristicchanged()
callbacks receive info via ble. if bluetoothdevice sends many packets of 20 bytes @ 1 time @ 10 notifications instead of expected 46 907 byte long message. smaller amounts of info notified fine.
in onservicesdiscovered(bluetoothgatt gatt, int status) register notifications via:
public void onservicesdiscovered(bluetoothgatt gatt, int status) { if (status == bluetoothgatt.gatt_success) { mservice = mgatt.getservice(service_uuid); mcharacteristic = mservice.getcharacteristic(characteristic_uuid); mgatt.setcharacteristicnotification(characteristic, enabled); bluetoothgattdescriptor descriptor = characteristic.getdescriptor(uuid.fromstring(client_characteristic_config)); descriptor.setvalue(bluetoothgattdescriptor.enable_notification_value); mgatt.writedescriptor(descriptor); } }
do have acknowledge somehow got info in oncharacteristicchanged()
?
the bluetoothdevice sending messages bigger 20 bytes splitting them 20 byte chunks. messages smaller 200 bytes. when bluetoothdevice sends messages on 900 bytes long, app gets notifications via oncharacteristicchanged()
200 of bytes.
these bigger messages received fine on ios.
the ble stack is kind of broken there known bug regarding many packets , reading multiple characteristics. according slide s keynote bt stack improved in l release (including slave , central mode)
android bluetooth-lowenergy btle
Comments
Post a Comment