GATT client read/notification not working

255 views
Skip to first unread message

Renwan

unread,
Mar 6, 2017, 3:32:01 AM3/6/17
to btstack-dev
hi, 

I have trouble getting notification or reading value from GATT server characteristic.

I have a CC2564-PAN1326 module to communicate with Microchip's RN4020, which has a private data profile based on GATT.
once connected to RN4020 and some discover commands, primary service and its characteristic information received as following:-
private data service UUID: 00035b03-58e6-07dd-021a-08123a000300
characteristic UUID: 00035b03-58e6-07dd-021a-08123a000301, 
with property 0x3e(NOTIFY | INDICATE | WRITE | WRITE_WITHOUT_RESPONSE | READ)
and descriptor UUID: 00002902-0000-1000-8000-00805f9b34fb.

then I enable notification using API:-
gatt_client_write_client_characteristic_configuration(handle_gatt_client_event, connection_handler, &mldp_data_char, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NOTIFICATION);
...
and write the descriptor 
uint8_t notification[] = {0x01, 0x00};
gatt_client_write_characteristic_descriptor(handle_gatt_client_event, connection_handler, &descriptor, 2, notification);

at this point I could send data successfully to RN4020 by writing the characteristic:
gatt_client_write_value_of_characteristic(handle_gatt_client_event, connection_handler, mldp_data_char.value_handle, outLength, outbuffer);

while I don't get any notification when value changed on RN4020 GATT server characteristic.
and when I read the characteristic value using 
gatt_client_read_value_of_characteristic(handle_gatt_client_event, connection_handler, &mldp_data_char); 
I don't get GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT event, but gatt_client_report_error_if_pending() is called with error code 0x02.

I am trying to figure out why I am not getting events like:
GATT_EVENT_NOTIFICATION or GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT

Appreciate if you could give some useful comments

Regards,
Renwan



Matthias Ringwald

unread,
Mar 6, 2017, 3:38:58 AM3/6/17
to btsta...@googlegroups.com
Hi Renwan

It's hard to say without seeing your code. Anyway, it's enough to call gatt_client_write_client_characteristic_configuration to enable notifications, no need to gatt_client_write_characteristic_descriptor manually.

To get notifications, you also have to register a listener for that characteristic with gatt_client_listen_for_characteristic_value_updates.

Also, you could try running le_streamer and le_streamer_client on two setups as they work out of the box.

Best
 Matthias

--
You received this message because you are subscribed to the Google Groups "btstack-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
To post to this group, send email to btsta...@googlegroups.com.
Visit this group at https://groups.google.com/group/btstack-dev.
For more options, visit https://groups.google.com/d/optout.

Renwan

unread,
Mar 14, 2017, 12:42:30 AM3/14/17
to btstack-dev
hi Matthias,

we found out the problem is actually in Microchip module RN4020.
it is working after we downgraded RN4020 firmware to version 1.10 and configured RN4020 module using 'SR,30002800' command. 

Thanks and Regards,
Renwan

Matthias Ringwald

unread,
Mar 14, 2017, 4:52:26 AM3/14/17
to btsta...@googlegroups.com
Hi Renwan

I don't have a RN4020 module, but thanks for letting us (or random users using a search engine) know how you fixed the issue.

Best regards, 
Matthias
Reply all
Reply to author
Forward
0 new messages