Hi SSO:
Phone: HTC M8 running Android 4.4
Our device: Stellaris LM4F232 EVM running Stellaris Bluetopia Stack V1.0
My purpose is that phone BT pairs with our device without PIN, confirmation or other indication. So we set IO Capability to icNoInputNoOutput and enable simple pairing.
Here is my problem: sometimes our device cannot generate link key especially when we take phone away from our device (about 2 meters away). However, phone still generates new link key without any indication.
As you can see in the following log, our device generated link key successfully at first time. And then we move phone to 2 meters away and try to pair again. Our device then failed to generate link key at second time. I also print out HCI event type in order to see more details. We found there were only etNumber_Of_Completed_Packets_Event and etDisconnection_Complete_Event after etSimple_Pairing_Complete_Event in the second case.
Is there any unreasonable setting for my application? Or is this RF performance issue which CC2564 might receives wrong packets?
=====================================================================================
Test log:
SPP+LE>OpenStack().
HCI_VS_InitializeAfterHCIReset
Set Baud Rate
HCI_VS_InitializeAfterHCIReset Success
Bluetooth Stack ID: 1.
Device Chipset: 4.0.
BD_ADDR: 0x0018343b78c6
******************************************************************
* Command Options: Server, Client, Help *
******************************************************************
SPP+LE>client
******************************************************************
* Command Options General: Help, GetLocalAddress, SetBaudRate *
* Quit, *
* Command Options BR/EDR: Inquiry, DisplayInquiryList, Pair, *
* EndPairing, PINCodeResponse, *
* PassKeyResponse, *
* UserConfirmationResponse, *
* SetDiscoverabilityMode, *
* SetConnectabilityMode, *
* SetPairabilityMode, *
* ChangeSimplePairingParameters, *
* GetLocalName, SetLocalName, *
* GetClassOfDevice, SetClassOfDevice, *
* GetRemoteName, SniffMode, *
* ExitSniffMode, Open, Close, Read, *
* Write, GetConfigParams, *
* SetConfigParams, GetQueueParams, *
* DisplayRawModeData, AutomaticReadMode,*
* SetQueueParams, Loopback, *
* CBSend. *
* Command Options GAPLE: SetDiscoverabilityMode, *
* SetConnectabilityMode, *
* SetPairabilityMode, *
* ChangePairingParameters, *
* AdvertiseLE, StartScanning, *
* StopScanning, ConnectLE, *
* DisconnectLE, PairLE, *
* LEPasskeyResponse, *
* QueryEncryptionMode, SetPasskey, *
* DiscoverGAPS, GetLocalName, *
* SetLocalName, GetLERemoteName, *
* SetLocalAppearance, *
* GetLocalAppearance, *
* GetRemoteAppearance, *
* Command Options SPPLE: DiscoverSPPLE, RegisterSPPLE, LESend, *
* ConfigureSPPLE, LERead, Loopback, *
* DisplayRawModeData, AutomaticReadMode *
******************************************************************
SPP+LE>setpair 2
Pairability Mode Changed to pmPairableMode_EnableSecureSimplePairing.
LE: I/O Capabilities: No Input/Output, MITM: TRUE.
BR/EDR: I/O Capabilities: No Input/Output, MITM: TRUE.
SPP+LE>setdis 2
Discoverability: General.
SPP+LE>
HCI Event Type: 0x03
HCI Event Type: 0x02
HCI Event Type: 0x1d
HCI Event Type: 0x18
HCI Event Type: 0x23
HCI Event Type: 0x10
HCI Event Type: 0x2f
HCI Event Type: 0x10
atIOCapabilityResponse: 0x502e5cbeada3
Capabilities: Display Yes/No, MITM
SPP+LE>
HCI Event Type: 0x2a
atIOCapabilityRequest: 0x502e5cbeada3
Auth success.
SPP+LE>
HCI Event Type: 0x29
atUserConfirmationRequest: 0x502e5cbeada3
Auto Accepting: 249730
GAP_Authentication_Response success.
SPP+LE>
HCI Event Type: 0x2b
Un-handled Auth. Event.
SPP+LE>
HCI Event Type: 0x2e
atLinkKeyCreation: 0x502e5cbeada3
Link Key Stored.
SPP+LE>
HCI Event Type: 0x15
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x04
SPP+LE>setdis 0
Discoverability: Non.
SPP+LE>setdis 2
Discoverability: General.
SPP+LE>
HCI Event Type: 0x03
HCI Event Type: 0x02
HCI Event Type: 0x1d
HCI Event Type: 0x10
HCI Event Type: 0x2f
atIOCapabilityResponse: 0x502e5cbeada3
Capabilities: Display Yes/No, MITM
SPP+LE>
HCI Event Type: 0x2a
atIOCapabilityRequest: 0x502e5cbeada3
Auth success.
SPP+LE>
HCI Event Type: 0x29
HCI Event Type: 0x10
HCI Event Type: 0x18
HCI Event Type: 0x23
atUserConfirmationRequest: 0x502e5cbeada3
Auto Accepting: 986426
GAP_Authentication_Response success.
SPP+LE>
HCI Event Type: 0x2b
Un-handled Auth. Event.
SPP+LE>
HCI Event Type: 0x2e
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x10
HCI Event Type: 0x04
=====================================================================================
Best Regards
Joe Wu