I want to send a string msg from nrf52832 to mobile when the device get connected to the mobile phone through uart app
I want to send a string msg from nrf52832 to mobile when the device get connected to the mobile phone through uart app
This can be achieved by setting up a timer with a handler that notifies the string message to the phone. You can start the the timer when you get the connected event.
Please ask if you want me to elaborate more on something.
Best regards,
Simon
Yes please it would be helpful if i get a sample code
Could you explain your setup in more details? Are you using the nRF Connect mobile app, or are you developing your own mobile app?
I assume you are using the nRF Connect app for mobile (client and central) and that the nRF52832 serves as a peripheral and server. In that case, I have to correct myself from the last post. It is not possible to start sending data immediately after a connection is established, you have to enable notifications on the central side (phone) first. Check this thread for more information. If you are using nRF Connect, you have to do this manually, but if you are developing your own app, you can make it do it by itself.
Take a look at the ble app_hrs example, located in \nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_hrs\main.c, which you can use as a reference to your own project. It starts several timers, which will be started immediately, and will try notify different characterstics if there is a connection. The notifications will only go through when it is enabled by the phone.
Best regards,
Simon
Could you explain your setup in more details? Are you using the nRF Connect mobile app, or are you developing your own mobile app?
I assume you are using the nRF Connect app for mobile (client and central) and that the nRF52832 serves as a peripheral and server. In that case, I have to correct myself from the last post. It is not possible to start sending data immediately after a connection is established, you have to enable notifications on the central side (phone) first. Check this thread for more information. If you are using nRF Connect, you have to do this manually, but if you are developing your own app, you can make it do it by itself.
Take a look at the ble app_hrs example, located in \nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_hrs\main.c, which you can use as a reference to your own project. It starts several timers, which will be started immediately, and will try notify different characterstics if there is a connection. The notifications will only go through when it is enabled by the phone.
Best regards,
Simon