cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG-MS write to remote characteristic

grzegorz
Associate III
Posted on February 23, 2017 at 16:21

I try to write to a characteristic on a remote device, BlueNRG-MS works as peripheral client. I call aci_gatt_write_charac_value() and it returns SUCCESS. But then EVT_BLUE_GATT_PROCEDURE_COMPLETE comes and it is sometimes 0x00 (BLE_STATUS_SUCCESS) and sometimes it's 0x41 (BLE_STATUS_FAILED). What could be the reason and how to solve this? Stack is 7.2.c.

#ancs #iphone #ble #bluenrg-ms #client
1 ACCEPTED SOLUTION

Accepted Solutions
Andrea Palmieri
ST Employee
Posted on February 24, 2017 at 12:44

Hi,

could you catch the event 'EVT_BLUE_GATT_ERROR_RESP'? The error code parameter should provide the reason of failure according to table 3.3 of BLUETOOTH SPECIFICATION Version 5.0  Vol 3, Part F, Section 3.4

Regards.

View solution in original post

2 REPLIES 2
Andrea Palmieri
ST Employee
Posted on February 24, 2017 at 12:44

Hi,

could you catch the event 'EVT_BLUE_GATT_ERROR_RESP'? The error code parameter should provide the reason of failure according to table 3.3 of BLUETOOTH SPECIFICATION Version 5.0  Vol 3, Part F, Section 3.4

Regards.

Posted on February 25, 2017 at 23:11

The error code is 0xA2 which means this is an application level error. So I looked at ANCS documentation and it says this error code is for invalid parameter. So it turns out I was sending incorrect data to iPhone and it was rejecting it. Thank you very much for suggesting EVT_BLUE_GATT_ERROR_RESP