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.

BLE 1.3 Stack Simple Ble forgets pairing information

Other Parts Discussed in Thread: CC2540

HI, 

I wonder if anyone can help.

I'm using the Simple BLE Peripheral profile with Stack ver 1.3 and developing with CC2540 device.

Although I'm not sure if this has anything to do with it but I have recently added a new Service to my system and whilst this appears to be working, I now appear to have removed the ability of my Central device forgetting the pairing information.


Here are the symptoms.
So long as my handheld (An iPod) has no history of the Simple Peripheral device (that is, if I remove any pairing information from SETTINGS - by executing 'Forget This Device') then (using LightBlue App) I can find and connect to my Simple Peripheral. And exchange data.. However, in any subsequent attempts to connect to the already 'paired' device, I get TIME OUT Errors..

If I go back and 'Forget This Device' from SETTINGS again, then it appears to find and connect to it, obviously it asks me for PAIRING Code each time I go round this loop :(

This was certainly working without any problems but I have clearly done something wrong and I can't figure out what..

Any ideas or tips as to where I should look for this problem would be very much appreciated. Or if this question has already been asked/answered here on the forum, then a pointer to it would be appreciated.

Thank you.

  • Hi Joe,

    In your new service, are you defining any characteristics that require authentication and/or encryption? It could be something forcing a repairing.

    Best Regards

    Joakim

  • Hi Joakim,

    Thank you for your response.

    No. They don't.

    Although, after browsing through my code for anything relating to Authentication, I note the following in my CallBack function, which I adopted from an existing Service.

    _________________________

    static uint8 MyServiceData_WriteAttrCB(uint16 connHandle, gattAttribute_t *pAttr,
    uint8 *pValue, uint8 len, uint16 offset )
    {
    bStatus_t status = SUCCESS;
    uint16 uuid = BUILD_UINT16( pAttr->type.uuid[0], pAttr->type.uuid[1]);

    // If attribute permissions require authorization to write, return error.
    if ( gattPermitAuthorWrite( pAttr->permissions ) )
    {
    // Insufficient authorization
    return ( ATT_ERR_INSUFFICIENT_AUTHOR );
    }

    switch (uuid)
    {

    ......

    ________________________

    None of my Characteristics or Characteristic-Properties are defined as needing Authentication or Authorisation...

    Could this still be the problem??? Should I remove this 'validation' code from my file???

    ALso, I have recently updated my iPod iOS to version 8.02 - My assumption was that this could be the issue but so far I have not been able to cure the problem...

    Regards,

    JB.

  • Hi JB,

    That validation does not need to be removed if you do not have any active security restrictions. One the other hand, you might as well remove it, if your not intending to protect characteristics by Authentication.

    Could you try with the latest BLEv1.4 as well?

  • I'm not comfortable with moving to 1.4 from v1.3 which works very well for my application - particularly with where I am with this code at the moment and don't want to risk losing the stability.

    Thanks all the same, I will consider the possibility of this being down to 1.3 but it may be an idea for me to take a step back and review the grafting of my new Service.. I may have overlooked something.

    Thanks for your suggestions.