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.

pair and bound cc2540

Other Parts Discussed in Thread: CC2540, CC2541

Dear all,


I have a problem with bound process.  I use cc2540 and iphone s5.

I setup the GAP bond manager of this way:
  {
    uint8 pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
    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 );   
  }

The first time, the behavior is right, I connect with my iphone and it shows the pass code, I enter it and I can read the atributes of the service (characteristic with athentication to read or write). But the next one, when I try read them, the phone show "reading" and it never can read. To read them, I have to forget the device in settings bluetooth options in the iphone, and now the situation is the same than the first time, if I try to connect it, show the passcode and I can read the characteristis of the service.

I set up the authentication in characteristic value:

{
        { ATT_BT_UUID_SIZE, GeoBageProfileOnOffUUID },
        GATT_PERMIT_AUTHEN_READ | GATT_PERMIT_AUTHEN_WRITE,
        0,
        &GeoBageProfileOnOff
},

I need help to solve this problem, because i don't know what can I do. If I define pair made as GAPBOND_PAIRING_MODE_INITIATE the device always request passcode, and I want to do that once.


Thanks to help me.

Ruben.

  • Hi,


    has someone tried to pairing with passcode??

  • You should be aware that authentication requirements need to be set in the Characteristic Declaration, not the Characteristic Value declaration.

    More details in this thread: http://e2e.ti.com/support/low_power_rf/f/538/p/214846/1071343.aspx#1071343

  • Thank you so much!!

    Now in ios it works properly, but in android it can't pairing, the log of the app return GATT INTERNAL ERROR when it try to discover services (I use nexus 7, android verion 4.4).

  • has someone made the paring (with passcode) with android device?

  • Hi,

    I encountered the same thing.  Everything works correctly in reading the characteristic with permissions GATT_PERMIT_ENCRYPT_READ using an iOS 7.1 device.  However, I'm seeing problems using an Android device.

    I am able to properly pair with the Android device (Android 4.4) since my CC2541 device name can be seen in the bluetooth settings list of paired devices.  However, I always get the status error of 129 or GATT_INTERNAL_ERROR.  Has anyone been able to make this work on Android?  Or does anyone know the reason for the error?

    Leo

  • Hi all,

    we have the same problem accessing characteristics with Android OS app. after setting up characteristics declaration authentication requirements. Has anyone found a solution for this?

    Best,

    Primoz 

     

  • Hi !

    The properties can be set in both the declaration and the value descriptor. It seems that setting the characteristic declaration property to authenticated read gets Android in trouble. It will then always return 129 error code. When setting only the property of the value to AUTH like this :

    // Characteristic 1 Declaration
    {
    { ATT_BT_UUID_SIZE, characterUUID },
    GATT_PERMIT_READ,
    0,
    &simpleProfileChar1Props
    },

    // Characteristic Value 1
    {
    { ATT_BT_UUID_SIZE, simpleProfilechar1UUID },
    GATT_PERMIT_AUTHEN_READ | GATT_PERMIT_AUTHEN_WRITE,
    0,
    &simpleProfileChar1
    },

    // Characteristic 1 User Description
    {
    { ATT_BT_UUID_SIZE, charUserDescUUID },
    GATT_PERMIT_READ,
    0,
    simpleProfileChar1UserDesp
    },

    both Android and iOS will function properly. Remember that when pairing in Android one needs to use 6 digit pairing code. E.G. 0 -> 000000. The difference in iOS is that it will ask for pairing during the characteristic scanning if AUTH is set in the declaration, and will wait til one reads the characteristic when AUTH is set in the Value.

    I have done my testing with iOS 8.0, since I do not have any older iOS devices available. 

    BR,

    Ole A.

  • Hi,

    now there is another issue when setting property of the characteristic value ONLY. Now i have problems connecting to peripheral device with (physical) CC2541 key fob that implements GAP central profile. Key fob should receive characteristic  notifications from peripheral device, but notifications are no longer sent/received (i didn't debug this issue yet). Key fob uses PIN for pairing with peripheral device. Bonding is also enabled.

    Are there any authentication settings that has to be set on key fob side when enabling characteristic value authentication settings on peripheral device?

    Best,

    Primoz

  • Hello Primoz,

    Could you elaborate a bit more specific on what happens? Can you connect at all? You say that you no longer receive notifications, what does that mean exactly?