MPLAB Harmony Bluetooth Help
|
The function DRV_BM64_EnterBTPairingMode is used to enter into pairing mode. Once the BM64 is paired with a device, it will automatically attempt to connect with it again on the next power cycle.
Calling DRV_BM64_DisconnectAllLinks will disconnect the BM64 from the host (smartphone) but will not erase the pairing. So another call to the function DRV_BM64_LinkLastDevice will reconnect. However calling the function DRV_BM64_ForgetAllLinks will erase all pairing information, and another call to DRV_BM64_EnterBTPairingMode will be required to re-establish a connection.
Example:
case BUTTON_STATE_PRESSED: // (debouncing not shown) { // initiate pairing with a button press if (BSP_SwitchStateGet(BSP_SWITCH_1)==BSP_SWITCH_STATE_PRESSED)) { // note generic version of call (DRV_BT instead of DRV_BM64) is used DRV_BT_EnterBTPairingMode(appData.bt.handle); appData.buttonState=BUTTON_STATE_WAIT_FOR_RELEASE; } }
The function DRV_BM64_GetLinkStatus returns the current link status, returning an 8-bit value containing the current link status defined by DRV_BM64_LINKSTATUS enum. This can be used to restrict calls to AVRCP functions only when an AVRCP link is established.
Example:
// note generic version of call (DRV_BT instead of DRV_BM64) is used if (DRV_BT_GetLinkStatus(appData.bt.handle) & DRV_BT_AVRCP_LINK_STATUS) { DRV_BT_CancelForwardOrRewind(appData.bt.handle); }
MPLAB Harmony Bluetooth Help
|