What are the STM32WB Custom Template Notify functions for?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-03 10:20 AM
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?
Solved! Go to Solution.
- Labels:
-
BLE
-
STM32WB series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-20 9:05 AM - edited ‎2024-11-20 9:08 AM
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:
-
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.
-
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-20 9:05 AM - edited ‎2024-11-20 9:08 AM
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:
-
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.
-
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.
