2

I defined custom service (NRF51822,S110) to send sensor data. In that I enabled notifications for new data. I can able to receive data, if I enabled notification in NRFconnect app in Android and windows. But I am not able to enable notification in ubuntu 16.04 . I am using bluez gatttool. To get notification I send this command "char-write-req 0x000e 0100" from command line. Please Help me to fix this issue.

2 Answers2

1

In order to receive notifications from a gatt server, you need to write to the CCCD (0x2902) descriptor and use the --listen option. Assuming that the handle of the descriptor is 0x000e, the command you need is as follows:-

gatttool -b 00:11:22:33:44:55 --char-write-req --handle=0x000e --value=0100 --listen

Please see the answers below:-

Bluetooth Low Energy: listening for notifications/indications in linux

Reading Thermometer Data with Bluez Bluetooth Low Energy

I hope this helps.

Youssif Saeed
  • 11,789
  • 4
  • 44
  • 72
0

Sorry. handle 0x000f is correct. But I written as 0x000e. Now issue solved. Thank you.