cancel
Showing results for 
Search instead for 
Did you mean: 

Confirmation Update

jampino
Associate II
Posted on March 20, 2018 at 15:26

Hello,

Having connected two bluenrg-1 devices, if I send a new update value from the slave to the master, is there any way of receiving a confirmation from the master to the slave when I send that new value to know if the master has receive the update correctly.

Thank you

4 REPLIES 4
Antonio Vilei
Senior III
Posted on March 21, 2018 at 15:51

Hi Jamp,

by reading some other posts that you have written earlier, I assume that you are using notifications to let the GATT client (the master in your case) get updates from the GATT server (the slave in your case).

If you want to make sure that the update has actually been received, you should use indications instead of notifications. The standard specifies that when you use indications, you get an acknowledgement to confirm that indication was successfully received.

So, when creating your characteristic, please enable add the Indicate property.

Quoting the standard:

'4.11.1 Indications

This sub-procedure is used when a server is configured to indicate a

Characteristic Value

to a client and expects an Attribute Protocol layer

acknowledgment that the indication was successfully received.

The Attribute Protocol

Handle Value Indication

is used to perform this subprocedure.

The

Attribute Handle

parameter shall be set to the

Characteristic

Value Handle

being indicated, and the

Attribute Value

parameter shall be set to

the

Characteristic Value

. Once the

Handle Value Indication

is received by the

client, the client shall respond with a

Handle Value Confirmation

.'

Best regards,

Antonio

Posted on March 22, 2018 at 10:20

Thank you for your help

Posted on March 27, 2018 at 11:06

Hello Antonio,

I am receiving the indication on the client when the server updates a value and sending the aci_gatt_confirm_indication() from the client but then I can't see any response on the server. Do I need to do something to receive an event on the server?

Thank you

Posted on March 27, 2018 at 12:16

If you're using the BlueNRG-1 as an application processor, you need to define your callback function for this event.

In order to do this, in the user code of your project you have to implement the following function:

/**

  * @brief This event is generated when the client has sent the confirmation to a previously sent indication

  * @param Connection_Handle Connection handle related to the event

  * @retval None

*/

void aci_gatt_server_confirmation_event(uint16_t Connection_Handle);

If the callback above is not implemented, a weak function with the same name will be called instead (which is probably your case).

On the other hand, if you're using your BlueNRG-1 as a network co-processor (with the application running on an extarnal STM32 connected via SPI or UART), then you will need to handle the EVT_BLUE_GATT_SERVER_CONFIRMATION_EVENT event in your event handler function on the STM32.

Best regards,

Antonio