4.2.5.4.1 Link Loss
The below session covers the test case scenarios that showcase the Link Loss service. The Link Loss service provides provision to set the desired alert level using the Alert Level characteristic to cause an alert in the device when the link is lost. Based on the set alert level the indication will be displayed on the Proximity Reporter when a disconnection happens.
The test case covers:
- How to use the mobile (Android) MBD application to establish the connection with PXPR curiosity board.
- Link Loss service Alert level configuration.
- Testing scenarios to observe LED behavior during the disconnection.
- In the MPLABX, open the
ble_pxpr_app(Reporter) application. Compile and program the PXPR application on the
curiosity board with the below configuration.
PIC32CX-BZ3_DFP
1.2.183
XC32 Compiler Version
V4.40
After programming (or resetting) the device will be in APP_PXPR_STATE_ADV.
APP_PXPR_STATE_ADV - The application is waiting for a connection without bond. That too within timeout_adv_seconds(60 seconds). After the completion of the timeout the device enters APP_PXPR_STATE_IDLE state.
timeout_adv = 60 seconds – Timeout for advertisement without bond.
LED Behavior
APP_PXPR_STATE_ADV = Green LED flashes once in every 3 seconds.
APP_PXPR_STATE_IDLE = Green LED will turn off.
- Open the Microchip Bluetooth Data (MBD) in Android and click the "BLE Connect" sub-app.
- Press the “START SCAN” icon to see the nearby advertising devices. The device with the advertising name “PXPR” is the target device.
- Click on the “PXPR” device to establish the connection. All the supported profiles
in the proximity reporter will be displayed upon connection. At the peripheral side,
the PXPR curiosity board will enter APP_PXPR_STATE_CONN when the connection
is established.
The on-board green LED indicate the connection and advertisement state as below.
APP State
LED Behavior
APP_PXPR_STATE_IDLE
All LEDs are turned off.
APP_PXPR_STATE_ADV
The green LED flashes once every 3 seconds. (On: 50 ms, Off: 2950 ms)
APP_PXPR_STATE_CONN
The Green LED flashes twice every 1.5 seconds. (On: 50 ms, Off: 150 ms)
- On the mobile (Android), press the “Link Loss Service” icon.
- Select the desired Alert Level from the available option(No Alert, Mild Alert, High Alert).
- Press the “←” icon on the top left corner of the screen twice to disconnect the “PXPR”. The link loss service alert level will be shown as BLE_PXPR_ALERT_LEVEL_HIGH and can be observed through the PXPR Green LED.
APP Alert Level |
LED Behavior |
---|---|
BLE_PXPR_ALERT_LEVEL_NO |
The green LED remains lit for 5 seconds and then indicates the current connection state |
BLE_PXPR_ALERT_LEVEL_MILD |
Green LED blinks once every second continuously for 5 seconds and then indicates the current connection state. |
BLE_PXPR_ALERT_LEVEL_HIGH |
Green LED blinks five times every second continuously for 5 seconds and then indicates the current connection state. |