I have just downloaded the bluetopia SDK and am trying to test the SPPDemo application with a Windows 7 SP1 notebook.
I am using the DK-EM2-2560B kit for the DK-LM3S9D96 evaluation board.
I am opening a SPP Server port on the stellaris side and trying to open a serial port on the PC to connect to it.
When I first did this, everything worked OK.
I managed to pair succesfully and Windows created a virtual serial port for communication:
Server>
atPINCodeRequest: 0x402cf4180c08
Respond with: PINCodeResponse
Server>pincoderesponse 65808515
GAP_Authentication_Response(), Pin Code Response Success.
Server>
atLinkKeyCreation: 0x402cf4180c08
Link Key Stored.
While opening the com port from the windows pc, the server reported
atLinkKeyRequest: 0x402cf4180c08
GAP_Authentication_Response success.
Server>
SPP Open Indication, ID: 0x0002, Board: 0x402cf4180c08.
Server>
SPP Port Status Indication: 0x0002, Status: 0x000b, Break Status: 0x0000, Length: 0x0000.
Server>
SPP Port Status Indication: 0x0002, Status: 0x000b, Break Status: 0x0000, Length: 0x0000.
I could then send data back and forth over the bluetooth link.
I then powered down the stellaris board for the night and went home.
The next day I powered it back up, and could not open the virtual com port from the PC (windows remembered the paired device, so i did not need to pair it again)
Whenever I tried to connect I only got the following response on the stellaris board:
atLinkKeyRequest: 0x402cf4180c08
GAP_Authentication_Response success.
I could never get it to connect!
Then in desparation I removed the device from Windows and re-paired it to the stellaris board.
When I then tried to connect it worked, and I got the following response on the stellaris side:
atLinkKeyRequest: 0x402cf4180c08
GAP_Authentication_Response success.
Server>
SPP Open Indication, ID: 0x0002, Board: 0x402cf4180c08.
Server>
SPP Port Status Indication: 0x0002, Status: 0x000b, Break Status: 0x0000, Length: 0x0000.
Server>
SPP Port Status Indication: 0x0002, Status: 0x000b, Break Status: 0x0000, Length: 0x0000.
I then looked at the code for the SPPDemo example and saw that the code behaved differently if it had the link key information for the requested connection
/* Setup the authentication information response */
/* structure. */
GAP_Authentication_Information.GAP_Authentication_Type = atLinkKey;
GAP_Authentication_Information.Authentication_Data_Length = 0;
/* Link Key information stored, go ahead and */
/* respond with the stored Link Key. */
GAP_Authentication_Information.Authentication_Data_Length = sizeof(Link_Key_t);
GAP_Authentication_Information.Authentication_Data.Link_Key = LinkKeyInfo[Index].LinkKey;
It seems that Windows will only complete the connection if the GAP_Authentication_Information.Authentication_Data.Link_Key is filled in.
My question is, is this a problem with Windows, or is the SPPDemo program doing something wrong?
(sorry for the long post)
Clive
