6.4 Running Multilink-Multirole Demo
This section provides the detailed procedure to run the Multilink-Multirole demo with one
GAP-Peripheral and one GAP-Central device. In this demo, the Multilink-Multirole device
plays both GAP-Central and GAP-Peripheral roles. First, the device plays a GAP-Central
role, and it scans and connects with the remote GAP-Peripheral device. Once connected,
the Multilink-Multirole device plays a GAP-Peripheral role and starts advertising and
further accepts connection from the remote GAP-Central device.
- Connect the device with the GAP-Peripheral configuration flashed into the BM70/71 device. For more details, refer to Base Configuration. For serial console configuration, refer to Serial Console Setup.
- Ensure 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 that the
Multilink-Multirole device is scanning. Check the Tera Term window for a
Scan started
message as illustrated in the following figure. - Prepare the GAP-Peripheral device to connect with the Multilink-Multirole device. For more details, refer to Running the GAP-Peripheral Demo with Microchip Bluetooth Data App.
- Ensure that the GAP-Peripheral
device is advertising. Check the Tera Term window for an
Adv started
message as illustrated in the following image. - The Multilink-Multirole device that is currently scanning initiates a connection with the GAP-Peripheral device if it discovers a GAP-Peripheral device and if the advertising parameter matches its requirement as illustrated in the following figure.
- Once connected, the Multilink-Multirole device initiates service discovery and looks for the device orientation service. On discovering the device orientation service and its characteristics, the Multilink-Multirole device enables notifications on the accelerometer and gyroscope sensor characteristics as illustrated in the following figure.
- At this stage, the Multilink-Multirole device starts advertising and the remote GAP-Central device connects with the Multilink-Multirole device. Once the accelerometer and gyroscope sensor characteristics notifications are enabled, the GAP-Peripheral device starts sending accelerometer and gyroscope sensor data.
- Upon receiving sensor data notifications, the Multilink-Multirole device prints them on the serial console.
- Connect the GAP-Central device and configure the serial console. For more details, refer to the Serial Console Setup.
- Ensure that POWER LED (green) on the 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 that the GAP-Central
device is scanning. Check the Tera Term window for a
Scan started
message as illustrated in the following figure. - The GAP-Central device, which is currently scanning, initiates a connection with the Multilink-Multirole device if it discovers a Multilink-Multirole device and if the advertising parameter matches its requirement as illustrated in the following figure.
- Once connected, the GAP-Central device initiates service discovery and looks for the device orientation service. On discovering the device orientation service and its characteristics of the Multilink-Multirole device, the GAP-Central device enables notifications from the accelerometer and gyroscope sensor characteristics as illustrated in the following figure.
- Once the accelerometer and gyroscope notifications are enabled, the Multilink-Multirole device starts sending accelerometer and gyroscope sensor data as illustrated in the following figure.
- Upon receiving sensor data
notifications, the GAP-Central device prints them on the serial console.Note: In this demo, the GAP-Central device can be replaced by the Microchip Bluetooth Data App.