2024-12-23 03:38 AM
Hello Community,
Greetings of the day.
I'm using the Nucleo WB55RG board. I want to turn ON the notification and see the notification my st-BLE mobile app as soon as the data of the particular variable changes.
I set the service and its characteristics in the project's .ioc file. But my requirement is that I should get the notification on the BLE app as the data in that variable changes. SO HOW DO I ASSIGN a NoTiFiCaTioN TO MY PARTICULAR Variable.
@STTwo-32 Could you please help me in this matter. I explored the wb55rg's reference manual, different User Manuals But NOT found helpful.
So your Help is appreciated.
Thank You.
Regards,
OS.
2024-12-23 04:28 AM
Hi,
in BLE it is the Central device which will initiate the connection, discover the services and enable the notifications.
If I understand correctly, in your case, BLE application on WB55 is peripheral and your smartphone is central, so the activation of notifications must be done by your mobile app.
BR, Joé
PS: If you'd like to try it out, have a look at our mobile app: ST BLE Toolbox.
After logging in and discovering the services, there's a button to enable or disable notifications.
2024-12-23 05:53 AM
Hi @_Joe_ ,
Thank you for your response.
The Problem Statement is - I've a variable say "var'' which is being filled periodically (say at every 2sec) using rand( ) function. Now as the variable named "var" changes after every 2 sec., I'll write a C code such that I'll get the notification about it on BLE application.
BUT
The issue I'm facing is HOW DO I ASSIGN/Link A NOTIFICATION TO THAT VARIABLE? thru the .ioc file or in the code itself, so that as variable value change notification is sent.
I'm not getting which callback function should I use or what setting to do in .ioc or whattt exactly I should do so that as the variable value changes THE PERIPHERAL DEVICE WILL SEND NOTIFICATION TO THE CENTRAL DEVICE.
I'm New with STM as well as BLE.
Hope You Understood my issue.
Thanks.
2024-12-23 06:28 AM
Okay, I get it,
I recommend you look at the BLE_HeartRate example, which sends a heart rate notification every second to the central device.
In the hrs_app.c file > HRSAPP_Measurement(), manage the value to be notified and call aci_gatt_update_char_value (hrs.c file) to notify the central unit of a new value.
The same thing in the BLE_p2pServer example: p2p_server_app.c => P2PS_Send_Notification() > P2PS_STM_App_Update_Char() > aci_gatt_update_char_value()