cancel
Showing results for 
Search instead for 
Did you mean: 

What are the STM32WB Custom Template Notify functions for?

mbedt
Associate II

I've noticed that when I create a notify characteristic, two functions are created each time: one is called Custom_<name of char>_Send_Notication(), the other is Custom_<name of char>_Update_Char(). What is the difference? They both end up calling the same function, Custom_STM_App_Update_Char(CUSTOM_STM_PINGRESPONSE, (uint8_t *)NotifyCharData), but point to different arrays - why different arrays / what is their purpose?

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @mbedt 

The functions Custom_<name of char>_Send_Notication()and Custom_<name of char>_Update_Char()serve different purposes in the context of handling BLE characteristics:

  1. Custom__Send_Notification():

    • This function is specifically designed to send notifications to the client. Notifications are a way for the server to inform the client about changes in the characteristic value without the client having to request it.
    • The function typically prepares the data to be sent and calls Custom_STM_App_Update_Char with the appropriate parameters to trigger the notification.
  2. Custom__Update_Char():

    • This function is used to update the characteristic value on the server side. It does not necessarily trigger a notification to the client. Instead, it updates the value stored in the server's GATT database.
    • This function also calls Custom_STM_App_Update_Char to update the characteristic value, but it may be used in contexts where a notification is not required.

More details are available on the chapter 2.5.6 of the Introduction to STM32WB Bluetooth® Low Energy wireless interface - Application note 

 

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
STTwo-32
ST Employee

Hello @mbedt 

The functions Custom_<name of char>_Send_Notication()and Custom_<name of char>_Update_Char()serve different purposes in the context of handling BLE characteristics:

  1. Custom__Send_Notification():

    • This function is specifically designed to send notifications to the client. Notifications are a way for the server to inform the client about changes in the characteristic value without the client having to request it.
    • The function typically prepares the data to be sent and calls Custom_STM_App_Update_Char with the appropriate parameters to trigger the notification.
  2. Custom__Update_Char():

    • This function is used to update the characteristic value on the server side. It does not necessarily trigger a notification to the client. Instead, it updates the value stored in the server's GATT database.
    • This function also calls Custom_STM_App_Update_Char to update the characteristic value, but it may be used in contexts where a notification is not required.

More details are available on the chapter 2.5.6 of the Introduction to STM32WB Bluetooth® Low Energy wireless interface - Application note 

 

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.