This section provides the detailed procedure to run the GAP-Central demo so it
communicates with the GAP-Peripheral device.
- 1.Connect two devices with the
GAP-Central and GAP-Peripheral configurations flashed into BM70/71. For the
serial console configuration, refer to the Base Configuration.
Note: To run this demo application,
one GAP-Central device with GAP-Central demo application flashed into SAML21
of GAP-Central device and one GAP-Peripheral device with GAP-Peripheral demo
application flashed into the SAML21 of GAP-Peripheral device is
needed.
- 2.Make sure that POWER LED (green) on SAML21 Xplained Pro board is solid ON.
- 3.Press the Reset button on the
SAML21 Xplained Pro board, and verify that LD4 (blue) on BM70/71-Xplained Pro is
blinking at a regular interval.
- 4.Ensure the GAP-Central device is
up and running and starts scanning as illustrated in the following figure. Check
the status on a serial console application. As the GAP-Central device receives
advertisements from devices in the vicinity, it prints the advertisement report
in the serial console.
Figure 1. Central Device
Scanning
- 5.Ensure that the GAP-Peripheral
device is advertising by checking the Tera Term window for an
Adv
started
message.
Figure 2. Peripheral
Device Advertising
- 6.The GAP-Central device finds the
suitable GAP-Peripheral device based on the advertisement payload and initiates
a connection. Once connected, the GAP-Central device prints the GAP-Peripheral
device address and connection parameters in the serial console.
Figure 3. GAP-Peripheral
Device Address and Connection Parameters Updates onto the
Console
- 7.Similarly, once connected, the
GAP-Peripheral device prints the GAP-Central device address and connection
parameters in serial console.
Figure 4. GAP-Central Device
Address and Connection Parameters in Serial Console Updates onto the
Console
- 8.Once connected, the GAP-Central
device discovers the device orientation service and characteristics in the
remote device based on the UUID.
Figure 5. Device Orientation
Service and Characteristics Discovery
- 9.It also discovers the Client
Characteristic Configuration Descriptors (CCCD) of the accelerometer and
gyroscope sensor characteristics, and enables them to receive notifications as
illustrated in the following figure.
Figure 6. Notifications Status
of Accelerometer and Gyroscope of the Peripheral Device
- 10.Upon getting notified by the
GAP-Central device, GAP-Peripheral device starts notifying the accelerometer and
gyroscope sensor data to the GAP-Central device.
- 11.GAP-Peripheral prints the
accelerometer and gyroscope sensor data on the serial console. It also prints
the notification status on the serial console as illustrated in the following
figure.
Figure 7. Notification Status of
Central Device
- 12.GAP-Central devices receive
sensor data notifications and print them on the serial console.
Figure 8. Sensor Data
Notifications from the Peripheral to the Central Device