Hi all -
I'm developing a BLE product using the CC2564B, MSP430, and Bluetopia stack v1.5R2. Everything seems to be working just fine, and I can connect / pair / start up encryption / exchange IRK / resolve random addresses successfully with my Cypress CySmart development tool (dongle and software on PC that act as BLE master). It also works correctly on Android 5.0 (Bluetooth LE Scanner utility app).
However, when I try to pair from an iOS device, pairing ends before the IRK is exchanged. This is consistent whether I use our app under development, or BLE Utility from the app store. In the Bluetopia GAP LE callback, this manifests as a 0x0B status code in the latPairingStatus event (which, incidentally, doesn't seem to correspond directly with an HCI event??). I'm not quite sure what triggers the 0x0B and in the stack it's defined as GAP_LE_PAIRING_STATUS_UNSPECIFIED_REASON, which does not help me understand more.
Below is the log from the unsuccessful pairing. I've added a dump of data transmitted (T: tag) and received (R: tag) over the HCI interface. Most of it I can parse out, although I'm unsure of the role of the ACL data going back and forth near where the pairing status error is logged.
Hoping someone here can help. Let me know if any more information is needed. I'll post if I find an answer meanwhile. Thanks so much!
- B
// Initial connection is complete at this point - MTU 23, LE, with remote (random bdaddr) 0x465C2CF7F077.
...
T: 0201040A000600040005011A000328
R: 0201240700030004000A1B00
R: 0413050101040200
T: 0201040C00080004000B00000000000000
R: 0201240700030004000A1E00
>> Rejected read due to insufficient authentication.
T: 020104090005000400010A1E0005
R: 0201240B000700060001040005100303
R: 0413050101040200
>> Pairing Request: 0x465C2CF7F077.
IO Capability: lcKeyboardDisplay.
MITM: TRUE.
Bonding Type: Bonding.
OOB: OOB Not Present.
Encryption Key Size: 16.
Sending Keys:
LTK: YES.
IRK: YES.
CSRK: NO.
Receiving Keys:
LTK: YES.
IRK: YES.
CSRK: NO.
>> Sending Pairing Response to 0x465C2CF7F077.
T: 0201040B000700060002030005100303
>> GAP_LE_Authentication_Response returned 0.
>> latConfirmationRequest.
>> Invoking Just Works.
T: 01182000
R: 040E0C01182000C588C2E3F253FDF7
T: 01182000
R: 040E0C011820002BBDD4FF73E3B816
T: 0117202000000000000000000000000000000000C489C3E7F256EDF428BFD7FF76F3BB15
R: 040E14011720008DE1C74711A7404630D9E2C906575884
T: 01172020000000000000000000000000000000005DF5613C1AF637B6C7F5BE8F06575884
R: 040E140117200086F1AE6E079D3A9DF3C39B2085AA17A1
R: 0413050101040100
R: 30
T: 31
R: 32
T: 33
R: 02
R: 012415001100060003D747D26E4FE959549FF7DDC908C10BD3
T: 0201041500110006000386F1AE6E079D3A9DF3C39B2085AA17A1
R: 020124150011000600040F28F40625DCBDE220633B86B8491590
T: 01172020000000000000000000000000000000000E29F50225D9ADE123613886BD591693
R: 040E140117200098E17CA5144C5C3B11561804662A3646
T: 011720200000000000000000000000000000000048F5DADE1F1D2BCBE67A4442662A3646
R: 040E1401172000D747D26E4FE959549FF7DDC908C10BD3
T: 02010415001100060004C588C2E3F253FDF72BBDD4FF73E3B816
T: 01172020000000000000000000000000000000000F28F40625DCBDE2C588C2E3F253FDF7
R: 040E140117200056BBD0D8CFB4A3276714FE0F0EC19B4E
R: 0413050101040200
R: 043E0D05010400000000000000000000
T: 011A2012010456BBD0D8CFB4A3276714FE0F0EC19B4E
R: 040E06011A2000010430
T: 31
R: 32
T: 33
R: 04080400010401
>> etLE_Encryption_Change with size 8.
>> Successfully encrypted in path etLE_Encryption_Change.
>>Encryption Information Request 0x465C2CF7F077.
>> Calling GAP_LE_Generate_Long_Term_Key.
T: 01182000
R: 040E0C01182000E68A51F7CC196B7A
T: 01182000
R: 040E0C011820000815D513213C8E2A
T: 011720202D23D811DE492B18298A70391C121271E68A51F7CC196B7A0000000000000000
R: 040E1401172000D7CD7B0613EEF85C4D4B86164798C445
T: 0117202028BAE13713B2204516B219D080EE4A51213C0000000000000000000000000000
R: 040E14011720008B1DDC2FE4DDCC7D8D97FD6CF1058B06
>> Encryption Information Request Response.
T: 020104150011000600068B1DDC2FE4DDCC7D8D97FD6CF1058B06
T: 0201040F000B00060007E579E68A51F7CC196B7A
>> GAP_LE_Authentication_Response (larEncryptionInformation) success.
>> Identity information requested by host.
>> Identity Information Request Response.
T: 0201041500110006000819E73CCB212B372373248423B6354516
T: 0201040C00080006000901D014A67B0B51
>> GAP_LE_Authentication_Response (larIdentityInformation) success.
R: 0413050101040200 // Packet count info
R: 0201240600020006000508 // ACL incoming, 0006 bytes
R: 0413050101040200 // Packet count info
R: 02012409000500040004 // ACL incoming, 0009 bytes
>> Pairing Status: 0x465C2CF7F077.
>> Status: 0x0B. // WHY, iOS?
T: 01060403010413 // Disconnect command (reason 13, remote user terminated connection)
R: 1F001F00
R: 040F0400010604 // Packet count info
T: 0201040A000600040005011F000328 // ACL outgoing, 000A bytes
R: 0413050101040100 // Packet count info
R: 04050400010416 // Disconnection complete
>> etGATT_Connection_Device_Disconnection with size 10:
Connection ID: 3.
Connection Type: LE.
Remote Device: 0x465C2CF7F077.
>> etLE_Disconnection_Complete with size 9.
Status: 0x00.
Reason: 0x16.
BD_ADR: 0x465C2CF7F077.
>> Warning - Disconnect from unknown device.
T: 0108202007020102030300FF000000000000000000000000000000000000000000000000 // Set advert data
R: 040E0401082000 // Completed set advert data
T: 010920200E0D0948616C6F20426F61726420430000000000000000000000000000000000 // Set scan response
R: 040E0401092000 // Completed set scan response
T: 0106200FA00040010001000000000000000700 // Set advert parameters
R: 040E0401062000 // Completed set advert params
T: 010A200101 // Enable advert
R: 040E04010A2000 // Completed enable advert
>> GAP_LE_Advertising_Enable success.