bluetooth lowenergy - Android BLE onCharacteristicChanged not called -
i'm working on project includes bluegiga ble113 module , android app. on bluegiga module i've set several characteristics. 1 characteristic defined descriptor activate client notification (in case, client android app.). characteristic definition of ble113 module looks this:
: <characteristic uuid="dcfa2671-974d-4e4a-96cd-6221afeabb62" id="ez1_flow_data_out"> <!-- org.bluetooth.descriptor.gatt.characteristic_user_description --> <description>data transmit android device</description> <properties write="true" read="true" /> <value variable_length="true" length="255" type="hex" /> <!-- org.bluetooth.descriptor.gatt.client_characteristic_configuration --> <descriptor uuid="2902"> <properties write="true" read="true" const="false" /> <!-- bit 0 = 1: notifications enabled --> <value type="hex">0001</value> </descriptor> : : </characteristic>
on android side i've set notification within onservicesdiscovered(...)
callback according android bluetooth low energy guide:
characteristic = gatt.getservice(bleuuids.dataflow_service).getcharacteristic(bleuuids.dataflow_out_charact); //enable local notifications gatt.setcharacteristicnotification(characteristic, true); //enabled remote notifications bluetoothgattdescriptor desc = characteristic.getdescriptor(bleuuids.dataflow_out_descript); boolean test; test = desc.setvalue(bluetoothgattdescriptor.enable_notification_value); // homecoming value = true test = gatt.readdescriptor(desc); // homecoming value = true test = gatt.writedescriptor(desc); // homecoming value = true
however, if alter value of dataflow_out_charact characteristics uuid, using serial interface of bluegiga module, intended callback oncharacteristicchanged(...)
isn't triggered on android app.
try not read descriptor. write descriptor right after set. read overwrite set , write same value back?
android bluetooth-lowenergy android-4.4-kitkat android-4.3-jelly-bean bluegiga
No comments:
Post a Comment