Question about the function gattc_write_cmd_ind_handler

3 posts / 0 new
Last post
lonfaye
Offline
Last seen:5 years 5 months ago
加入:2014-08-20 08:56
Question about the function gattc_write_cmd_ind_handler

Hi to everyone,

Q1: I want to know how to enter into the function gattc_write_cmd_ind_handler in the SDK.
I cannot find the msgid GATTC_WRITE_CMD_IND is sent in the SDK.

Q2: I want to know what the differnce between IOS and android OS for handling notification atrribute.
When I clicked the listen for notification button in lightblue APP for IOS, the function gattc_write_cmd_ind_handler is called.
However, when I developed a ble APP for android OS, the function is not called in the SDK as the function setCharacteristicNotification(characteristic, enabled)runing.

Q3: Based on the Q2, I wang to know which function is called in the android OS the function gattc_write_cmd_ind_handler will be called in the SDK.
In other words, which function is run in the android OS the function gattc_write_cmd_ind_handler will be entered.

Thanks to everyone.

Device:
Joacimwe
Offline
Last seen:1 year 6 months ago
Guru
加入:2014-01-14 06:45
Q1: GATTC_WRI的消息TE

Q1: GATTC_WRI的消息TE_CMD_IND is sent by the stack (that code is inside ROM) to your handler when the central writes a value to a characteristic or descriptor.

Q2: You both have to enable characteristic notifications on the phone's side so you get callbacks when notifications are received (this is done by the function setCharacteristicNotification on Android). You also have to enable notifications on the DA14580 so it sends notifications over the air. You do this by writing a specific bit into the Client Characteristic Config Descriptor to the DA14580 (see Android example code athttp://stackoverflow.com/questions/22817005/why-does-setcharactersticnot...). When you do this you will receive the GATTC_WRITE_CMD_IND message and in the handler you write the corresponding value in the descriptor attribute.

Q3: Calling BluetoothGatt.writeCharacteristic or BluetoothGatt.writeDescriptor will make the DA14580 enter its handler for the GATTC_WRITE_CMD_IND message.

lonfaye
Offline
Last seen:5 years 5 months ago
加入:2014-08-20 08:56
Hi,Joacimwe , The questions I

Hi,Joacimwe , The questions I asked last time have been solved based on your reply.

Thank you