The demo application provides a
description on how to use the demo application to connect two configured boards and
communicate over Bluetooth LE. 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 with one of the devices has to have the Phone Alert Status running on
it. It can be started by running RegisterPASS.
- Next, the device acting as a
Server needs to advertise to other devices. This can be done by issuing the
AdvertiseLE 1 command.
Device 2 (Client) setup on the demo applicationNote: Steps c and d 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
issuing the StartScanning command.
- Once you have found the device,
you can stop scanning by issuing the StopScanning command.
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 issuing the ConnectLE <Bluetooth Address>
command
- After initialization, the Client
needs to find out whether PASS services are supported and what PASS features are
available. For this, issue the DiscoverPASS command on the Client. After the
service discovery operation is complete, the PASS Service Discovery Summary and
list of supported features is shown.
- After getting the list of
supported features, the next step is to configure the PASS on the Client. We can
set the configuration for Alert Status Notify and Ringer Settings.
- In this case, both Alert Status
Notify and Ringer Setting Notify are enabled by issuing the ConfigureRemotePASS
<Alert status notify> <Ringer Setting Notify>
Alert Notification between Client and Server
- After configuring, The Phone
Alert System is now active. We can get the status of the Alert and Ringer by
issuing the NotifyAlertStatus and NotifyRingerSetting commands.
After running
NotifyAlertStatus and NotifyRingerSetting on the Server, we get the Alert
Status and Ringer Setting on the Client.
- We can set the Alert Status for
each of the three options (Display, Vibrate and Ringer) by issuing the
SetAlertStatus <Ringer> <Vibrate> <Display> command and
setting each option either active or inactive.
In this example, we set
all of them to active and then issue the NotifyAlertStatus command.
The Client will then
receive the updated alert status.
- Similarly, we can toggle the
ringer setting between Silent and Normal through SetRingerSetting.
In our example, we set
toggle between Normal and Silent settings and update the setting by issuing
the NotifyRingerSetting command.
The Client sees the
updated Ringer settings.
We can also move the
device into and out of silent mode by issuing the SetSilentMode and
CancelSilentMode commands and Mute the device by issuing the MuteOnce
command.