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.

SPP authentication and pairing in stack 1.4

Hi,

I am using stone street one SPPLE demo stack version 1.4.

I have used two SPP master devices 

1) Galaxy s3 phone 

2) PAN1323 module

As a slave i am using PAN1323 module.

When i use S3 phone then and once pairing in SPP is done 

whenever i try to connect to PAN1323 using S3 i am getting following message

in slave before port is opened 

atLinkKeyRequest: 0x0C715DF786C1
GAP_Authentication_Response success.

Now When i use PAN1323 module as master i am not getting above message 

in slave and directly i am getting following message 

SPP Open Indication, ID: 0x0001, RmtBD_ADDR: 0x0C715DF786C1.
LocateServerBySerialPortID 0.

What is the reason for this ?

Regards

Smitesh Mali

  • Moving to SSO team for precise answer.

  • Hi,

    Are you creating a BR/EDR connection between the two devices?  Is pairabilitymode is set correctly for both the server(You will need to use CBPairabilitymode here) and Client. I tried it from my side and it worked fine.

    Server>

    SPP+LE>SetCBPairabilitymode 2
    Pairability Mode Changed to pmPairableMode_EnableSecureSimplePairing.
    LE: I/O Capabilities: No Input/Output, MITM: TRUE.
    BR/EDR: I/O Capabilities: Display Yes/No, MITM: TRUE.

    SPP+LE>ChangeSimplePairingParameters 2 1
    LE: I/O Capabilities: No Input/Output, MITM: TRUE.
    BR/EDR: I/O Capabilities: Keyboard Only, MITM: TRUE.

    SPP+LE>Open 1
    Server Opened: Server Port 1, Serial Port ID 1.
    Server Port Context Stored.

    SPP+LE>
    atIOCapabilityResponse: 0x08002801F5D1
    Capabilities: Display Yes/No, MITM

    SPP+LE>
    atIOCapabilityRequest: 0x08002801F5D1
    Auth success.

    SPP+LE>
    atPasskeyRequest: 0x08002801F5D1
    Respond with: PassKeyResponse

    SPP+LE>PassKeyResponse 940542
    Passkey Response Success success.

    SPP+LE>Un-handled Auth. Event.

    SPP+LE>
    atLinkKeyCreation: 0x08002801F5D1
    Link Key Stored.

    SPP+LE>
    SPP Open Indication, ID: 0x0001, Board: 0x08002801F5D1.

    Client>

    SPP+LE>SetPairabilityMode 2
    Pairability Mode Changed to pmPairableMode_EnableSecureSimplePairing.
    LE: I/O Capabilities: No Input/Output, MITM: TRUE.
    BR/EDR: I/O Capabilities: Display Yes/No, MITM: TRUE.

    SPP+LE>Inquiry

    SPP+LE>
    Inquiry Entry: 0x74E54366804A.

    SPP+LE>
    Inquiry Entry: 0xBC0DA5F8D91C.

    SPP+LE>
    Inquiry Entry: 0x001BDC05B5A6.

    SPP+LE>
    Inquiry Entry: 0xECFE7E300048.

    SPP+LE>
    Inquiry Entry: 0xF06BCA2F55E9.

    SPP+LE>
    Result: 1,0x74E54366804A.
    Result: 2,0xBC0DA5F8D91C.
    Result: 3,0x001BDC05B5A6.
    Result: 4,0xECFE7E300048.
    Result: 5,0xF06BCA2F55E9.

    SPP+LE>open 2 1
    SPP_Open_Remote_Port success, Serial Port ID = 1.

    SPP+LE>
    atLinkKeyRequest: 0xBC0DA5F8D91C
    GAP_Authentication_Response success.

    SPP+LE>
    atIOCapabilityRequest: 0xBC0DA5F8D91C
    Auth success.

    SPP+LE>
    atIOCapabilityResponse: 0xBC0DA5F8D91C
    Capabilities: Keyboard Only, MITM

    SPP+LE>
    atPasskeyNotification: 0xBC0DA5F8D91C
    Passkey Value: 940542

    SPP+LE>Un-handled Auth. Event.

    SPP+LE>
    atLinkKeyCreation: 0xBC0DA5F8D91C
    Link Key Stored.

    SPP+LE>
    atAuthenticationStatus: 0 for 0xBC0DA5F8D91C

    SPP+LE>
    etEncryption_Change_Result for 0xBC0DA5F8D91C, Status: 0x00, Mode: Enabled.

    SPP+LE>
    SPP Open Confirmation, ID: 0x0001, Status 0x0000.

     

     

  • Hi,

    Thanks for quick reply.

    After following the steps you have mentioned i was able to reach to below point

    Client:

    SPP+LE>
    atPasskeyNotification: 0xBC0DA5F8D91C
    Passkey Value: 940542

    SPP+LE>Un-handled Auth. Event.

    Server:

    atPasskeyRequest: 0xB8FFFEAFB73C
    Respond with: PassKeyResponse
    Un-handled Auth. Event.

    But after this i am not getting following events

    SPP+LE>
    atLinkKeyCreation: 0xBC0DA5F8D91C
    Link Key Stored.

    SPP+LE>
    atAuthenticationStatus: 0 for 0xBC0DA5F8D91C

    SPP+LE>
    etEncryption_Change_Result for 0xBC0DA5F8D91C, Status: 0x00, Mode: Enabled.

    So do we need to call any API in "Un-handled Auth. Event." event 

    Regards,

    Smitesh Mali

  • Hi,

    Sorry for posting back to back queries.

    But problem here is i am using custom hardware both as client and 

    server.

    Both of them doesn't have display and keypad capability.

    So i can't keep IO capability to keyboard only.

    and I can't use simple secure paring as it requires the user to enter passkey.

    Please suggest pairing method for devices without IO capability.

    Regards,

    Smitesh Mali

  • Hi,

    If both the devices do not have a display/keyboard, your only option is to use Just Works pairing.

    Thanks,

    Stonestreet One. 

  • Hi,

    But i have a confusion.

    When in Server i keep following settings 

    IO Capability : Display Yes/No

    MITM : True

    and pairing mode is "pmPairableMode".

    in this case when i try to connect from Galaxy S3 phone it always 

    gives me starts with authentication process.

    If phone is already paired and if we delete link key from Server then it gives

    following message. 

    atLinkKeyRequest: 0x0C715DF786C1
    No Link Key Found.
    GAP_Authentication_Response success.

    so pairing will be done again.

    So how phone does authentication process before opening the port ?

    Regards,

    Smitesh Mali

     

  • Hi,

    If you use Display Yes/No it will prompt to show a Pincode when pairing. If you use No Input/Output it should pair automatically. In Android, you have to create a secured connection, which is why you receive a pairing request each time.

    Thanks,

    Stonestreet One.

  • Hi,

    Thanks for the reply.

    In Client stack do we have any API using which we can ask link key to Server ( generate

    AtLinkKeyRequest) ?

    I want to achieve following thing.

    Setting in Server is below 

    IO Capability = Display Yes/No

    MITM = TRUE

    Pairing mode = pmPairableMode

    Now from Client i want to generate pairing request every time like 

    android , can we do this ?

    If yes , what should be the setting in Client ?

    Regards,

    Smitesh Mali