Below is a description on how to use the
demo application to connect two configured boards and communicate over bluetoothLE.
The included application registers a custom service on a board when the stack is
initialized.
Device 1 (Server) setup on the demo application
- To start, place the device into
server mode by typing: Server on the console. The SPP-LE Service can then
be started by running RegisterSPPLE.
- Next, the device acting as a
server needs to advertise to other devices. This can be done by running
AdvertiseLE 1.
Device 2 (Client) setup on the demo application
- Place the device into client mode by typing Client on the console.[Steps
d and e are optional if you already know the Bluetooth address of the device
that you want to connect to]
- The client LE device can try to find which LE devices are in the vicinity using
the command: StartScanning.
- Once you have found the device,
you can stop scanning by using the command: StopScanning.
Initiating connection from device 2
- Once the application on the
client side knows the Bluetooth address of the device that is advertising, it
can connect to that device using the command: ConnectLE <Bluetooth
Address>
Identify supported services
- After Initialization, the device
needs to find out if SPP services are supported. To do this run DiscoverSPPLE
<Server BD-Address> on the client.
- After finding out support for
SPP-LE, we need to configure SPP-LE. This is done by running ConfigureSPPLE
<Server BD-Address> on the client.
Data Transfer between Client and Server
- After configuring we can send
data between client and server. To send data we use LESend <Remote Device
BD-Address> <Number of bytes>.
- Once the other device receives the data it receives a Data Indication
event.
- The receiving device can then
read the data that was sent using command: LERead <Remote Device
BD-Address>.
- This will print out the data that
was sent. This data was sent over BluetoothLE using a custom service of SPPLE in
the sample application.
Multiple SPPLE Connections GuideTwo SPPLE
Connections
- In This version, we test two simultaneous SPPLE connections to the MSP430. The
remote devices are used as a peripheral device while the MSP430 acts as the
central device.
- Connect to the first device, discover and configure services on the first
device. When discovering services and configuring services we have to specify
the remote BD_ADDR that we connected to.
- Similarly, Connect to the second device, discover and configure services on the
second device.
- To send data to the first remote
device data we use LeSend <BD-ADDR> <Number of Bytes to be
sent>
- To send data to the second remote
device data we use LeSend <BD-ADDR> <Number of Bytes to be
sent>
- To read data from the first
remote device data we use LeRead <BD-ADDR>
- To read data from the second
remote device data we use LeRead <BD-ADDR>
- When we turn on
Automaticreadmode, DisplayRawmodedata or Loopback it turns it
on for both connections.
One SPP and One SPPLE Connection
- In this version, we test an SPP connection and SPPLE Connection at the same time
to the MSP430. One of the remote devices is used as a peripheral LE device while
the remote device as SPP Client.
- Connect to the first device, discover and configure services on the first
device. When discovering services and configuring services we have to specify
the remote BD_ADDR that we connected to.
- Open an SPP server and let the second remote device connect to it.
- To send data to the first remote
device data we use LeSend <BD-ADDR> <Number of Bytes to be
sent>
- To send data to the second remote
data we use CBSend <Number of Bytes to be sent> <Serial Port ID>.
If we want to write a small amount of data we use the command Write
<Serial Port ID>
- To read data from the first
remote device data we use LeRead <BD-ADDR>
- To read data from the second remote device data we use Read.
- When we turn on Automaticreadmode, DisplayRawmodedata or Loopback it
turns it on for both connections.