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 pairing and bonding

Other Parts Discussed in Thread: CC2650

hello all,

can any one help me to know  about  how pairing and bonding  is working with stack 2.0 stack. currently i am facing one issue like if i am doing ble pairinf with hardcoded pin .means i am  setting  the macro as like (mitm = true,i/o capability =0, key size =6 and bonding = true).if u want to do pairing and bonding operation with cc2650 device and  mobile  with hardcoded  key (parse key is 123456)it is happening correctly  and i am able to read and right  any characteristics as per my application. if i am wrong  parse key (i.e 123123) pairing and bonding is  getting fail ,yes that is correct,because incorrect key  ,but i am able to read and write the a value help of a characteristics even if boning fail. how it is possible . can u help me to solve this problem .

  • Hi Tapas,

    This has to do with the permissions of your characteristics. Characteristics with permissions such as GATT_PERMIT_READ or write do not require any level of security to be accessed. If you would like to restrict read/write access to your characteristics to be only with successfully bonded devices, then I recommend using GATT_PERMIT_AUTHEN_READ or write. This means the char is only accessible once authenticated.

    See the BLE spec for more details
  • thanks for your ans ,
    but i am setting all the macro in gapbondmanager as(mitm = true,i/o capability =0, key size =6 and bonding = true) and i am doing pairing and bonding operation with my cc2650 and mob with hardcoded pin. as per your answer if u want to read and write any value to particular value i need to use GATT_PERMIT_AUTHEN_READ or write.i am new to ti .can u tell me where to implement this in GATT profile.with some example. how to test pairing and bonding successfully happened or not that why i am trying to read characteristics if bonding is success if bonding fail i cannot read value of characteristics.
  • Right,

    If you want want to require authentication for read/writing your characteristics, they all must be set up with these properties. Otherwise they will be readable and writable by all devices in a connection with the server.
    For an example of how to do this, please see characteristic 5 of our simple profile. This profile is included in many example projects such as SimpleBLEPeripheral.
    As for seeing the state of pairing/bonding. You get callbacks with the pairstate from the bond manager. This will give you the state of the pairing process. Again, see simpleBLEperipheral for examples.