I am developing an application where a client need to receive notification of temperature values.
I want only an authenticated client to be able to ask for notification and I have accordingly marked the notification attribute:
// Characteristic 1 configuration
{
{ ATT_BT_UUID_SIZE, clientCharCfgUUID }, // GATT_CLIENT_CHAR_CFG_UUID
GATT_PERMIT_READ | GATT_PERMIT_AUTHEN_WRITE,
0,
(uint8 *)simpleProfileChar1Config
},
I require a password for pairing:
// Setup the GAP Bond Manager
{
uint32 passkey = 431323; // passkey "000000"
uint8 pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
uint8 mitm = FALSE;
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 );
}
I also tried with mitm=FALSE with the same results.
When I use a Galaxy S5 to pair, the password is requested and the pairing is not completed if the password is wrong, as I expected.
When I use a PC software with Bluegiga BLED112 the pairing is completed even without giving the password. Further I can set the characteristic configuration to 01 00 and I actually start receiving the notifications.
Probably there is something wrong on the BLED112 side, but the final result is that with BLED112 I can pass through the CC2540 security.