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
  • Hi Inspectron,

    On the nRF51 side, the difference when it's receiving notification or indication are small. The stack handle the ACKing for the application. So on the application it's almost the same, you receive BLE_GATTC_EVT_HVX. Only the type in ble_gattc_evt_hvx_t are different when you receive the event.

    I don't think you will receive any call back on the app on the phone when the indication is confirmed (unlike on nRF51 side). But there is a call back when the notification/indication is sent (onNotificationSent ) have you used it ?

    I don't quite understand "up_write_handler", what do you plan to do with that ?

Reply
  • Hi Inspectron,

    On the nRF51 side, the difference when it's receiving notification or indication are small. The stack handle the ACKing for the application. So on the application it's almost the same, you receive BLE_GATTC_EVT_HVX. Only the type in ble_gattc_evt_hvx_t are different when you receive the event.

    I don't think you will receive any call back on the app on the phone when the indication is confirmed (unlike on nRF51 side). But there is a call back when the notification/indication is sent (onNotificationSent ) have you used it ?

    I don't quite understand "up_write_handler", what do you plan to do with that ?

Children
No Data
Related