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 startedmessage as illustrated in the following figure.Figure 6-23. Multilink Device Scanning  - 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 startedmessage as illustrated in the following image.Figure 6-24. GAP-Peripheral Device Advertising  - 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.
Figure 6-25. Multilink-Multirole and GAP-Peripheral Device Connection  - 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. 
Figure 6-26. Notifications Status of Accelerometer and Gyroscope Sensor  - 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.
Figure 6-27. Accelerometer and Gyroscope Sensor Data  - Upon receiving sensor data
                    notifications, the Multilink-Multirole device prints them on the serial
                        console.
Figure 6-28. Sensor Data Notifications – On 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 startedmessage as illustrated in the following figure.Figure 6-29. GAP-Central Device Scanning  - 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.
Figure 6-30. GAP-Central Device and Multilink-Multirole Device Connection  - 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.
Figure 6-31. Notifications Status of Accelerometer and Gyroscope Sensor  - 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. 
Figure 6-32. Multilink Multirole Device Sending Accelerometer and Gyroscope Sensor Data  - Upon receiving sensor data
                    notifications, the GAP-Central device prints them on the serial console.
Figure 6-33. GAP-Central Device Printing Received Sensor Data Note: In this demo, the GAP-Central device can be replaced by the Microchip Bluetooth Data App. 
