2021-07-12 01:34 PM
Hi, I'm doing the development of the bluetooth communication between two bluenrg-2n devices. The bluenrg-2n are connected with stm32f405 through SPI. The two custom boards(GATT Client and Server) are identical. Now I have the problem when receiving data at GATT Client.
I can currently successfully send data at GATT Server as property "notification"and the data can be read at APP "BLE Scanner". Then I try to receive it at GATT Client. After successfully established the connection I use the function "aci_gatt_disc_char_by_uuid" to find the characteristics, which return with status "BLE_STATUS_SUCCESS". But after that I can't get the characteristics value and the codes cannot go into the callback functions, such as "aci_gatt_disc_read_char_by_uuid_resp_event", "aci_gatt_notification_event"... I have read the codes of X-Cube_BLE2 "Central" and "SampleApp", but it seems like that, what I have done is nothing different from the codes in X-Cube-BLE2.
My confuse is, where did I make it wrong or how can I do/which function(s) I should use extrally, to successfully get the characteristics value? What I only want to do is send the data one way from GATT Server to Client.
It will be much appreciated if anyone could give me some advice. Thanks a lot!
2021-07-15 08:19 AM
Did you get any of these events:
Test if the events were masked. The default configuration is all the events masked.
Please set the mask by: ACI_GATT_SET_EVENT_MASK
To read a characteristics, you may also try: ACI_GATT_READ_CHAR_VALUE
2021-07-15 10:33 AM
Hello, I can only get into the event "ACI_GATT_DISC_READ_CHAR_BY_UUID_RESP_EVENT" without initiatively using it. For the event "ACI_GATT_PROC_COMPLETE_EVENT" and "aci_gatt_notification_event", I can't get into them, unless I initiatively use them. Should I initiatively use them?
And also, if all the events in the default configuration are masked, what I should do is to unmask them, i think. Instead of set the mask on the event. How can I unmask the event?
ACI_GATT_READ_CHAR_VALUE I have also used, but still don't working.
Thank you for your reply!
2021-07-20 07:18 AM
Not quite understand what you meant for "initiatively using it".
But i think 3 different events shall be seen in any cases, otherwise there might be something wrong with the commands.
The events mentioned previously in details:
HCI_COMMAND_STATUS_EVENT is generated when the command is issued properly.
ACI_GATT_DISC_READ_CHAR_BY_UUID_RESP_EVENT is generated when any characteristic is discovered successfully, or ACI_GATT_ERROR_RESP_EVENT is generated when there is an error.
ACI_GATT_PROC_COMPLETE_EVENT is generated after the characteristic discovering procedure is completed.
The events for ACI_GATT_READ_CHAR_VALUE would be similar.