SWRA772 august   2023 CC2564C

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. Introduction
  5. Running the Bluetooth Code
  6. Demo Application
    1. 3.1 Device 1 (Server) Setup on the Demo Application
    2. 3.2 Device 2 (Client) Setup on the Demo Application
    3. 3.3 Initiating Connection from Device 2
    4. 3.4 Identify Supported Services
    5. 3.5 Data Transfer Between Client and Server
    6. 3.6 Multiple SPPLE Connections Guide
  7. Demonstrating SPP LE on an iOS Device with the LightBlue App
    1. 4.1 LightBlue Overview
    2. 4.2 SPP LE Service Overview
      1. 4.2.1 Characteristics
  8. LightBlue as the Client/SPPLEDemo as the Server
    1. 5.1 Connecting the Devices
    2. 5.2 Enabling Notifications
    3. 5.3 Sending Data from LightBlue/Receiving Data in SPPLEDemo
    4. 5.4 Sending Data from SPPLEDemo/Receiving Data in LightBlue
  9. LightBlue as the Server/SPPLEDemo as the Client
    1. 6.1 Connecting the Devices
    2. 6.2 Sending Data from LightBlue/Receiving Data in SPPLEDemo
    3. 6.3 Sending Data from SPPLEDemo/Receiving Data in LightBlue
  10. Application Commands
  11. General Commands
    1. 8.1 Help (DisplayHelp)
    2. 8.2 Get Local Address
    3. 8.3 Set Baud Rate
    4. 8.4 Quit
  12. BR/EDR Commands
  13. 10GAPLE Commands
    1. 10.1  Set Discoverability Mode
    2. 10.2  Set Connectability Mode
    3. 10.3  Set Pairability Mode
    4. 10.4  Change Pairing Parameters
    5. 10.5  Advertise LE
    6. 10.6  Start Scanning
    7. 10.7  Stop Scanning
    8. 10.8  Connect LE
    9. 10.9  Disconnect LE
    10. 10.10 Pair LE
    11. 10.11 LE Pass Key Response
    12. 10.12 LE Query Encryption
    13. 10.13 Set Passkey
    14. 10.14 Discover GAPS
    15. 10.15 Get Local Name
    16. 10.16 Set Local Name
    17. 10.17 Get Remote Name
    18. 10.18 LE User Confirmation Response
    19. 10.19 Enable SC Only
    20. 10.20 Regenerate P256 Local Keys
    21. 10.21 SC Generate OOB Local Params
    22. 10.22 Set Local Appearance
    23. 10.23 Get Local Appearance
  14. 11SPPLE Commands
    1. 11.1 Discover SPPLE
    2. 11.2 Register SPPLE
    3. 11.3 LE Send
    4. 11.4 Configure SPPLE
    5. 11.5 LE Read
    6. 11.6 Loopback
    7. 11.7 Display Raw Mode Data
    8. 11.8 Automatic Read Mode
  15. 12References
  16. 13Revision History

Connecting the Devices

First establish a connection between the devices. To do this open the LightBlue app, observe a screen similar to the following:


GUID-20230227-SS0I-DRPL-LZ5B-7MMDN0XDZG42-low.png

In the SPPLEDemo terminal start the app as a server, register the SPP LE Service, and begin advertising using the Server, RegisterSPPLE, and AdvertiseLE 1 commands. Observe the following in the terminal:

OpenStack().
Bluetooth Stack ID: 1.
Device Chipset: 4.1.
BD_ADDR: 0x0017e9d3581a

Command Options: Server, Client, Help 

SPP+LE>Server

 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, 
 SetQueueParams, Loopback, 
 DisplayRawModeData, AutomaticReadMode,
 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>RegisterSPPLE
Sucessfully registered SPPLE Service.
SPP+LE>AdvertiseLE 1
GAP_LE_Advertising_Enable success.

Now that SPPLEDemo is advertising, observe the device shown in LightBlue:


GUID-20230227-SS0I-KSQJ-82HZ-VBQBSFWKCH2C-low.png

Next select the SPPLEDemo device in LightBlue, after doing so, observe the following screen:


GUID-20230227-SS0I-QCG7-FPTW-TCF9NPR5RJ4D-low.png

In the SPPLEDemo terminal, observe the following:

etLE_Connection_Complete with size 16.
Status: 0x00.
Role: Slave.
Address Type: Random.
BD_ADDR: 0x5cfc3252180b.
SPP+LE>
etGATT_Connection_Device_Connection with size 16:
Connection ID: 2.
Connection Type: LE.
Remote Device: 0x5cfc3252180b.
Connection MTU: 23.

The devices are now connected.