Drivers Libraries Help > BM64 Bluetooth Driver Library > Library Interface > e) Bluetooth-specific Functions > DRV_BM64_GetLinkStatus Function
MPLAB Harmony Bluetooth Help
DRV_BM64_GetLinkStatus Function

Return link status.

Description

Function DRV_BM64_GetLinkStatus: 

DRV_BM64_LINKSTATUS DRV_BM64_GetLinkStatus(const DRV_HANDLE handle); 

Returns a 8-bit value containing current link status as bit flags for SCO (bit 0), ACL, HFP, A2DP, AVRCP, SPP, IAP, MAP (bit 7)

Preconditions

DRV_BM64_Open must have been called to obtain a valid opened device handle.

Parameters
Parameters 
Description 
handle 
valid handle to an opened BM64 device driver unique to client 
Returns

8-bit value defined by DRV_BM64_LINKSTATUS enum.

Example
case BUTTON_STATE_PRESSED:      // (debouncing not shown)
{
    if (BSP_SwitchStateGet(BSP_SWITCH_3)==BSP_SWITCH_STATE_PRESSED))
    {             
        DRV_BT_PLAYINGSTATUS playingStatus = DRV_BT_GetPlayingStatus(appData.bt.handle);
        if ((playingStatus==DRV_BT_PLAYING_FF)||(playingStatus==DRV_BT_PLAYING_FR))
        {
           // 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);
           }
        }
    }
}
break;
C
DRV_BM64_LINKSTATUS DRV_BM64_GetLinkStatus(
    const DRV_HANDLE handle
);