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

Sending notifications from nRf52832 to nRF Connet

Hi,

In my application I have a requirement to send notifications to mobile on triggering particular Interrupts as well as particular events.I have created a customised notification service having one character.I tried implementing in such a way that if interrupt occurs then it has to update ble_gatts_attr_t.p_value.The implemented code is attached below

I have just assigned a value to the member p_value.To reach my requirement I should be able to read value 02 in the characteristic value.For that purpose the given value must get updated into softdevice.Can you please let me know about any specific function call that would lead updating the value onto softdevice??

On top of this,I want to let you know The main requirement of our project i.e we should be able to send notifications like "It is ready","Container is empty" onto the mobile application.Observing character parameters I coudn't analize how to send the value as string.So I thought of updating an integer value whenever any event/interrupt generated.

Depending on the integer value recieved on the mobile,it should display corresponding string as notification.(I guess this part comes under customized mobile application development).

Please suggest me right way to implement my requirement.

Thanks & Regards,

Swathi P.

  • Hi Swathi

    Please check out the Alert Notification Application example project in our SDK. It connects and alerts an application about an incoming call using buttons on the DK, and it is able to print text strings. Keep in mind that it is the operating system on the phone and not the app itself that handles notifications and indications.

    Best regards,

    Simon

  • Thank you for the response.Please can you make me clear on below points.

    • Case1:If I want to send some notification/data from mobile to nRF52832 then Should I have to create service on nRF52832?Case2:If I choose to send notification/data from nRF52832 to mobile then Should I have to create service on mobile?

    • If I am considering nRF52832 as server and mobile as client,while implementing  services as in Case1 I have to create service using gatts structure as it is been created on server side and while implementing services as in case2 I have to create service using gattc structure as it is been created on client side.Am I right?

    • In Alert Notification example,service is implemented on client side upon button press we are able to set cccd values on application.

    • After I have  posted question,I went on looking into exsisting examples looking for the service that is updating the value of characteristics.Then I found Battery service where it is updating the characteristic value every 1sec.I found it suiting my application.Am I right ?can I implement notification service using battery service concept.

    Thanks & Regards,

    Swathi P

  • Hi

    • Case 1 & 2: In the central that is receiving notifications (whether it is an nRF chip or a phone), you will need a service client/handler that is able to handle the notifications from the peripherals notification service.
    • Yes, you will need the according service handler on the client side to match the service that the server is providing.
    • Yes, I think you should be able to start out with the battery service in order to create a notification service updating the phone every second or so.

    Best regards,

    Simon

  • I tried creating a notification service by following battery service,iam able to update value into the characteristic.But what I need is to get notification/pop-up with a string on mobile depending upon the changed value of characteristic.Can you please suggest me how do I follow to implement such requirement.

    Thanks & Regards,

    Swathi P

  • Hi

    You should check out the developer documentation for whatever mobile OS you are using? The BLE profiles aren't specific to particular hardware, and as I said it is the OS on the phone that handles indications/notifications on that side. iOS does have a service for this and can be found in the Apple Notification Center Service documentation on our Infocenter.

    Best regards,

    Simon

Related