6.1 Running GAP-Central Demo with GAP-Peripheral Device
This section provides the detailed procedure to run the GAP-Central demo so it communicates with the GAP-Peripheral device.
- 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.
- Make sure that POWER LED (green) on SAML21 Xplained Pro board is solid ON.
- 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.
- 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.
- Ensure that the GAP-Peripheral
device is advertising by checking the Tera Term window for an
Adv started
message.Figure 6-2. Peripheral Device Advertising - 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 6-3. GAP-Peripheral Device Address and Connection Parameters Updates onto the Console - Similarly, once connected, the
GAP-Peripheral device prints the GAP-Central device address and connection
parameters in serial console.
Figure 6-4. GAP-Central Device Address and Connection Parameters in Serial Console Updates onto the Console - Once connected, the GAP-Central
device discovers the device orientation service and characteristics in the
remote device based on the UUID.
Figure 6-5. Device Orientation Service and Characteristics Discovery - 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-6. Notifications Status of Accelerometer and Gyroscope of the Peripheral Device - Upon getting notified by the GAP-Central device, GAP-Peripheral device starts notifying the accelerometer and gyroscope sensor data to the GAP-Central device.
- 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 6-7. Notification Status of Central Device - GAP-Central devices receive
sensor data notifications and print them on the serial console.
Figure 6-8. Sensor Data Notifications from the Peripheral to the Central Device