I added the simpleGATTprofile to the keyfobdedmo and thought I had it all working. However when I use GATT_DiscAllPrimaryServices in BTool it discovers all services then returns a READ_NOT_PERMITTED then a success.
[620] : <Rx> - 03:59:54.510
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x0A (10) bytes(s)
Event : 0x0501 (ATT_ErrorRsp)
Status : 0x00 (Success)
ConnHandle : 0x0000 (0)
PduLen : 0x04 (4)
ReqOpcode : 0x10 (ATT_ReadByGrpTypeReq)
Handle : 0x0040 (64)
ErrorCode : 0x02 (READ_NOT_PERMITTED)
: The Attribute Cannot Be Read.
Dump(Rx):
04 FF 0A 01 05 00 00 00 04 10 40 00 02
------------------------------------------------------------------------------------------------------------------------
[621] : <Rx> - 03:59:57.003
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x0B (11) bytes(s)
Event : 0x0607 (GAP_LinkParamUpdate)
Status : 0x00 (Success)
ConnHandle : 0x0000 (0)
ConnInterval : 0x0640 (1600)
ConnLatency : 0x0000 (0)
ConnTimeout : 0x0258 (600)
Dump(Rx):
04 FF 0B 07 06 00 00 00 40 06 00 00 58 02
When I do not call SimpleProfile_AddService( GATT_ALL_SERVICES ) then I do not get the read not permitted.
I did change the simpleGATTprofile slightly by adding a few more characteristics but they all work fine. When I try to read/write to them they all work and I have no errors. I even get callbacks to the correct functions.
This causes errors though when the iphone apps like Multitool try to connect as they give an error that services are not found when I call SimpleProfile_AddService( GATT_ALL_SERVICES ).
The problem does appear to be the call of GATTServApp_RegisterService but it looks identical to the default simpleProfile version.
Does anyone have any ideas on this? I can post code snippets of functions if anyone wants.