2018-03-20 07:26 AM
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
2018-03-21 07:51 AM
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 Indicationis used to perform this subprocedure.
The
Attribute Handleparameter shall be set to the
CharacteristicValue Handle
being indicated, and the
Attribute Valueparameter shall be set to
the
Characteristic Value. Once the
Handle Value Indicationis received by the
client, the client shall respond with a
Handle Value Confirmation.'
Best regards,
Antonio
2018-03-22 03:20 AM
Thank you for your help
2018-03-27 04:06 AM
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
2018-03-27 05:16 AM
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