This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Strategy for sending alert to phone from nrf52

Hello,

I am trying to create an application that sends a notification from the nrf52 to a smartphone when a sensor reading exceeds a certain value. Would the immediate alert service be appropriate here, or should I just add a characteristic to my custom service that indicates when my reading is too high? I am very concerned about power usage, so any solution that minimizes radio communication is preferred. Thanks.

I've looked for other solutions on the forum but haven't found anything; if I've missed something please point me in the right direction

Other info: Eclipse 4.5.2 PCA10040 SDK 13.0 or 13.1 (not sure where to find the difference)

  • The power consumption is more or less set by the architecture: you either use the connection link (and then both devices must do Tx/Rx more or less at every connection interval) or you use broadcasting/observing only. In general it's only about what reliability and latency you need, power consumption is just consequence of these parameters...

  • I see, thank you. Assuming I'm using a connection link, would there be any reason to use immediate alert service given my example? I'm not entirely clear if it was meant for my use case or not.

  • There are two standard "alert" GATT Services defined by BT SIG (immediate alert and alert notification). You can see from their documentation on bluetooth.com if they suite your purpose or not, however I'm not sure how it is with adoption of these services on Android/iOS/Windows side. To be honest as you seems to be alerting some application-specific event and as you are most probably to develop your own mobile app I would go with custom Service+Characteristic (you will need two custom 128-bit UUIDs and you will need to define some simple protocol on top of Characteristic's Value handle but beside of that it should be easy).

  • The trick of "immediate" notification can be done by GATT Write method (if you are on GATT Client side) or by GATT Notify method (if you are on GATT Server side - this is more likely based on your hints and based on "usual" architecture of BLE apps on mobile devices, note that in order to receive these notifications on GATT Client side you need to enable them after connection by writing to CCCD of your custom Characteristic, however this is well known procedure present in every Mobile App BLE tutorial).

Related