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.
Hello TI experts,
I have a CC2540 USB dongle working as the central and GATT client and an iOS peripheral. The characteristics of the primary service on the peripheral are encrypted. I found that iOS says:
The pairing process starts by peripheral only if the central starts reading/writing/subscribing on an encrypted characteristic.
First of all, I do not know how to set the following parameters:
GAPBOND_PAIRING_MODE
GAPBOND_MITM_PROTECTION
If I set GAPBOND_PAIRING_MODE_WAIT_FOR_REQ, no pairing would happen. If I set GAPBOND_PAIRING_MODE_INITIATE, CC2540 initiates the pairing before characteristic discovery and when I try to write to a characteristic, I received the error shown in the attached sniffer log (INSUF_AUTHENTICATION).
Second, I do not know how to manage the pairing after characteristic discovery. I am following SimpleBLECentral project.
I'd be grateful to hear any hints/suggestion or if there is any sample code/project dealing with the same situation. I am in a taught situation approaching a demo and would appreciate any help.
Bests,
H. Sh,
To your first question, GAPBOND_PAIRING_MODE & GAPBOND_MITM_PROTECTION are set in SimpleBLECentral_Init() in simpleBLECentral.c.
What are all of these variables set to?
uint32 passkey = DEFAULT_PASSCODE; uint8 pairMode = DEFAULT_PAIRING_MODE; uint8 mitm = DEFAULT_MITM_MODE; uint8 ioCap = DEFAULT_IO_CAPABILITIES; uint8 bonding = DEFAULT_BONDING_MODE; 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 );
This thread also has a good discussion about these params on CC2540.
https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/t/304055
It may also be helpful to reference the BLE Spec on what is possible given your applications and the settings that you give for MITM, IO CAP and others.
CC2540 is my central/scanner (responder?) and GATT client. The peripheral is an iOS device. There is no control over these parameters in iOS, the only setting we applied is encryption for read/write characteristics.
Is there any TI sample code/project that works with an iOS peripheral with encrypted communication?
Thanks.