SWRA772 august 2023 CC2564C
The first step to connecting the devices is to add the SPP LE Service and characteristics to LightBlue. To do this manually, create a blank virtual peripheral in LightBlue and then add the necessary service and characteristics. Another option is to clone SPPLEDemo while SPPLEDemo acts as the server. To clone SPPLEDemo first connect the 2 devices as described above. After the 2 devices are connected, choose the Clone option in the top right corner of the display. The app returns to the devices list and observe the SPPLEDemo listed as a Virtual Peripheral as seen below:
After cloning, the SPP LE service can now connect with the devices. Next, restart SPPLEDemo and when prompted start the app as a client. Next scan for the iOS device using the StartScanning command. When the iOS device has been found stop the scan using the StopScanning command. Now connect to the iOS device using the ConnectLE 5c75524c733a 1 command. After this, run the DiscoverSPPLE 5c75524c733a command within the 10 second timeframe. After the SPP LE service discovery completes, run the ConfigureSPPLE 5c75524c733a within the 25 second timeframe. The iOS device disconnects from SPPLEDemo if the commands are not run within these timeframes. After the SPP LE characteristics are configured the 2 apps stay connected, however, note that if the iOS device goes to sleep this closes the connection. After running the commands just described, observe output similar to the following in SPPLEDemo's terminal:
OpenStack().
Bluetooth Stack ID: 1.
Device Chipset: 4.1.
BD_ADDR: 0xd03972cdab68
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>StartScanning
Scan started successfully.
SPP+LE>
etLE_Advertising_Report with size 36.
1 Responses.
Advertising Type: rtConnectableUndirected.
Address Type: atRandom.
Address: 0x5c75524c733a.
RSSI: -71.
Data Length: 21.
AD Type: 0x01.
AD Length: 0x01.
AD Data: 0x1a
AD Type: 0x07.
AD Length: 0x10.
AD Data: 0x39 0x23 0xcf 0x40 0x73 0x16 0x42 0x9a 0x5c 0x41 0x7e 0x7d 0xc4 0x9a 0x83 0x14
SPP+LE>
etLE_Advertising_Report with size 36.
1 Responses.
Advertising Type: rtScanResponse.
Address Type: atRandom.
Address: 0x5c75524c733a.
RSSI: -71.
Data Length: 11.
AD Type: 0x09.
AD Length: 0x09.
AD Data: 0x53 0x50 0x50 0x4c 0x45 0x44 0x65 0x6d 0x6f
SPP+LE>StopScanning
Scan stopped successfully.
SPP+LE>ConnectLE 5c75524c733a 1
Connection Request successful.
SPP+LE>
etLE_Connection_Complete with size 16.
Status: 0x00.
Role: Master.
Address Type: Random.
BD_ADDR: 0x5c75524c733a.
SPP+LE>
etGATT_Connection_Device_Connection with size 16:
Connection ID: 1.
Connection Type: LE.
Remote Device: 0x5c75524c733a.
Connection MTU: 23.
SPP+LE>
Exchange MTU Response.
Connection ID: 1.
Transaction ID: 1.
Connection Type: LE.
BD_ADDR: 0x5c75524c733a.
MTU: 131.
SPP+LE>
SPP+LE>DiscoverSPPLE 5c75524c733a
GATT_Start_Service_Discovery success.
SPP+LE>
Service 0x000f - 0x001b, UUID: 14839ac47d7e415c9a42167340cf2339.
SPP+LE>
Service Discovery Operation Complete, Status 0x00.
SPP+LE>ConfigureSPPLE 5c75524c733a
SPPLE Service found on remote device, attempting to read Transmit Credits, and configured CCCDs.
SPP+LE>
Write Response.
Connection ID: 1.
Transaction ID: 15.
Connection Type: LE.
BD_ADDR: 0x5c75524c733a.
Bytes Written: 2.
SPP+LE>
Write Response.
Connection ID: 1.
Transaction ID: 16.
Connection Type: LE.
BD_ADDR: 0x5c75524c733a.
Bytes Written: 2.
Now that the 2 devices are connected and configured the devices can send and receive data between them. Now select the SPPLEDemo Virtual Peripheral in LightBlue to see the virtual peripheral's characteristics. Observe the following or similar on the iDevice's display: