ZHCACZ5 August 2023 CC2564C
首先,在设备之间建立连接。为此,请打开 LightBlue 应用,观察类似于以下内容的屏幕:
在 SPPLEDemo 终端中,将该应用作为服务器启动,注册 SPP LE 服务,然后使用 Server、RegisterSPPLE 和 AdvertiseLE 1 命令开始广播。在终端中观察到以下内容:
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.
现在 SPPLEDemo 正在进行广播,请观察 LightBlue 中显示的设备:
接下来,在 LightBlue 中选择 SPPLEDemo 设备,然后观察以下屏幕:
在 SPPLEDemo 终端中,观察以下内容:
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.
设备现已连接。