I'm working on an ANCS client, and Apple's spec example diagrams say the NC should "subscribe" to their notification source. I don't really understand whtat they mean by subscribe. Does anyone have an idea how to make this work?
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.
It's a little tricky because Apple wants to save battery. You advertise with a custom payload, iPhone OS scans, after connection, the services are discoverable and the roles switch with iPhone as NP in a server-like peripheral role. Note: if you do it right, you don't need to have a special app running on the phone.
You need to look at at the iOS Dev Forums for discussions on the topic.
I used a Beaglebone from TI and BlueGiga BLE112 with TI CC2540 in a "pebble-like" accessory demo video. This is for a funny Internet show called The GizWiz
DId you have any luck subscribing to the ANCS? I'm trying to do the same thing but have had little luck. My understanding is that once you have made a connection you need to ask for the services that the iOS has. Once you do that and find the ANCS you subscribe and enable it. I'm looking for code examples but have yet to find any. Anyone have ideas?
The iPhone should therefore be running a Gatt server something similar to the TimeApp example from TI. I figured that "subscribing" to the ANCS should be similar to the enabling of notifications on the TimeApp sample. But it didn't work for me. I can retrieve the handles but I'm not receiving any notifications. Any suggestion from anyone is much appreciated.
Solved my problem. After getting the handles, enable the notifications by sending a 0x1, 0x0 to the handle assigned to the client characteristic configuration of the Notification Source Characteristic. Everything should now work.
I can connect to my device.
Then I do, GATT_DiscPrimaryServiceByUUID and find ANCS, store the handles.
Then I do, GATT_DiscCharsByUUID and Notification Source, store the handles at datalist[3], datalist[4]
Then I try to write 0x0001 to char at these handles, but I get an authentication error
To which handles ( details ) are you writing 0x0001 to once you discover the Notification Source ?
You need to bond with ipod to have authorization.
I have this code:
// Setup the GAP Bond Manager
{
uint32 passkey = 0; // passkey "000000"
uint8 pairMode = GAPBOND_PAIRING_MODE_INITIATE;
uint8 mitm = TRUE;
uint8 ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
uint8 bonding = TRUE;
GAPBondMgr_SetParameter( GAPBOND_DEFAULT_PASSCODE, sizeof ( uint32 ), &passkey );
GAPBondMgr_SetParameter( GAPBOND_PAIRING_MODE, sizeof ( uint8 ), &pairMode );
GAPBondMgr_SetParameter( GAPBOND_MITM_PROTECTION, sizeof ( uint8 ), &mitm );
GAPBondMgr_SetParameter( GAPBOND_IO_CAPABILITIES, sizeof ( uint8 ), &ioCap );
GAPBondMgr_SetParameter( GAPBOND_BONDING_ENABLED, sizeof ( uint8 ), &bonding );
}
Also you might need to hold off writing the notification until the gap bond manger callback indicates the devices have BONDED.
Hi Ricardo,
I'm still not able to get ANCS working however chaging GAP_ADTYPE_128BIT_MORE to GAP_ADTYPE_SERVICES_LIST_128BIT in adData.
and UUID to
0xD0, 0x00, 0x2D, 0x12, 0x1E, 0x4B,0x0F, 0xA4, 0x99, 0x4E, 0xCE, 0xB5, 0x31, 0xF4, 0x05,0x79 // ANSC Primary Service UUID
Shows device in Settings -> Bluetooth
I hope this info is helpful.
Thanks.
Thank you Ravi
I am now able to connect and bond to the iPhone.
Does anybody knows the steps to follow in order to get the handle for the Notification Service characteristic of the ANCS ?
code snippets will be very helpful.
Thanks
Is there going to be a post , link, or Appllication Note on how to do this in the near future.
We are working on the ANCS protocol and also need information.
Thank you.
Hi All,
i'm working on ANCS client application using TI timeapp sample project and i did changes in the timeapp_discovery.c file according to following link
http://mbientlab.com/blog/ancs-on-ti2541-in-an-afternoon/
I connected the client device(keyfob) with iphone 4s using pairing process and it was successfully paired with iphone, after that client device discovered the ANCS using timeAppDiscStart() function.
i got timeApp_ProcessOSALMsg() callback for enabling notifications and after that i am not getting any notifications for text messages.
please help me to resolve this issue.
thanks
prabakaran
I looked at this article.. I had some issues which I finally resolved.. few more hints..
Value of
ANCS_SVC_UUID -- { 0xD0, 0x00, 0x2D, 0x12, 0x1E, 0x4B, 0x0F, 0xA4, 0x99, 0x4E, 0xCE, 0xB5, 0x31, 0xF4, 0x05, 0x79 };
CHAR_DESC_HDL_UUID128_LEN -- 21
Hi Leo,
Can you please send me the source of your project? How were you able to do this?
Thanks so much.
Can you please post the source for this?
That would be really helpful for all of us trying to get ANCS working on our dev boards.
Thanks much!
Dear Zach Marsen,
Nice to your post~
Hope, you have done well regarding ANCS notifications subscription from iOS..
well, I am facing the same issue bonding and getting notification alert (for msg, phone call....etc) on my CC2540 device through iOS via ANCS.
but didn't work out.
Please help me by sharing some solution or sample code, which needed to be changes.
I'd be highly thankful to you~
Regards,