This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640R2F: Simple peripheral: How to add the ANCS(Apple notification center service) functionality in a working project?

Part Number: CC2640R2F

Tool/software: Code Composer Studio

SDK --> simplelink_cc2640r2_sdk_4_10_00_10

I am working on "Simple peripheral" project.

 stack (BLE)

-----------------------------------------------------------------------

Hi, 

The data transfer between my launchpad and the iPhone with the nrf-connect app is happening properly.

But came to know that iPhone can't send the messages/call details like Android phones do, so I have to integrate ANCS with the current implementation.

.

I need to add the functionality of ANCS in the running project.

Please guide me on how to approach this properly.

Regards,

Saurav

  • Hi,

    I'm looking for the answer. I'll reply in the next 24 to 48 hrs.

    Luis

  • Saurav,

    We have an example for an older SDK, v2.20. Please visit the project on our SimpleLink Github. I'm sure you will benefit from it.

    -Luis

  • Hi Luis,

    we are in working project using the Simple peripheral as base example and BLE IC as GATT server.

    Recently customer also want to use iOS devicesto interact with our BLE device and use the ANCS.

    as you have given link above, which says that the BLE IC must be GATT client to have the ANCS usage, but our current architecture is opposite (BLE IC is GATT server and mobile phone is GATT client).

    Is there any way we can use the same architecture (BLE IC is GATT server and mobile phone is GATT client) and implement the ANCS to receive notifications from iOS device?

  • Pawan,

    Congratulations for your project. 

    Yes, a peripheral can act as both a GATT client and a GATT server. Therefore, it should be able to implement ANCS and receive notifications from the iOS device. Please take a moment to see our section on GATT on the user's guide.

    I hope this helps.

    -Luis

  • Hi Luis,

    Thanks for the reply.

    yes i did read the manual and line below:

    " A peripheral can act as both a GATT client and a GATT server. "

    i am little concerned if "Peripheral can act as client and server both at the same time"?

    As we need to be a server for the mobile application as well a client to receive ANCS notification.

    Let me know if it is really possible, if yes. is there any reference examples? and any pointers?

  • Pawan,

    Yes, definitely! Our multi_role example on the blestack folder should be a great help. Multirole performs the GAP roles of peripheral and central, and at the same time it can perform the GATT roles of server and client. 

    The example is located normally here: C:\ti\simplelink_cc2640r2_sdk_4_10_00_10\examples\rtos\CC2640R2_LAUNCHXL\blestack\multi_role

    You can import it with with Project -> Import CC Projects in Code Composer Studio.

    Please see that the "server" part is implemented mostly in simple_gatt_profile.c, while the "client" part can be invoked or used with the buttons, and is implemented in multi_role.c in functions like mr_doGattRw() which do things like GATT_WriteCharValue() as a client.

    I hope this helps!!! 

    Luis

  • Hi ,

    Can i directly add the changes and new ancs files in my working simple peripheral code?

  • Saurav,

    I'm sorry I can't answer that. The code provided is an example. You'll have to try it out and it should serve you as a guide.

    Thanks,

    Luis

  • Hi Luis,

    we are targeting to use client and server both in parallel in peripheral mode. - this is clear and can be achieved as per your last comment.

    I have one more query before be jump into code:

    The GATT client can also receive notifications (when running in parallel to GATT server in same peripheral mode)? if yes, can you share a good reference for it? - we are targeting to use ANCS (iOS notification service) in client mode and normal BLE app connectivity in server mode.

    PS: also if possible please share the reference for the peripheral client example also.

  • Yes. please go through the lab on Custom Profile

    I don't think we have any example of a Peripheral + Client, but I did provide you above with some API functions that you can call. Please refer to the User's Guide, in particular the API section for GATT.

    -Luis