/* Application Event Interface. 
This function retrieves, parses, and handles an event received. The application is notified of an event through the callback registered in  */
ADI_BLER_EVENT adi_radio_GetEvent(void)
/* Application Event Interface. 
This function retrieves, parses, and handles an event received. The application is notified of an event through the callback registered in  */
ADI_BLER_EVENT adi_radio_GetEvent(void)
{
    ADI_BLE_TRANSPORT_RESULT eTransportResult;
    ADI_BLE_EVENT_PACKET     sParsedEventPacket;
    ADI_BLER_RESULT          eResult;
    uint8_t                  nBytes;
    ADI_BLE_LOCK_RADIO(ADI_BLER_LOCK_RADIO_TIMEOUT);
    memset(pBLERadio->eventPkt, 0u, ADI_RADIO_RES_HEADER_LEN);
    eTransportResult = adi_tal_Read(pBLERadio->eventPkt, ADI_CMDPKT_SIZE, &nBytes);
    ADI_BLE_UNLOCK_RADIO();
    if ((eTransportResult != ADI_BLE_TRANSPORT_SUCCESS) || (nBytes == 0u))
    {
        return BLE_RADIO_ERROR_READING;
    }
    eResult = bler_parse_packet(&sParsedEventPacket, nBytes);
    if (eResult != ADI_BLER_SUCCESS)
    {
        return BLE_RADIO_ERROR_PARSING;
    }
    return bler_handle_packet(&sParsedEventPacket);
}