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

Indication- Server(Mobile Device) and Client(nRF51)

My Project:

I want to control 2 outputs on the nRF51DK from my mobile device(Android & iOS). Its a simple program:

left button is pressed -> PIN 21 High / left button is released -> PIN 21 Low

right button is pressed -> PIN 22 High / right button is released -> PIN 22 Low

My setup:

-nRF51DK

-SD 8.1

-SDK 8.1

I have realized my idea with Notification. It works, but not perfectly. Because sometimes when I release a button, I wont get the notification.

I would like to get something like an ACK, when the information is recieved on the nRF51 board.

So I will have to use Indication instead of Notification.

image description

I know there are a lot of examples, which are using Indication(BPS, CGM, GLS, HTS).

The thing is, in this examples the data will be send form the nRFBoard to the Client. But I want the other way. I want to send data from mobile device to nRF51 DK.

Are there any examples where the data will be send form mobile device to nRF51Board with Indication?

Or could me somebody explain how I will get into the write_handler() function when I use Indication?

Do I have to call the write handler, when I get the confirmation?

Like this:

   case BLE_HTS_EVT_INDICATION_CONFIRMED:
        up_write_handler();
        break;

I know how I have to set up the characteristic for Indication. I need to know how do I get into the write_handler?

Parents
  • Hmm there is no call back when indication is confirmed? So I have a other solution in my mind. I could set up 2 characteristics. One for the data, which will give me information which button is pressed and is the button pressed or not. And the other characteristic would be like an ACK. Everytime I get a notification from the app, I would send on the other characteristic a notification, that the data is recieved.

    I'm controling a motor with the app. I have a characteristic for moving up and one for moving down. up_write_handler is the function, which will be called when I get a notification from the mobile device.

  • Because I need the same solution for iOS. But I will try it on the Android Application. Thank you for the information with the reliable write.

Reply Children
No Data
Related