Ejemplo n.º 1
0
 INT32 nativeNfcLlcp_ConnLessReceiveMessage(UINT8* msg, UINT32 *length)
 {
        NXPLOG_API_D ("%s: enter\n", __FUNCTION__);
        if(msg == NULL || length == NULL){
            NXPLOG_API_E ("%s: Invalid buffer or length", __FUNCTION__);
            return NFA_STATUS_FAILED;
        }

        NXPLOG_API_D("nfaLlcpServerCallBack: remote sap ID 0x%04x\n ", bDestSap);
        if( (bServerReadState == FALSE) && (bClientReadState == FALSE) )
        {
            sNfaLlcpConnLessReadEvent.wait();
        }

        if(NFA_STATUS_OK != NFA_P2pReadUI ((size_t)sLlcpConnLessHandle,
                     LLCP_MAX_DATA_SIZE,
                     &bDestSap,
                     &dwLlcpReadLength,
                     &bLlcpReadData[0],
                     &blMoreDataRemaining))
        {
            NXPLOG_API_D ("%s: send response failed.", __FUNCTION__);
            return NFA_STATUS_FAILED;
        }
        else
        {
            memcpy(msg,bLlcpReadData, dwLlcpReadLength);
            *length = dwLlcpReadLength;
            NXPLOG_API_D ("%s: exit\n", __FUNCTION__);
            bServerReadState = FALSE;
            bClientReadState = FALSE;
            return NFA_STATUS_OK;
        }

 }
Ejemplo n.º 2
0
INT32 nativeNdef_createMime(char *mimeType, UINT8 *mimeData, UINT32 mimeDataLength,
                                                                UINT8*outNdefBuff, UINT32 outBufferLen)
{
    tNFA_STATUS status = NFA_STATUS_FAILED;
    UINT32 current_size = 0;
    UINT32 mimeTypeLength = strlen(mimeType);
    NXPLOG_API_D ("%s: enter, mime = %s", __FUNCTION__, mimeType);

    if (mimeTypeLength + mimeDataLength >= (INT32)outBufferLen)
    {
        NXPLOG_API_E ("%s: data too large.", __FUNCTION__);
        return 0;
    }

    status = NDEF_MsgAddRec(outNdefBuff, 1024, &current_size, NDEF_TNF_MEDIA, (UINT8 *)mimeType, mimeTypeLength, NULL, 0,
                                    (UINT8*)mimeData, (UINT32)mimeDataLength);

    if (status != NFA_STATUS_OK )
    {
        NXPLOG_API_E ("%s: couldn't create Ndef record", __FUNCTION__);
        current_size = 0;
        goto END;
    }

END:
    NXPLOG_API_D ("%s: exit", __FUNCTION__);
    return current_size;
}
Ejemplo n.º 3
0
static tNFA_STATUS getDeviceCps(UINT8 *record, UINT8 *ref_name, UINT8 ref_len, nfc_handover_cps_t *power)
{
    UINT8 *p_ac_record, *p_ac_payload;
    UINT32 ac_payload_len;
    UINT8 cps = HANDOVER_CPS_UNKNOWN;
    UINT8 carrier_ref_name_len;

    NXPLOG_API_D ("%s: enter\n", __FUNCTION__);
    p_ac_record = NDEF_MsgGetFirstRecByType (record, NDEF_TNF_WELLKNOWN, RTD_Ac, sizeof(RTD_Ac));
    while ((p_ac_record))
    {
        NXPLOG_API_D ("%s: find ac record\n", __FUNCTION__);
        /* get payload */
        p_ac_payload = NDEF_RecGetPayload (p_ac_record, &ac_payload_len);

        if ((!p_ac_payload) || (ac_payload_len < 3))
        {
            NXPLOG_API_E ("%s: Failed to get ac payload", __FUNCTION__);
            return NFA_STATUS_FAILED;
        }

        /* Carrier Power State */
        cps = *p_ac_payload++;

        /* Carrier Data Reference Length and Characters */
        carrier_ref_name_len =  *p_ac_payload++;

        ac_payload_len -= 2;

        /* remaining must have carrier data ref and Auxiliary Data Reference Count at least */
        if (ac_payload_len > carrier_ref_name_len)
        {
            if (carrier_ref_name_len > NFA_CHO_MAX_REF_NAME_LEN)
            {
                NXPLOG_API_E ("%s: Too many bytes for carrier_ref_name, len = %d",
                                   __FUNCTION__, carrier_ref_name_len);
                return NFA_STATUS_FAILED;
            }
        }
        else
        {
            NXPLOG_API_E ("%s: Failed to parse carrier_ref_name", __FUNCTION__);
            return NFA_STATUS_FAILED;
        }

        if ((carrier_ref_name_len == ref_len) && (memcmp(p_ac_payload, ref_name, ref_len) == 0))
        {
            *power = (nfc_handover_cps_t)cps;
            return NFA_STATUS_OK;
        }

        /* get next Alternative Carrier record */
        p_ac_record = NDEF_MsgGetNextRecByType (p_ac_record, NDEF_TNF_WELLKNOWN, RTD_Ac, sizeof(RTD_Ac));
    }

    return NFA_STATUS_FAILED;
}
Ejemplo n.º 4
0
void nativeNfcLlcp_abortClientWaits()
{
    NXPLOG_API_D ("%s", __FUNCTION__);
    sLlcpConnLessClientHandle = 0;
    {
        SyncEventGuard g (sNfaLlcpClientRegEvent);
        sNfaLlcpClientRegEvent.notifyOne ();
    }

    NXPLOG_API_D ("%s exit", __FUNCTION__);
}
Ejemplo n.º 5
0
void nativeNfcLlcp_ConnLessDeregisterClientCallback()
{
    NXPLOG_API_D ("%s: enter\n", __FUNCTION__);
    NFA_P2pDeregister(sLlcpConnLessClientHandle);
    sLlcpConnLessClientHandle = NULL;
    bDestSap = 0x00;
    dwLlcpReadLength = 0x00;
    blMoreDataRemaining = 0x00;
    bLlcpReadData[LLCP_MAX_DATA_SIZE] = {0};
    sClientCallback = NULL;
    NXPLOG_API_D ("%s: exit\n", __FUNCTION__);
}
Ejemplo n.º 6
0
void nativeNfcLlcp_ConnLessStopServer()
{
    NXPLOG_API_D ("%s: enter\n", __FUNCTION__);
    NFA_P2pDeregister(sLlcpConnLessServerHandle);
    sLlcpConnLessServerHandle = NULL;
    bDestSap = 0x00;
    dwLlcpReadLength = 0x00;
    blMoreDataRemaining = 0x00;
    bLlcpReadData[LLCP_MAX_DATA_SIZE] = {0};
    sLlcpServerState = LLCP_SERVER_IDLE;
    sServerCallback = NULL;
    NXPLOG_API_D ("%s: exit\n", __FUNCTION__);
}
Ejemplo n.º 7
0
void nativeNfcSnep_stopServer()
{
    NXPLOG_API_D ("%s:", __FUNCTION__);
    gSyncMutex.lock();
    if (!nativeNfcManager_isNfcActive())
    {
        NXPLOG_API_E ("%s: Nfc not initialized.", __FUNCTION__);
        gSyncMutex.unlock();
        return;
    }

    nativeNfcSnep_abortServerWaits();
    sServerCallback = NULL;

    sRfEnabled = isDiscoveryStarted();
    if (sRfEnabled)
    {
        // Stop RF Discovery if we were polling
        startRfDiscovery (FALSE);
    }
    NFA_SnepDeregister(sSnepServerHandle);
    if (sRfEnabled)
    {
        startRfDiscovery (TRUE);
    }
    sSnepServerState = SNEP_SERVER_IDLE;
    gSyncMutex.unlock();
}
Ejemplo n.º 8
0
RoutingManager::~RoutingManager ()
{
    NXPLOG_API_D ("%s:~RoutingManager()", __FUNCTION__);
    NFA_EeDeregister (nfaEeCallback);
    mCallback = NULL;
    free(mRxDataBuffer);
}
Ejemplo n.º 9
0
void RoutingManager::enableRoutingToHost(bool skipCheckNDEF)
{
    tNFA_STATUS nfaStat;
    NXPLOG_API_D ("%s enter", "RoutingManager::enableRoutingToHost()");
    mSkipCheckNDEF = skipCheckNDEF;
    {
        SyncEventGuard guard (mRoutingEvent);

        // Route Nfc-A & B to host
        if (mSeTechMask == 0)
        {
            nfaStat = NFA_EeSetDefaultProtoRouting(mDefaultEe ,
                                        NFC_PROTOCOL_MASK_ISO7816|NFA_PROTOCOL_MASK_ISO_DEP,
                                        0, 0, 0, 0);
            if (nfaStat == NFA_STATUS_OK)
            {
                mRoutingEvent.wait ();
            }
            else
            {
                NXPLOG_API_E ("Fail to set  iso7816 routing");
            }
        }
    }
    commitRouting();
}
Ejemplo n.º 10
0
void nativeNfcSnep_deregisterClientCallback()
{
    NXPLOG_API_D ("%s:", __FUNCTION__);

    gSyncMutex.lock();
    if (!nativeNfcManager_isNfcActive())
    {
        NXPLOG_API_E ("%s: Nfc not initialized.", __FUNCTION__);
        gSyncMutex.unlock();
        return;
    }
    nativeNfcSnep_abortClientWaits();
    sRfEnabled = isDiscoveryStarted();
    if (sRfEnabled)
    {
        // Stop RF Discovery if we were polling
        startRfDiscovery (FALSE);
    }
    NFA_SnepDeregister(sSnepClientHandle);
    sClientCallback = NULL;
    if (sRfEnabled)
    {
        startRfDiscovery (TRUE);
    }
    gSyncMutex.unlock();
}
Ejemplo n.º 11
0
static void nativeNfcSnep_doPutReceived (tNFA_HANDLE handle, UINT8 *data, UINT32 length)
{
    NXPLOG_API_D ("%s: handle=0x%X, msg length =%d", __FUNCTION__, handle, length);
    if (!nativeNfcManager_isNfcActive())
    {
        return;
    }
    if((sSnepServerConnectionHandle == handle) &&
           NULL != data && 0x00 != length)
    {
        if (sServerCallback&& (NULL != sServerCallback->onMessageReceived))
        {
            sServerCallback->onMessageReceived(data, length);
        }
        sNfaSnepRespCode = NFA_SNEP_RESP_CODE_SUCCESS;
    }
    else
    {
        sNfaSnepRespCode = NFA_SNEP_RESP_CODE_REJECT;
    }
    {
        SyncEventGuard guard (sNfaSnepServerPutRspEvent);
        sNfaSnepServerPutRspEvent.notifyOne ();
    }
}
Ejemplo n.º 12
0
void RoutingManager::stackCallback (UINT8 event, tNFA_CONN_EVT_DATA* eventData)
{
    NXPLOG_API_D("%s: event=0x%X", "RoutingManager::stackCallback", event);

    switch (event)
    {
    case NFA_CE_REGISTERED_EVT:
        {
            NXPLOG_API_D("%s: NFA_CE_REGISTERED_EVT; status=0x%X; h=0x%X",
                         "RoutingManager::stackCallback",
                         eventData->ce_registered.status,
                         eventData->ce_registered.handle);
        }
        break;

    case NFA_CE_DEREGISTERED_EVT:
        {
            NXPLOG_API_D("%s: NFA_CE_DEREGISTERED_EVT; h=0x%X",
                         "RoutingManager::stackCallback",
                         eventData->ce_deregistered.handle);
        }
        break;

    case NFA_CE_ACTIVATED_EVT:
        {
            checkforTranscation(NFA_CE_ACTIVATED_EVT, (void *)eventData);
            getInstance().notifyHceActivated();
        }
        break;
    case NFA_DEACTIVATED_EVT:
    case NFA_CE_DEACTIVATED_EVT:
        {
            checkforTranscation(NFA_CE_DEACTIVATED_EVT, (void *)eventData);
            getInstance().notifyHceDeactivated();
        }
        break;
    case NFA_CE_DATA_EVT:
        {
            tNFA_CE_DATA& ce_data = eventData->ce_data;
            NXPLOG_API_D("%s: NFA_CE_DATA_EVT; stat=0x%X; h=0x%X; data len=%u",
                         "RoutingManager::stackCallback", ce_data.status,
                         ce_data.handle, ce_data.len);
            getInstance().handleData(ce_data.p_data, ce_data.len, ce_data.status);
        }
        break;
    }
}
Ejemplo n.º 13
0
static void nativeNfcLlcp_doClientReadCompleted (tNFA_STATUS status)
{
    NXPLOG_API_D ("%s: status=0x%X", __FUNCTION__, status);

    SyncEventGuard g (sNfaLlcpConnLessReadEvent);
    bClientReadState = TRUE;
    sNfaLlcpConnLessReadEvent.notifyOne ();
}
Ejemplo n.º 14
0
static void nativeNfcSnep_doPutCompleted (tNFA_STATUS status)
{
    NXPLOG_API_D ("%s: status=0x%X", __FUNCTION__, status);

    sSnepClientPutState = status;
    SyncEventGuard g (sNfaSnepClientPutMsgEvent);
    sNfaSnepClientPutMsgEvent.notifyOne ();
}
Ejemplo n.º 15
0
void RoutingManager::finalize()
{
    NXPLOG_API_D ("%s:RoutingManager::finalize()", __FUNCTION__);
    NFA_EeDeregister (nfaEeCallback);
    //NFA_CeDeregisterAidOnDH(mHostHandle);
    mCallback = NULL;
    mRxDataBufferLen = 0;
}
Ejemplo n.º 16
0
INT32 nativeNdef_createText(char *languageCode, char *text, UINT8*outNdefBuff, UINT32 outBufferLen)
{
    static char * DEFAULT_LANGUAGE_CODE = "En";
    tNFA_STATUS status = NFA_STATUS_FAILED;
    UINT32 textLength = strlen(text);
    UINT32 langCodeLength = 0;
    UINT32 current_size = 0;
    char *langCode = (char *)languageCode;
    NXPLOG_API_D ("%s: enter, text = %s", __FUNCTION__, text);

    if (langCode != NULL)
    {
        langCodeLength = strlen(langCode);
    }

    if (langCodeLength > 64)
    {
        NXPLOG_API_E ("%s: language code is too long, must be <64 bytes.", __FUNCTION__);
        return 0;
    }
    if (langCodeLength == 0)
    {
        //set default language to 'EN'
        langCode = DEFAULT_LANGUAGE_CODE;
        langCodeLength = 2;
    }
    memset (outNdefBuff, 0, outBufferLen);
    status = NDEF_MsgAddRec(outNdefBuff, outBufferLen, &current_size, NDEF_TNF_WKT, (UINT8*)RTD_TEXT, 1, NULL, 0,
                                    (UINT8*)(&langCodeLength), 1);
    status |= NDEF_MsgAppendPayload(outNdefBuff, outBufferLen, &current_size, outNdefBuff,
                                    (UINT8*)langCode, langCodeLength);
    status |= NDEF_MsgAppendPayload(outNdefBuff, outBufferLen, &current_size, outNdefBuff,
                                    (UINT8*)text, textLength);

    if (status != NFA_STATUS_OK )
    {
        NXPLOG_API_E ("%s: couldn't create Ndef record", __FUNCTION__);
        current_size =0;
        goto END;
    }

END:
    NXPLOG_API_D ("%s: exit", __FUNCTION__);
    return current_size;
}
Ejemplo n.º 17
0
void nativeNfcSnep_abortClientWaits()
{
    NXPLOG_API_D ("%s", __FUNCTION__);
    sSnepClientConnectionHandle = 0;
    {
        SyncEventGuard g (sNfaSnepClientPutMsgEvent);
        sNfaSnepClientPutMsgEvent.notifyOne ();
    }
    {
        SyncEventGuard g (sNfaSnepClientConnEvent);
        sNfaSnepClientConnEvent.notifyOne ();
    }
    {
        SyncEventGuard g (sNfaSnepClientDisconnEvent);
        sNfaSnepClientDisconnEvent.notifyOne ();
    }
    NXPLOG_API_D ("%s exit", __FUNCTION__);
}
Ejemplo n.º 18
0
static void *snepServerThread(void *arg)
{
    (void)arg;
    SyncEventGuard guard (sNfaSnepServerPutRspEvent);

    NXPLOG_API_D ("%s: enter\n", __FUNCTION__);
    while(sSnepServerState == SNEP_SERVER_STARTED)
    {
        sNfaSnepServerPutRspEvent.wait();
        if (sSnepServerConnectionHandle == 0)
            break;
        if(NFA_STATUS_OK != NFA_SnepPutResponse(sSnepServerConnectionHandle, sNfaSnepRespCode))
        {
            NXPLOG_API_D ("%s: send response failed.", __FUNCTION__);
        }
    }
    NXPLOG_API_D ("%s: exit\n", __FUNCTION__);
    pthread_exit(NULL);
    return NULL;
}
Ejemplo n.º 19
0
/*******************************************************************************
**
** Function:        nativeNfcTag_abortWaits
**
** Description:     Unblock all thread synchronization objects.
**
** Returns:         None
**
*******************************************************************************/
void nativeNfcSnep_abortServerWaits ()
{
    NXPLOG_API_D ("%s", __FUNCTION__);
    if (sSnepServerState == SNEP_SERVER_STARTED)
    {
        SyncEventGuard g (sNfaSnepServerPutRspEvent);
        sSnepServerState = SNEP_SERVER_IDLE;
        sSnepServerConnectionHandle = 0;
        sNfaSnepServerPutRspEvent.notifyOne();
    }
}
Ejemplo n.º 20
0
static void nativeNfcLlcp_doServerReadCompleted (tNFA_STATUS status)
{
    NXPLOG_API_D ("%s: status=0x%X", __FUNCTION__, status);
    if(nativeNfcManager_isNfcActive())
    {
        if(sServerCallback&& (NULL != sServerCallback->onMessageReceived))
        {
            sServerCallback->onMessageReceived();
        }
    }
    SyncEventGuard g (sNfaLlcpConnLessReadEvent);
    bServerReadState = TRUE;
    sNfaLlcpConnLessReadEvent.notifyOne ();
}
Ejemplo n.º 21
0
 INT32 nativeNfcLlcp_ConnLessSendMessage(UINT8* msg, UINT32 length)
 {
     tNFA_STATUS bNfaStatus;
     NXPLOG_API_D ("%s: enter\n", __FUNCTION__);
    if(msg == NULL || length <= 0){
        NXPLOG_API_E ("%s: Invalid buffer or length", __FUNCTION__);
        return NFA_STATUS_FAILED;
    }

    NXPLOG_API_D("nfaLlcpServerCallBack: remote sap ID 0x%04x\n ", bDestSap);

    bNfaStatus = NFA_P2pSendUI(sLlcpConnLessHandle,
                           bDestSap,
                           length,
                           msg);
    if(bNfaStatus != NFA_STATUS_OK)
    {
        NXPLOG_API_E ("%s: Error in send message\n", __FUNCTION__);
        return  NFA_STATUS_FAILED;
    }
     NXPLOG_API_D ("%s: exit\n", __FUNCTION__);
     return NFA_STATUS_OK;
 }
Ejemplo n.º 22
0
bool RoutingManager::initialize ()
{
    unsigned long tech = 0;
    UINT8 mActualNumEe = 0;
    tNFA_EE_INFO mEeInfo [mActualNumEe];

    if ((GetNumValue(NAME_NXP_FWD_FUNCTIONALITY_ENABLE, &tech, sizeof(tech))))
    {
        mFwdFuntnEnable = tech;
        NXPLOG_API_E ("%s:NXP_FWD_FUNCTIONALITY_ENABLE=%d;", __FUNCTION__, mFwdFuntnEnable);
    }

    tNFA_STATUS nfaStat;
    {
        SyncEventGuard guard (mEeRegisterEvent);
        NXPLOG_API_D ("%s: try ee register", "RoutingManager::initialize()");
        nfaStat = NFA_EeRegister (nfaEeCallback);
        if (nfaStat != NFA_STATUS_OK)
        {
            NXPLOG_API_E ("%s: fail ee register; error=0x%X",
                          "RoutingManager::initialize()", nfaStat);
            return false;
        }
        mEeRegisterEvent.wait ();
    }
    if(mHostListnEnable)
    {
        // Tell the host-routing to only listen on Nfc-A/Nfc-B
        nfaStat = NFA_CeRegisterAidOnDH (NULL, 0, stackCallback);
        if (nfaStat != NFA_STATUS_OK)
        {
            NXPLOG_API_E ("Failed to register wildcard AID for DH");
        }
        // Tell the host-routing to only listen on Nfc-A/Nfc-B
        nfaStat = NFA_CeSetIsoDepListenTech(NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B);
        if (nfaStat != NFA_STATUS_OK)
        {
            NXPLOG_API_E ("Failed to configure CE IsoDep technologies");
        }
    }
    memset(mRxDataBuffer, 0, MAX_CE_RX_BUFFER_SIZE);

    if ((nfaStat = NFA_AllEeGetInfo (&mActualNumEe, mEeInfo)) != NFA_STATUS_OK)
    {
        NXPLOG_API_E ("%s: fail get info; error=0x%X",
                      "RoutingManager::initialize()", nfaStat);
        mActualNumEe = 0;
    }
    return true;
}
Ejemplo n.º 23
0
INT32 nativeNdef_createUri(char *uri, UINT8*outNdefBuff, UINT32 outBufferLen)
{
    tNFA_STATUS status = NFA_STATUS_FAILED;
    INT32 uriLength = strlen(uri);
    UINT32 current_size = 0;
    INT32 i, prefixLength;
    NXPLOG_API_D ("%s: enter, uri = %s", __FUNCTION__, uri);

    for (i = 1; i < URI_PREFIX_MAP_LENGTH; i++)
    {
        if (memcmp(URI_PREFIX_MAP[i], uri, strlen(URI_PREFIX_MAP[i])) == 0)
        {
            
            break;
        }
    }
    if (i == URI_PREFIX_MAP_LENGTH)
    {
        i = 0;
    }
    prefixLength = strlen(URI_PREFIX_MAP[i]);
    status = NDEF_MsgAddRec(outNdefBuff, outBufferLen, &current_size, NDEF_TNF_WKT, (UINT8*)RTD_URL, 1, NULL, 0,
                                    (UINT8*)&i, 1);
    status |= NDEF_MsgAppendPayload(outNdefBuff, outBufferLen, &current_size, outNdefBuff,
                                    (UINT8*)(uri + prefixLength), (UINT32)(uriLength - prefixLength));

    if (status != NFA_STATUS_OK )
    {
        NXPLOG_API_E ("%s: couldn't create Ndef record", __FUNCTION__);
        current_size = 0;
        goto END;
    }

END:
    NXPLOG_API_D ("%s: exit", __FUNCTION__);
    return current_size;
}
Ejemplo n.º 24
0
RoutingManager::RoutingManager ()
: mRxDataBufferLen(0),
  mActiveSe(ROUTE_HOST),
  mSeTechMask(0x0),
  mDefaultEe(ROUTE_HOST),
  mHostListnEnable (true),
  mFwdFuntnEnable (true),
  mSkipCheckNDEF (true),
  mCallback(NULL)
{
    NXPLOG_API_D("%s: default route is 0x%02X\n",
                 "RoutingManager::RoutingManager()", mDefaultEe);
    mRxDataBuffer = (UINT8*)malloc(MAX_CE_RX_BUFFER_SIZE * sizeof(UINT8));
    memset(mRxDataBuffer, 0, MAX_CE_RX_BUFFER_SIZE);
    mRxDataBufferLen = 0;
}
Ejemplo n.º 25
0
INT32 nativeNfcLlcp_ConnLessRegisterClientCallback(nfcllcpConnlessClientCallback_t *clientCallback)
{
    tNFA_STATUS status = NFA_STATUS_FAILED;
    pthread_t llcpCleintRespThread;
    int ret = 1;
    NXPLOG_API_D ("%s:", __FUNCTION__);

    gSyncMutex.lock();
    if (!nativeNfcManager_isNfcActive())
    {
        NXPLOG_API_E ("%s: Nfc not initialized.", __FUNCTION__);
        gSyncMutex.unlock();
        return NFA_STATUS_FAILED;
    }

    sRfEnabled = isDiscoveryStarted();
    if (sRfEnabled)
    {
        /* Stop RF Discovery if we were polling */
        startRfDiscovery (FALSE);
    }

    {
        SyncEventGuard g (sNfaLlcpClientRegEvent);
        bClientReadState = FALSE;
        if(NFA_STATUS_OK != (status = NFA_P2pRegisterClient(NFA_P2P_LLINK_TYPE, nfaLlcpClientCallback)))
        {
            NXPLOG_API_E ("%s: fail to register client callback for LLCP", __FUNCTION__);
            if (sRfEnabled)
            {
                /*  Rollback to default */
                startRfDiscovery (TRUE);
                gSyncMutex.unlock();
                return status;
            }

        }
        sNfaLlcpClientRegEvent.wait();
    }

    sClientCallback = clientCallback;
    status = NFA_STATUS_OK;

    gSyncMutex.unlock();
    return status;
}
Ejemplo n.º 26
0
void RoutingManager::disableRoutingToHost()
{
    tNFA_STATUS nfaStat;
    NXPLOG_API_D ("%s enter", "RoutingManager::disableRoutingToHost()");
    {
        SyncEventGuard guard (mRoutingEvent);
        // Default routing for NFC-A & B technology if we don't have a SE
        if (mSeTechMask == 0)
        {
            nfaStat = NFA_EeSetDefaultProtoRouting(mDefaultEe, 0, 0, 0, 0, 0);
            if (nfaStat == NFA_STATUS_OK)
            {
                mRoutingEvent.wait ();
            }
            else
            {
                NXPLOG_API_E ("Fail to set  iso7816 routing");
            }
        }
    }
    commitRouting();
}
Ejemplo n.º 27
0
INT32 nativeNfcSnep_registerClientCallback(nfcSnepClientCallback_t *clientCallback)
{
    tNFA_STATUS status = NFA_STATUS_FAILED;
    NXPLOG_API_D ("%s:", __FUNCTION__);
    gSyncMutex.lock();
    if (!nativeNfcManager_isNfcActive())
    {
        NXPLOG_API_E ("%s: Nfc not initialized.", __FUNCTION__);
        gSyncMutex.unlock();
        return NFA_STATUS_FAILED;
    }
    sRfEnabled = isDiscoveryStarted();
    if (sRfEnabled)
    {
        // Stop RF Discovery if we were polling
        startRfDiscovery (FALSE);
    }
    {
        SyncEventGuard g (sNfaSnepClientRegEvent);
        if(NFA_STATUS_OK != (status = NFA_SnepRegisterClient(nfaSnepClientCallback)))
        {
            NXPLOG_API_E ("%s: fail to register client callback for SNEP", __FUNCTION__);
            goto clean_and_return;
        }
        sNfaSnepClientRegEvent.wait();
    }
    sClientCallback = clientCallback;
    status = NFA_STATUS_OK;
clean_and_return:
    if (sRfEnabled)
    {
        // Stop RF Discovery if we were polling
        startRfDiscovery (TRUE);
    }
    gSyncMutex.unlock();
    return status;
}
Ejemplo n.º 28
0
INT32 nativeNdef_readHs(UINT8*ndefBuff, UINT32 ndefBuffLen, nfc_handover_select_t *hsInfo)
{
    UINT8 *p_hs_record;
    UINT8 *p_hs_payload;
    UINT32 hs_payload_len = 0;
    UINT8 *p_record;
    UINT8 *p_payload;
    UINT32 record_payload_len;
    UINT8 *p_id;
    UINT8 id_len;
    UINT8  version = 0;
    UINT32 index;
    UINT8 bt_len;
    UINT8 bt_type;
    UINT16 wifi_len;
    UINT16 wifi_type;
    UINT8 status = -1;

    (void)ndefBuffLen;
    if (hsInfo == NULL)
    {
        return -1;
    }
    memset(hsInfo, 0, sizeof(nfc_handover_select_t));

    /* get Handover Request record */
    p_hs_record = NDEF_MsgGetFirstRecByType (ndefBuff, NDEF_TNF_WELLKNOWN, (UINT8*)RTD_Hs, sizeof(RTD_Hs));
    if (p_hs_record)
    {
        p_hs_payload = NDEF_RecGetPayload (p_hs_record, &hs_payload_len);

        if ((!p_hs_payload) || (hs_payload_len < 7))
        {
            NXPLOG_API_E ("%s: Failed to get Hs payload (version, cr/ac record)", __FUNCTION__);
            return -1;
        }

        /* Version */
        if (NFC_FORUM_HANDOVER_VERSION != p_hs_payload[0])
        {
            NXPLOG_API_E ("%s: Version (0x%02x) not matched", __FUNCTION__, p_hs_payload[0]);
            return -1;
        }
        p_hs_payload += 1;
        hs_payload_len--;

        /* NDEF message for Collision Resolution record and Alternative Carrier records */
        if (NDEF_OK != NDEF_MsgValidate (p_hs_payload, hs_payload_len, FALSE))
        {
            NXPLOG_API_E ("%s: Failed to validate NDEF message for cr/ac records", __FUNCTION__);
            return -1;
        }
    }
    else
    {
        NXPLOG_API_E ("%s: Hs record not found", __FUNCTION__);
        return -1;
    }

    p_record = NDEF_MsgGetFirstRecByType (ndefBuff, NDEF_TNF_MEDIA,
                                          BT_OOB_REC_TYPE, BT_OOB_REC_TYPE_LEN);

    if (p_record)
    {
        status = 0;
        NXPLOG_API_D ("%s: Found BT OOB record");
        if (p_hs_record)
        {
            p_id = NDEF_RecGetId(p_record, &id_len);
            if (p_id == NULL || id_len == 0)
            {
                NXPLOG_API_E ("%s: Failed to retreive NDEF ID", __FUNCTION__);
                return -1;
            }
        
            if (getDeviceCps(p_hs_payload, p_id, id_len, &hsInfo->bluetooth.power_state)!=NFA_STATUS_OK)
            {
                hsInfo->bluetooth.power_state = HANDOVER_CPS_UNKNOWN;
            }
        }
        p_payload = NDEF_RecGetPayload(p_record, &record_payload_len);
        if (p_payload == NULL)
        {
            NXPLOG_API_E ("%s: Failed to retreive NDEF payload", __FUNCTION__);
            return -1;
        }
        hsInfo->bluetooth.type = HANDOVER_TYPE_BT;
        hsInfo->bluetooth.ndef = p_record;
        hsInfo->bluetooth.ndef_length = record_payload_len;
        index = 2;
        if (parseBluetoothAddress(&p_payload[index] , record_payload_len - index, hsInfo->bluetooth.address)!= 0)
        {
            NXPLOG_API_E ("%s: Failed to retreive device address", __FUNCTION__);
            return -1;
        }
        index += BLUETOOTH_ADDRESS_LENGTH;
        while(index < record_payload_len)
        {
            bt_len = p_payload[index++];
            bt_type = p_payload[index++];
            switch (bt_type)
            {
                case BT_HANDOVER_TYPE_SHORT_LOCAL_NAME:
                    hsInfo->bluetooth.device_name = &p_payload[index];
                    hsInfo->bluetooth.device_name_length = bt_len-1;
                    break;
                case BT_HANDOVER_TYPE_LONG_LOCAL_NAME:
                    if (hsInfo->bluetooth.device_name)
                    {
                        break;  // prefer short name
                    }
                    hsInfo->bluetooth.device_name = &p_payload[index];
                    hsInfo->bluetooth.device_name_length = bt_len-1;
                    break;
                default:
                    break;
            }
        }
    }
    else
    {
        p_record = NDEF_MsgGetFirstRecByType (ndefBuff, NDEF_TNF_MEDIA,
                                              BLE_OOB_REC_TYPE, BT_OOB_REC_TYPE_LEN);

        if (p_record)
        {
            status = 0;
            NXPLOG_API_D ("%s: Found BLE OOB record", __FUNCTION__);
            if (p_hs_record)
            {
                p_id = NDEF_RecGetId(p_record, &id_len);
                if (p_id == NULL || id_len == 0)
                {
                    NXPLOG_API_E ("%s: Failed to retreive NDEF ID", __FUNCTION__);
                    return -1;
                }
            
                if (getDeviceCps(p_hs_payload, p_id, id_len, &hsInfo->bluetooth.power_state)!=NFA_STATUS_OK)
                {
                    hsInfo->bluetooth.power_state = HANDOVER_CPS_UNKNOWN;
                }
            }
            p_payload = NDEF_RecGetPayload(p_record, &record_payload_len);
            if (p_payload == NULL)
            {
                NXPLOG_API_E ("%s: Failed to retreive NDEF payload", __FUNCTION__);
                return -1;
            }
            hsInfo->bluetooth.type = HANDOVER_TYPE_BLE;
            hsInfo->bluetooth.ndef = p_record;
            hsInfo->bluetooth.ndef_length = record_payload_len;
            index = 0;
            while(index < record_payload_len)
            {
                bt_len = p_payload[index++];
                bt_type = p_payload[index++];
                switch (bt_type)
                {
                    case BT_HANDOVER_TYPE_MAC:
                        parseBluetoothAddress(&p_payload[index] , record_payload_len - index, hsInfo->bluetooth.address);
                        break;
                    case BT_HANDOVER_TYPE_SHORT_LOCAL_NAME:
                        hsInfo->bluetooth.device_name = &p_payload[index];
                        hsInfo->bluetooth.device_name_length = bt_len-1;
                        break;
                    case BT_HANDOVER_TYPE_LONG_LOCAL_NAME:
                        if (hsInfo->bluetooth.device_name)
                        {
                            break;  // prefer short name
                        }
                        hsInfo->bluetooth.device_name = &p_payload[index];
                        hsInfo->bluetooth.device_name_length = bt_len-1;
                        break;
                    default:
                        break;
                }
            }        
        }
    }
    p_record = NDEF_MsgGetFirstRecByType (ndefBuff, NDEF_TNF_MEDIA,
                                          WIFI_WSC_REC_TYPE, WIFI_WSC_REC_TYPE_LEN);

    if (p_record)
    {
        status = 0;
        NXPLOG_API_D ("%s: Found WiFi record", __FUNCTION__);
        if (p_hs_record)
        {
            p_id = NDEF_RecGetId(p_record, &id_len);
            if (p_id == NULL || id_len == 0)
            {
                NXPLOG_API_E ("%s: Failed to retreive NDEF ID", __FUNCTION__);
                return -1;
            }
        
            if (getDeviceCps(p_hs_payload, p_id, id_len, &hsInfo->wifi.power_state)!=NFA_STATUS_OK)
            {
                hsInfo->wifi.power_state = HANDOVER_CPS_UNKNOWN;
            }
        }
        p_payload = NDEF_RecGetPayload(p_record, &record_payload_len);
        if (p_payload == NULL)
        {
            NXPLOG_API_E ("%s: Failed to retreive NDEF payload", __FUNCTION__);
            return -1;
        }
        hsInfo->wifi.ndef = p_record;
        hsInfo->wifi.ndef_length = record_payload_len;
        index = 0;
        while(index < record_payload_len)
        {
            /* wifi type is a 2 byte field*/
            wifi_type = p_payload[index++];
            wifi_type = wifi_type << 8;
            wifi_type += p_payload[index++];

            /* wifi len is a 2 byte field */
            wifi_len = p_payload[index++];
            wifi_len = wifi_len << 8;
            wifi_len += p_payload[index++];

            switch (wifi_type)
            {
                case WIFI_HANDOVER_SSID_ID:
                    hsInfo->wifi.ssid_length = wifi_len;
                    hsInfo->wifi.ssid = &p_payload[index];
                    index += hsInfo->wifi.ssid_length;
                    break;
                case WIFI_HANDOVER_NETWORK_KEY_ID:
                    hsInfo->wifi.key_length = wifi_len;
                    hsInfo->wifi.key = &p_payload[index];
                    index += hsInfo->wifi.key_length;
                    break;
                default:
                    break;
            }
        }
    }
    return status;
}
Ejemplo n.º 29
0
INT32 nativeNdef_readHr(UINT8*ndefBuff, UINT32 ndefBuffLen, nfc_handover_request_t *hrInfo)
{
    UINT8 *p_hr_record;
    UINT8 *p_hr_payload;
    UINT32 hr_payload_len = 0;
    UINT8 *p_record;
    UINT8 *p_payload;
    UINT32 record_payload_len;
    UINT8 *p_id;
    UINT8 id_len;
    UINT8   version = 0;
    UINT32 index;
    UINT8 len;
    UINT8 type;

    (void)ndefBuffLen;
    if (hrInfo == NULL)
    {
        return -1;
    }
    memset(hrInfo, 0, sizeof(nfc_handover_request_t));
    NXPLOG_API_D ("%s: enter", __FUNCTION__);

    /* get Handover Request record */
    p_hr_record = NDEF_MsgGetFirstRecByType (ndefBuff, NDEF_TNF_WELLKNOWN, (UINT8*)RTD_Hr, sizeof(RTD_Hr));
    if (p_hr_record)
    {
        NXPLOG_API_E ("%s: Find Hr record", __FUNCTION__);
        p_hr_payload = NDEF_RecGetPayload (p_hr_record, &hr_payload_len);

        if ((!p_hr_payload) || (hr_payload_len < 7))
        {
            NXPLOG_API_E ("%s: Failed to get Hr payload (version, cr/ac record)", __FUNCTION__);
            return -1;
        }

        /* Version */
        if (NFC_FORUM_HANDOVER_VERSION != p_hr_payload[0])
        {
            NXPLOG_API_E ("%s: Version (0x%02x) not matched", __FUNCTION__, p_hr_payload[0]);
            return -1;
        }
        p_hr_payload += 1;
        hr_payload_len--;

        /* NDEF message for Collision Resolution record and Alternative Carrier records */
        if (NDEF_OK != NDEF_MsgValidate (p_hr_payload, hr_payload_len, FALSE))
        {
            NXPLOG_API_E ("%s: Failed to validate NDEF message for cr/ac records", __FUNCTION__);
            return -1;
        }
    }

    p_record = NDEF_MsgGetFirstRecByType (ndefBuff, NDEF_TNF_MEDIA,
                                          BT_OOB_REC_TYPE, BT_OOB_REC_TYPE_LEN);

    if (p_record)
    {
        NXPLOG_API_D ("%s: Found BT OOB record", __FUNCTION__);
        if (p_hr_record)
        {
            p_id = NDEF_RecGetId(p_record, &id_len);
            if (p_id == NULL || id_len == 0)
            {
                NXPLOG_API_E ("%s: Failed to retreive NDEF ID", __FUNCTION__);
                return -1;
            }
        
            if (getDeviceCps(p_hr_payload, p_id, id_len, &hrInfo->bluetooth.power_state)!=NFA_STATUS_OK)
            {
                hrInfo->bluetooth.power_state = HANDOVER_CPS_UNKNOWN;
            }
        }
        p_payload = NDEF_RecGetPayload(p_record, &record_payload_len);
        if (p_payload == NULL)
        {
            NXPLOG_API_E ("%s: Failed to retreive NDEF payload", __FUNCTION__);
            return -1;
        }
        hrInfo->bluetooth.type = HANDOVER_TYPE_BT;
        hrInfo->bluetooth.ndef = p_record;
        hrInfo->bluetooth.ndef_length = record_payload_len;
        index = 2;
        if (parseBluetoothAddress(&p_payload[index] , record_payload_len - index, hrInfo->bluetooth.address)!= 0)
        {
            NXPLOG_API_E ("%s: Failed to retreive device address", __FUNCTION__);
            return -1;
        }
        index += BLUETOOTH_ADDRESS_LENGTH;
        while(index < record_payload_len)
        {
            len = p_payload[index++];
            type = p_payload[index++];
            switch (type)
            {
                case BT_HANDOVER_TYPE_SHORT_LOCAL_NAME:
                    hrInfo->bluetooth.device_name = p_payload;
                    hrInfo->bluetooth.device_name_length = len;
                    break;
                case BT_HANDOVER_TYPE_LONG_LOCAL_NAME:
                    if (hrInfo->bluetooth.device_name)
                    {
                        break;  // prefer short name
                    }
                    hrInfo->bluetooth.device_name = p_payload;
                    hrInfo->bluetooth.device_name_length = len;
                    break;
                default:
                    index += (len - 1);
                    break;
            }
        }
    }
    else
    {
        p_record = NDEF_MsgGetFirstRecByType (ndefBuff, NDEF_TNF_MEDIA,
                                              BLE_OOB_REC_TYPE, BT_OOB_REC_TYPE_LEN);

        if (p_record)
        {
            NXPLOG_API_D ("%s: Found BLE OOB record", __FUNCTION__);
            if (p_hr_record)
            {
                p_id = NDEF_RecGetId(p_record, &id_len);
                if (p_id == NULL || id_len == 0)
                {
                    NXPLOG_API_E ("%s: Failed to retreive NDEF ID", __FUNCTION__);
                    return -1;
                }
            
                if (getDeviceCps(p_hr_payload, p_id, id_len, &hrInfo->bluetooth.power_state)!=NFA_STATUS_OK)
                {
                    hrInfo->bluetooth.power_state = HANDOVER_CPS_UNKNOWN;
                }
            }

            p_payload = NDEF_RecGetPayload(p_record, &record_payload_len);
            if (p_payload == NULL)
            {
                NXPLOG_API_E ("%s: Failed to retreive NDEF payload", __FUNCTION__);
                return -1;
            }
            hrInfo->bluetooth.type = HANDOVER_TYPE_BLE;
            hrInfo->bluetooth.ndef = p_record;
            hrInfo->bluetooth.ndef_length = record_payload_len;
            index = 0;
            while(index < record_payload_len)
            {
                len = p_payload[index++];
                type = p_payload[index++];
                switch (type)
                {
                    case BT_HANDOVER_TYPE_MAC:
                        parseBluetoothAddress(&p_payload[index] , record_payload_len - index, hrInfo->bluetooth.address);
                        break;
                    case BT_HANDOVER_TYPE_SHORT_LOCAL_NAME:
                        hrInfo->bluetooth.device_name = p_payload;
                        hrInfo->bluetooth.device_name_length = len;
                        break;
                    case BT_HANDOVER_TYPE_LONG_LOCAL_NAME:
                        if (hrInfo->bluetooth.device_name)
                        {
                            break;  // prefer short name
                        }
                        hrInfo->bluetooth.device_name = p_payload;
                        hrInfo->bluetooth.device_name_length = len;
                        break;
                    default:
                        index += (len - 1);
                        break;
                }
            }        
        }
    }
    p_record = NDEF_MsgGetFirstRecByType (ndefBuff, NDEF_TNF_MEDIA,
                                          WIFI_WSC_REC_TYPE, WIFI_WSC_REC_TYPE_LEN);

    if (p_record)
    {
        NXPLOG_API_D ("%s: Found WiFi record", __FUNCTION__);
        hrInfo->wifi.has_wifi = TRUE;
        hrInfo->wifi.ndef = p_record;
        hrInfo->wifi.ndef_length = record_payload_len;
    }
    return 0;
}
Ejemplo n.º 30
0
/*******************************************************************************
**
** Function:        nfaEeCallback
**
** Description:     Receive execution environment-related events from stack.
**                  event: Event code.
**                  eventData: Event data.
**
** Returns:         None
**
*******************************************************************************/
void RoutingManager::nfaEeCallback (tNFA_EE_EVT event, tNFA_EE_CBACK_DATA* eventData)
{
    RoutingManager& routingManager = RoutingManager::getInstance();

    switch (event)
    {
        case NFA_EE_REGISTER_EVT:
        {
            SyncEventGuard guard (routingManager.mEeRegisterEvent);
            NXPLOG_API_D ("%s: NFA_EE_REGISTER_EVT; status=%u",
                          "RoutingManager::nfaEeCallback",
                          eventData->ee_register);
            routingManager.mEeRegisterEvent.notifyOne();
        }
        break;

        case NFA_EE_MODE_SET_EVT:
        {
            SyncEventGuard guard (routingManager.mEeSetModeEvent);
            NXPLOG_API_D ("%s: NFA_EE_MODE_SET_EVT; status: 0x%04X  handle: 0x%04X ",
                          "RoutingManager::nfaEeCallback",
                          eventData->mode_set.status,
                          eventData->mode_set.ee_handle);
            routingManager.mEeSetModeEvent.notifyOne();
            //se.notifyModeSet(eventData->mode_set.ee_handle, !(eventData->mode_set.status),eventData->mode_set.ee_status );
        }
        break;

        case NFA_EE_SET_TECH_CFG_EVT:
        {
            NXPLOG_API_D ("%s: NFA_EE_SET_TECH_CFG_EVT; status=0x%X",
                          "RoutingManager::nfaEeCallback", eventData->status);
            SyncEventGuard guard(routingManager.mRoutingEvent);
            routingManager.mRoutingEvent.notifyOne();
        }
        break;

        case NFA_EE_SET_PROTO_CFG_EVT:
        {
            NXPLOG_API_D ("%s: NFA_EE_SET_PROTO_CFG_EVT; status=0x%X",
                          "RoutingManager::nfaEeCallback", eventData->status);
            SyncEventGuard guard(routingManager.mRoutingEvent);
            routingManager.mRoutingEvent.notifyOne();
        }
        break;

        case NFA_EE_ACTION_EVT:
        {
            tNFA_EE_ACTION& action = eventData->action;
            checkforTranscation(NFA_EE_ACTION_EVT, (void *)eventData);
            if (action.trigger == NFC_EE_TRIG_SELECT)
            {
                NXPLOG_API_D ("%s: NFA_EE_ACTION_EVT; h=0x%X; trigger=select (0x%X)",
                              "RoutingManager::nfaEeCallback", action.ee_handle,
                              action.trigger);
            }
            else if (action.trigger == NFC_EE_TRIG_APP_INIT)
            {
                tNFC_APP_INIT& app_init = action.param.app_init;
                NXPLOG_API_D ("%s: NFA_EE_ACTION_EVT; h=0x%X; trigger=app-init (0x%X); aid len=%u; data len=%u",
                              "RoutingManager::nfaEeCallback", action.ee_handle,
                              action.trigger, app_init.len_aid,
                              app_init.len_data);
                //if app-init operation is successful;
                //app_init.data[] contains two bytes, which are the status codes of the event;
                //app_init.data[] does not contain an APDU response;
                //see EMV Contactless Specification for Payment Systems; Book B; Entry Point Specification;
                //version 2.1; March 2011; section 3.3.3.5;
                if ( (app_init.len_data > 1) &&
                     (app_init.data[0] == 0x90) &&
                     (app_init.data[1] == 0x00) )
                {
                    //getInstance().notifyAidSelected(app_init.aid, app_init.len_aid, app_init.data, app_init.len_data);
                }
            }
            else if (action.trigger == NFC_EE_TRIG_RF_PROTOCOL)
            {
                NXPLOG_API_D ("%s: NFA_EE_ACTION_EVT; h=0x%X; trigger=rf protocol (0x%X)",
                              "RoutingManager::nfaEeCallback", action.ee_handle,
                              action.trigger);
            }
            else if (action.trigger == NFC_EE_TRIG_RF_TECHNOLOGY)
            {
                NXPLOG_API_D ("%s: NFA_EE_ACTION_EVT; h=0x%X; trigger=rf tech (0x%X)",
                              "RoutingManager::nfaEeCallback", action.ee_handle,
                              action.trigger);
            }
            else
            {
                NXPLOG_API_E ("%s: NFA_EE_ACTION_EVT; h=0x%X; unknown trigger (0x%X)",
                              "RoutingManager::nfaEeCallback", action.ee_handle,
                              action.trigger);
            }
        }
        break;

        case NFA_EE_DISCOVER_EVT:
        {
            NXPLOG_API_D ("%s: NFA_EE_DISCOVER_EVT; status=0x%X; num ee=%u",
                          __FUNCTION__,eventData->status,
                          eventData->ee_discover.num_ee);
        }
        break;

        case NFA_EE_DISCOVER_REQ_EVT:
            NXPLOG_API_D ("%s: NFA_EE_DISCOVER_REQ_EVT; status=0x%X; num ee=%u", __FUNCTION__,
                eventData->discover_req.status, eventData->discover_req.num_ee);
        break;

        case NFA_EE_NO_CB_ERR_EVT:
            NXPLOG_API_D ("%s: NFA_EE_NO_CB_ERR_EVT  status=%u",
                      "RoutingManager::nfaEeCallback", eventData->status);
        break;

        case NFA_EE_ADD_AID_EVT:
        {
            NXPLOG_API_D ("%s: NFA_EE_ADD_AID_EVT  status=%u",
                          "RoutingManager::nfaEeCallback", eventData->status);
        }
        break;

        case NFA_EE_REMOVE_AID_EVT:
        {
            NXPLOG_API_D ("%s: NFA_EE_REMOVE_AID_EVT  status=%u",
                          "RoutingManager::nfaEeCallback", eventData->status);
        }
        break;

        case NFA_EE_NEW_EE_EVT:
        {
            NXPLOG_API_D ("%s: NFA_EE_NEW_EE_EVT  h=0x%X; status=%u",
                          "RoutingManager::nfaEeCallback",
                          eventData->new_ee.ee_handle,
                          eventData->new_ee.ee_status);
        }
        break;
        case NFA_EE_ROUT_ERR_EVT:
        {
            NXPLOG_API_D ("%s: NFA_EE_ROUT_ERR_EVT  status=%u",
                          "RoutingManager::nfaEeCallback", eventData->status);
        }
        break;
    default:
        NXPLOG_API_E ("%s: unknown event=%u ????",
                      "RoutingManager::nfaEeCallback", event);
        break;
    }
}