简体   繁体   中英

How to notify GATT characteristic to send new sensor value to GATT client (custom BLE service)

I'm trying to notify a GATT characteristic where an external BLE GATT client has registered to (pure BLE / no mobile device lib). I can successfully register for notify with my external GATT client (running on a microcontroller). However, when updating the characteristic on Movesense, no notify event seems to arrive at GATT client. The characteristic value is written in notify callback, when new sensor data is available via asyncPut():

WB_RES::Characteristic newCharValue;
...
asyncPut(WB_RES::LOCAL::COMM_BLE_GATTSVC_SVCHANDLE_CHARHANDLE(),
         AsyncRequestOptions::Empty,
         mSvcHandle,
         mCharHandle,
         newCharValue);

The GATT service is created based on CustomGATTSvcClient example. The characteristic properties are READ, WRITE, NOTIFY. The characteristic value is written after the handles are successfully assigned from post and get callback.

该问题与其他设备的构建工具链有关。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM