Lines Matching refs:gpphLibContext
127 if((NULL == gpphLibContext)||
128 (gpphLibContext->LibNfcState.cur_state == eLibNfcHalStateShutdown))
140 else if(gpphLibContext->LibNfcState.next_state == eLibNfcHalStateShutdown)
144 else if(0 == gpphLibContext->Connected_handle)
148 else if(hRemoteDevice != gpphLibContext->Connected_handle)
152 else if((TRUE == gpphLibContext->status.GenCb_pending_status)
153 ||(NULL!=gpphLibContext->CBInfo.pClientRdNdefCb)
154 ||(CHK_NDEF_NOT_DONE == gpphLibContext->ndef_cntx.is_ndef))
159 else if(gpphLibContext->ndef_cntx.is_ndef == FALSE)
164 else if((gpphLibContext->ndef_cntx.is_ndef == TRUE)
165 &&(0 == gpphLibContext->ndef_cntx.NdefActualSize))
172 else if ((LLCP_STATE_RESET_INIT != gpphLibContext->llcp_cntx.sLlcpContext.state)
173 && (LLCP_STATE_CHECKED != gpphLibContext->llcp_cntx.sLlcpContext.state))
180 gpphLibContext->psRemoteDevList->psRemoteDevInfo->SessionOpened = SESSION_OPEN;
181 gpphLibContext->ndef_cntx.eLast_Call = NdefRd;
185 ((NULL == gpphLibContext->psBufferedAuth)
186 ||(phHal_eMifareAuthentA == gpphLibContext->psBufferedAuth->cmd.MfCmd))
189 if(NULL != gpphLibContext->psBufferedAuth)
191 if(NULL != gpphLibContext->psBufferedAuth->sRecvData.buffer)
194 gpphLibContext->psBufferedAuth->sRecvData.buffer);
196 if(NULL != gpphLibContext->psBufferedAuth->sSendData.buffer)
199 gpphLibContext->psBufferedAuth->sSendData.buffer);
201 phOsalNfc_FreeMemory(gpphLibContext->psBufferedAuth);
203 gpphLibContext->psBufferedAuth
206 gpphLibContext->psBufferedAuth->addr =
207 (uint8_t)gpphLibContext->ndef_cntx.psNdefMap
209 gpphLibContext->psBufferedAuth->cmd.MfCmd = phHal_eMifareRead16;
210 gpphLibContext->psBufferedAuth->sSendData.length
212 gpphLibContext->psBufferedAuth->sRecvData.length
214 gpphLibContext->psBufferedAuth->sRecvData.buffer
216 gpphLibContext->psBufferedAuth->sSendData.buffer
220 gpphLibContext->LibNfcState.next_state)
223 gpphLibContext->ndef_cntx.psUpperNdefMsg = psRd;
227 gpphLibContext->ndef_cntx.psNdefMap,
230 (void *)gpphLibContext);
233 gpphLibContext->ndef_cntx.NdefContinueRead =(uint8_t) ((phLibNfc_Ndef_EBegin==Offset) ?
237 RetVal = phFriNfc_NdefMap_RdNdef(gpphLibContext->ndef_cntx.psNdefMap,
238 gpphLibContext->ndef_cntx.psUpperNdefMsg->buffer,
239 (uint32_t*)&gpphLibContext->ndef_cntx.psUpperNdefMsg->length,
240 gpphLibContext->ndef_cntx.NdefContinueRead);
245 gpphLibContext->ndef_cntx.psUpperNdefMsg->length = 0;
251 gpphLibContext->CBInfo.pClientRdNdefCb= NULL;
256 gpphLibContext->CBInfo.pClientRdNdefCb = pNdefRead_RspCb;
257 gpphLibContext->CBInfo.pClientRdNdefCntx = pContext;
258 gpphLibContext->status.GenCb_pending_status=TRUE;
259 gpphLibContext->LibNfcState.next_state = eLibNfcHalStateTransaction;
284 if(pLibNfc_Ctxt != gpphLibContext)
291 if(eLibNfcHalStateShutdown == gpphLibContext->LibNfcState.next_state)
297 else if(eLibNfcHalStateRelease == gpphLibContext->LibNfcState.next_state)
303 gpphLibContext->status.GenCb_pending_status = FALSE;
304 if (gpphLibContext->psBufferedAuth != NULL && gpphLibContext->ndef_cntx.psNdefMap != NULL) {
305 gpphLibContext->psBufferedAuth->addr = (uint8_t)
306 gpphLibContext->ndef_cntx.psNdefMap->StdMifareContainer.currentBlock;
314 gpphLibContext->LastTrancvSuccess = FALSE;
315 gpphLibContext->ndef_cntx.is_ndef = FALSE;
317 gpphLibContext->Connected_handle;
324 RetStatus = phHal4Nfc_Connect(gpphLibContext->psHwReference,
328 (void *)gpphLibContext);
334 gpphLibContext->LastTrancvSuccess = TRUE;
339 gpphLibContext->LastTrancvSuccess = FALSE;
344 phLibNfc_UpdateCurState(status,gpphLibContext);
346 pClientCb = gpphLibContext->CBInfo.pClientRdNdefCb;
347 pUpperLayerContext = gpphLibContext->CBInfo.pClientRdNdefCntx;
349 gpphLibContext->CBInfo.pClientRdNdefCb = NULL;
350 gpphLibContext->CBInfo.pClientRdNdefCntx = NULL;
381 if((NULL == gpphLibContext)||
382 (gpphLibContext->LibNfcState.cur_state
394 else if(gpphLibContext->LibNfcState.next_state
399 else if(0 == gpphLibContext->Connected_handle)
403 else if(hRemoteDevice != gpphLibContext->Connected_handle)
407 else if((TRUE == gpphLibContext->status.GenCb_pending_status)||
408 (gpphLibContext->ndef_cntx.is_ndef == CHK_NDEF_NOT_DONE))
414 else if(FALSE == gpphLibContext->ndef_cntx.is_ndef)
418 else if(psWr->length > gpphLibContext->ndef_cntx.NdefLength)
423 else if ((LLCP_STATE_RESET_INIT != gpphLibContext->llcp_cntx.sLlcpContext.state)
424 && (LLCP_STATE_CHECKED != gpphLibContext->llcp_cntx.sLlcpContext.state))
432 gpphLibContext->ndef_cntx.psUpperNdefMsg = psWr;
433 gpphLibContext->ndef_cntx.AppWrLength= psWr->length;
434 gpphLibContext->ndef_cntx.eLast_Call = NdefWr;
435 gpphLibContext->psRemoteDevList->psRemoteDevInfo->SessionOpened
440 gpphLibContext->psBufferedAuth)
442 gpphLibContext->psBufferedAuth->cmd.MfCmd))
445 if(NULL != gpphLibContext->psBufferedAuth)
447 if(NULL != gpphLibContext->psBufferedAuth->sRecvData.buffer)
450 gpphLibContext->psBufferedAuth->sRecvData.buffer);
452 if(NULL != gpphLibContext->psBufferedAuth->sSendData.buffer)
455 gpphLibContext->psBufferedAuth->sSendData.buffer);
457 phOsalNfc_FreeMemory(gpphLibContext->psBufferedAuth);
459 gpphLibContext->psBufferedAuth
462 gpphLibContext->psBufferedAuth->addr =
463 (uint8_t)gpphLibContext->ndef_cntx.psNdefMap
465 gpphLibContext->psBufferedAuth->cmd.MfCmd = phHal_eMifareRead16;
466 gpphLibContext->psBufferedAuth->sSendData.length
468 gpphLibContext->psBufferedAuth->sRecvData.length
470 gpphLibContext->psBufferedAuth->sRecvData.buffer
472 gpphLibContext->psBufferedAuth->sSendData.buffer
476 gpphLibContext->LibNfcState.next_state)
478 gpphLibContext->CBInfo.pClientWrNdefCb = NULL;
487 gpphLibContext->ndef_cntx.psNdefMap,
490 (void *)gpphLibContext);
496 RetVal = phFriNfc_NdefMap_EraseNdef(gpphLibContext->ndef_cntx.psNdefMap);
503 RetVal=phFriNfc_NdefMap_WrNdef(gpphLibContext->ndef_cntx.psNdefMap,
504 gpphLibContext->ndef_cntx.psUpperNdefMsg->buffer,
505 (uint32_t*)&gpphLibContext->ndef_cntx.psUpperNdefMsg->length,
510 gpphLibContext->CBInfo.pClientWrNdefCb = pNdefWrite_RspCb;
511 gpphLibContext->CBInfo.pClientWrNdefCntx = pContext;
512 gpphLibContext->status.GenCb_pending_status=TRUE;
513 gpphLibContext->LibNfcState.next_state = eLibNfcHalStateTransaction;
534 if(pLibNfc_Ctxt != gpphLibContext)
540 if(eLibNfcHalStateShutdown == gpphLibContext->LibNfcState.next_state)
546 else if(eLibNfcHalStateRelease == gpphLibContext->LibNfcState.next_state)
552 gpphLibContext->status.GenCb_pending_status = FALSE;
553 if (gpphLibContext->psBufferedAuth != NULL && gpphLibContext->ndef_cntx.psNdefMap != NULL) {
554 gpphLibContext->psBufferedAuth->addr = (uint8_t)
555 gpphLibContext->ndef_cntx.psNdefMap->TLVStruct.NdefTLVBlock;
560 gpphLibContext->LastTrancvSuccess = FALSE;
564 gpphLibContext->Connected_handle;
571 status = phHal4Nfc_Connect(gpphLibContext->psHwReference,
575 (void *)gpphLibContext);
580 gpphLibContext->LastTrancvSuccess = TRUE;
582 if(gpphLibContext->ndef_cntx.AppWrLength >
583 gpphLibContext->ndef_cntx.NdefLength)
595 gpphLibContext->LastTrancvSuccess = FALSE;
599 phLibNfc_UpdateCurState(status,gpphLibContext);
601 pClientCb = gpphLibContext->CBInfo.pClientWrNdefCb;
602 pUpperLayerContext = gpphLibContext->CBInfo.pClientWrNdefCntx;
604 gpphLibContext->CBInfo.pClientWrNdefCb = NULL;
605 gpphLibContext->CBInfo.pClientWrNdefCntx = NULL;
627 if(gpphLibContext->psTransInfo==NULL)
630 gpphLibContext->psTransInfo = (phLibNfc_sTransceiveInfo_t *)
633 if(gpphLibContext->psTransInfo==NULL)
639 if(NULL == gpphLibContext->ndef_cntx.psNdefMap)
642 gpphLibContext->ndef_cntx.psNdefMap = (phFriNfc_NdefMap_t *)
645 if(NULL != gpphLibContext->ndef_cntx.psNdefMap)
648 (void)memset(gpphLibContext->ndef_cntx.psNdefMap,0,sizeof(phFriNfc_NdefMap_t));
649 gpphLibContext->ndef_cntx.NdefSendRecvLen = NDEF_SENDRCV_BUF_LEN;
650 gpphLibContext->ndef_cntx.psNdefMap->SendRecvBuf =
651 (uint8_t*) phOsalNfc_GetMemory(gpphLibContext->
654 if(NULL != gpphLibContext->ndef_cntx.psNdefMap->SendRecvBuf)
656 (void)memset(gpphLibContext->ndef_cntx.psNdefMap->SendRecvBuf,
658 gpphLibContext->ndef_cntx.NdefSendRecvLen);
660 gpphLibContext->psOverHalCtxt =(phFriNfc_OvrHal_t *)
664 if(NULL == gpphLibContext->psOverHalCtxt)
671 (void)memset(gpphLibContext->psOverHalCtxt,0,
675 gpphLibContext->psOverHalCtxt->psHwReference =
676 gpphLibContext->psHwReference;
677 if(NULL == gpphLibContext->psDevInputParam )
679 gpphLibContext->psDevInputParam = (phHal_sDevInputParam_t *)
682 gpphLibContext->ndef_cntx.is_ndef = CHK_NDEF_NOT_DONE;
684 if(NULL == gpphLibContext->ndef_cntx.ndef_fmt)
687 gpphLibContext->ndef_cntx.ndef_fmt = (phFriNfc_sNdefSmtCrdFmt_t *)
690 if(NULL != gpphLibContext->ndef_cntx.ndef_fmt)
692 (void)memset(gpphLibContext->ndef_cntx.ndef_fmt,
709 if(gpphLibContext->ndef_cntx.psNdefMap !=NULL)
711 if(gpphLibContext->ndef_cntx.psNdefMap->SendRecvBuf !=NULL)
713 phOsalNfc_FreeMemory(gpphLibContext->ndef_cntx.psNdefMap->SendRecvBuf);
714 gpphLibContext->ndef_cntx.psNdefMap->SendRecvBuf=NULL;
716 phOsalNfc_FreeMemory(gpphLibContext->ndef_cntx.psNdefMap);
717 gpphLibContext->ndef_cntx.psNdefMap =NULL;
720 if(NULL != gpphLibContext->ndef_cntx.ndef_fmt)
722 phOsalNfc_FreeMemory(gpphLibContext->ndef_cntx.ndef_fmt);
723 gpphLibContext->ndef_cntx.ndef_fmt = NULL;
726 if(gpphLibContext->psOverHalCtxt !=NULL)
728 phOsalNfc_FreeMemory(gpphLibContext->psOverHalCtxt);
729 gpphLibContext->psOverHalCtxt =NULL;
731 if(gpphLibContext->psDevInputParam !=NULL)
733 phOsalNfc_FreeMemory(gpphLibContext->psDevInputParam);
734 gpphLibContext->psDevInputParam = NULL;
736 if(gpphLibContext->psTransInfo!=NULL)
738 phOsalNfc_FreeMemory(gpphLibContext->psTransInfo);
739 gpphLibContext->psTransInfo= NULL;
755 if((NULL == gpphLibContext)||
756 (gpphLibContext->LibNfcState.cur_state == eLibNfcHalStateShutdown))
768 else if(gpphLibContext->LibNfcState.next_state == eLibNfcHalStateShutdown)
772 else if(0 == gpphLibContext->Connected_handle)
776 else if(hRemoteDevice != gpphLibContext->Connected_handle)
781 else if ((LLCP_STATE_RESET_INIT != gpphLibContext->llcp_cntx.sLlcpContext.state)
782 && (LLCP_STATE_CHECKED != gpphLibContext->llcp_cntx.sLlcpContext.state))
792 gpphLibContext->ndef_cntx.NdefSendRecvLen=300;
793 gpphLibContext->ndef_cntx.eLast_Call = ChkNdef;
796 RetVal = phFriNfc_NdefMap_Reset( gpphLibContext->ndef_cntx.psNdefMap,
797 gpphLibContext->psOverHalCtxt,
799 gpphLibContext->psDevInputParam,
800 gpphLibContext->ndef_cntx.psNdefMap->SendRecvBuf,
801 gpphLibContext->ndef_cntx.NdefSendRecvLen,
802 gpphLibContext->ndef_cntx.psNdefMap->SendRecvBuf,
803 &(gpphLibContext->ndef_cntx.NdefSendRecvLen),
811 gpphLibContext->ndef_cntx.psNdefMap,
814 (void *)gpphLibContext);
817 RetVal = phFriNfc_NdefMap_ChkNdef(gpphLibContext->ndef_cntx.psNdefMap);
831 if((0x00 == gpphLibContext->ndef_cntx.Chk_Ndef_Timer_Id)||
832 (PH_OSALNFC_INVALID_TIMER_ID == gpphLibContext->ndef_cntx.Chk_Ndef_Timer_Id))
834 gpphLibContext->ndef_cntx.Chk_Ndef_Timer_Id =
837 if((0x00 == gpphLibContext->ndef_cntx.Chk_Ndef_Timer_Id)||
838 (PH_OSALNFC_INVALID_TIMER_ID == gpphLibContext->ndef_cntx.Chk_Ndef_Timer_Id))
844 phOsalNfc_Timer_Start(gpphLibContext->ndef_cntx.Chk_Ndef_Timer_Id,
851 gpphLibContext->CBInfo.pClientCkNdefCb = pCheckNdef_RspCb;
852 gpphLibContext->CBInfo.pClientCkNdefCntx = pContext;
853 gpphLibContext->status.GenCb_pending_status=TRUE;
854 gpphLibContext->LibNfcState.next_state = eLibNfcHalStateTransaction;
876 if(pLibNfc_Ctxt != gpphLibContext)
883 gpphLibContext->Connected_handle;
884 if(eLibNfcHalStateShutdown == gpphLibContext->LibNfcState.next_state)
890 else if(eLibNfcHalStateRelease == gpphLibContext->LibNfcState.next_state)
899 gpphLibContext->ndef_cntx.is_ndef = TRUE;
907 gpphLibContext->LastTrancvSuccess = TRUE;
915 gpphLibContext->psHwReference,
917 (void *)gpphLibContext
923 gpphLibContext->LastTrancvSuccess = FALSE;
924 gpphLibContext->ndef_cntx.is_ndef = FALSE;
931 RetStatus = phHal4Nfc_Connect(gpphLibContext->psHwReference,
935 (void *)gpphLibContext);
943 gpphLibContext->ndef_cntx.is_ndef = TRUE;
960 gpphLibContext->LibNfcState.cur_state=eLibNfcHalStateConnect;
962 gpphLibContext->status.GenCb_pending_status = FALSE;
964 phLibNfc_UpdateCurState(RetStatus,gpphLibContext);
969 ((NULL == gpphLibContext->psBufferedAuth)
970 ||(phHal_eMifareAuthentA == gpphLibContext->psBufferedAuth->cmd.MfCmd)))
973 if(NULL != gpphLibContext->psBufferedAuth)
975 if(NULL != gpphLibContext->psBufferedAuth->sRecvData.buffer)
978 gpphLibContext->psBufferedAuth->sRecvData.buffer);
980 if(NULL != gpphLibContext->psBufferedAuth->sSendData.buffer)
983 gpphLibContext->psBufferedAuth->sSendData.buffer);
985 phOsalNfc_FreeMemory(gpphLibContext->psBufferedAuth);
987 gpphLibContext->psBufferedAuth
990 gpphLibContext->psBufferedAuth->addr =
991 (uint8_t)gpphLibContext->ndef_cntx.psNdefMap
993 gpphLibContext->psBufferedAuth->cmd.MfCmd = phHal_eMifareRead16;
994 gpphLibContext->psBufferedAuth->sSendData.length
996 gpphLibContext->psBufferedAuth->sRecvData.length
998 gpphLibContext->psBufferedAuth->sRecvData.buffer
1000 gpphLibContext->psBufferedAuth->sSendData.buffer
1003 pClientCb = gpphLibContext->CBInfo.pClientCkNdefCb;
1004 pUpperLayerContext = gpphLibContext->CBInfo.pClientCkNdefCntx;
1005 gpphLibContext->CBInfo.pClientCkNdefCb = NULL;
1006 gpphLibContext->CBInfo.pClientCkNdefCntx = NULL;
1065 gpphLibContext->ndef_cntx.is_ndef = FALSE;
1071 if(pLibNfc_Ctxt != gpphLibContext)
1078 gpphLibContext->Connected_handle;
1081 ((NULL == gpphLibContext->psBufferedAuth)
1082 ||(phHal_eMifareAuthentA == gpphLibContext->psBufferedAuth->cmd.MfCmd)))
1085 if(NULL != gpphLibContext->psBufferedAuth)
1087 if(NULL != gpphLibContext->psBufferedAuth->sRecvData.buffer)
1090 gpphLibContext->psBufferedAuth->sRecvData.buffer);
1092 if(NULL != gpphLibContext->psBufferedAuth->sSendData.buffer)
1095 gpphLibContext->psBufferedAuth->sSendData.buffer);
1097 phOsalNfc_FreeMemory(gpphLibContext->psBufferedAuth);
1099 gpphLibContext->psBufferedAuth
1102 gpphLibContext->psBufferedAuth->addr =
1103 (uint8_t)gpphLibContext->ndef_cntx.psNdefMap
1105 gpphLibContext->psBufferedAuth->cmd.MfCmd = phHal_eMifareRead16;
1106 gpphLibContext->psBufferedAuth->sSendData.length
1108 gpphLibContext->psBufferedAuth->sRecvData.length
1110 gpphLibContext->psBufferedAuth->sRecvData.buffer
1112 gpphLibContext->psBufferedAuth->sSendData.buffer
1115 pClientCb = gpphLibContext->CBInfo.pClientCkNdefCb;
1116 pUpperLayerContext = gpphLibContext->CBInfo.pClientCkNdefCntx;
1117 gpphLibContext->CBInfo.pClientCkNdefCb = NULL;
1118 gpphLibContext->CBInfo.pClientCkNdefCntx = NULL;
1133 phOsalNfc_Timer_Delete(gpphLibContext->ndef_cntx.Chk_Ndef_Timer_Id);
1134 gpphLibContext->ndef_cntx.Chk_Ndef_Timer_Id = 0x00;
1135 phLibNfc_Ndef_CheckNdef_Cb((void *)gpphLibContext,NFCSTATUS_MORE_INFORMATION);
1147 switch(gpphLibContext->ndef_cntx.eLast_Call)
1257 if((NULL == gpphLibContext)
1258 ||(gpphLibContext->LibNfcState.cur_state
1271 else if(gpphLibContext->LibNfcState.next_state
1276 else if(0 == gpphLibContext->Connected_handle)
1280 else if(hRemoteDevice != gpphLibContext->Connected_handle)
1284 else if((TRUE == gpphLibContext->status.GenCb_pending_status)||
1285 (NULL != gpphLibContext->ndef_cntx.pClientNdefFmtCb)
1286 ||(gpphLibContext->ndef_cntx.is_ndef == TRUE))
1293 else if ((LLCP_STATE_RESET_INIT != gpphLibContext->llcp_cntx.sLlcpContext.state)
1294 && (LLCP_STATE_CHECKED != gpphLibContext->llcp_cntx.sLlcpContext.state))
1302 gpphLibContext->ndef_cntx.eLast_Call = NdefFmt;
1303 gpphLibContext->ndef_cntx.NdefSendRecvLen = NDEF_SENDRCV_BUF_LEN;
1307 RetVal = phFriNfc_NdefSmtCrd_Reset(gpphLibContext->ndef_cntx.ndef_fmt,
1308 gpphLibContext->psOverHalCtxt,
1310 gpphLibContext->psDevInputParam,
1311 gpphLibContext->ndef_cntx.psNdefMap->SendRecvBuf,
1312 &(gpphLibContext->ndef_cntx.NdefSendRecvLen));
1316 RetVal = phFriNfc_NdefSmtCrd_SetCR(gpphLibContext->ndef_cntx.ndef_fmt,
1319 gpphLibContext);
1327 RetVal = phFriNfc_NdefSmtCrd_Format(gpphLibContext->ndef_cntx.ndef_fmt,
1332 gpphLibContext->ndef_cntx.pClientNdefFmtCb = pNdefformat_RspCb;
1333 gpphLibContext->ndef_cntx.pClientNdefFmtCntx = pContext;
1334 gpphLibContext->status.GenCb_pending_status=TRUE;
1335 gpphLibContext->LibNfcState.next_state = eLibNfcHalStateTransaction;
1359 if ((NULL == gpphLibContext)
1360 || (gpphLibContext->LibNfcState.cur_state
1372 else if (gpphLibContext->LibNfcState.next_state
1377 else if (0 == gpphLibContext->Connected_handle)
1381 else if (hRemoteDevice != gpphLibContext->Connected_handle)
1385 else if ((TRUE == gpphLibContext->status.GenCb_pending_status)
1386 || (NULL != gpphLibContext->ndef_cntx.pClientNdefFmtCb)
1387 || (FALSE == gpphLibContext->ndef_cntx.is_ndef))
1395 gpphLibContext->ndef_cntx.eLast_Call = NdefReadOnly;
1397 if(eLibNfcHalStatePresenceChk != gpphLibContext->LibNfcState.next_state)
1415 gpphLibContext->ndef_cntx.psNdefMap,
1417 (void *)gpphLibContext);
1430 gpphLibContext->ndef_cntx.psNdefMap, mif_std_key);
1436 gpphLibContext->ndef_cntx.NdefSendRecvLen = NDEF_SENDRCV_BUF_LEN;
1440 ret_val = phFriNfc_NdefSmtCrd_Reset (gpphLibContext->ndef_cntx.ndef_fmt,
1441 gpphLibContext->psOverHalCtxt,
1443 gpphLibContext->psDevInputParam,
1444 gpphLibContext->ndef_cntx.psNdefMap->SendRecvBuf,
1445 &(gpphLibContext->ndef_cntx.NdefSendRecvLen));
1450 ret_val = phFriNfc_NdefSmtCrd_SetCR (gpphLibContext->ndef_cntx.ndef_fmt,
1452 gpphLibContext);
1457 gpphLibContext->ndef_cntx.ndef_fmt);
1472 ret_val = phFriNfc_NdefMap_Reset (gpphLibContext->ndef_cntx.psNdefMap,
1473 gpphLibContext->psOverHalCtxt,
1475 gpphLibContext->psDevInputParam,
1476 gpphLibContext->ndef_cntx.psNdefMap->SendRecvBuf,
1477 gpphLibContext->ndef_cntx.NdefSendRecvLen,
1478 gpphLibContext->ndef_cntx.psNdefMap->SendRecvBuf,
1479 &(gpphLibContext->ndef_cntx.NdefSendRecvLen),
1488 gpphLibContext->ndef_cntx.psNdefMap,
1490 (void *)gpphLibContext);
1495 gpphLibContext->ndef_cntx.psNdefMap);
1510 gpphLibContext->ndef_cntx.pClientNdefFmtCb= NULL;
1516 gpphLibContext->ndef_cntx.pClientNdefFmtCb = pNdefReadOnly_RspCb;
1517 gpphLibContext->ndef_cntx.pClientNdefFmtCntx = pContext;
1519 gpphLibContext->status.GenCb_pending_status = TRUE;
1520 gpphLibContext->LibNfcState.next_state = eLibNfcHalStateTransaction;
1543 if(pLibNfc_Ctxt != gpphLibContext)
1549 if(eLibNfcHalStateShutdown == gpphLibContext->LibNfcState.next_state)
1555 else if(eLibNfcHalStateRelease == gpphLibContext->LibNfcState.next_state)
1561 gpphLibContext->status.GenCb_pending_status = FALSE;
1570 gpphLibContext->Connected_handle;
1576 RetStatus = phHal4Nfc_Connect(gpphLibContext->psHwReference,
1578 gpphLibContext->Connected_handle,
1581 (void *)gpphLibContext);
1589 gpphLibContext->LibNfcState.cur_state =eLibNfcHalStateConnect;
1591 phLibNfc_UpdateCurState(status,gpphLibContext);
1593 pClientCb = gpphLibContext->ndef_cntx.pClientNdefFmtCb;
1594 pUpperLayerContext= gpphLibContext->ndef_cntx.pClientNdefFmtCntx;
1595 gpphLibContext->ndef_cntx.pClientNdefFmtCb = NULL;
1596 gpphLibContext->ndef_cntx.pClientNdefFmtCntx = NULL;
1621 if(pLibNfc_Ctxt != gpphLibContext)
1628 if(eLibNfcHalStateShutdown == gpphLibContext->LibNfcState.next_state)
1634 else if(eLibNfcHalStateRelease == gpphLibContext->LibNfcState.next_state)
1640 gpphLibContext->status.GenCb_pending_status = FALSE;
1643 gpphLibContext->ndef_cntx.psNdefMap->CardState =
1651 gpphLibContext->LibNfcState.cur_state =eLibNfcHalStateConnect;
1654 phLibNfc_UpdateCurState(status, gpphLibContext);
1656 p_client_cb = gpphLibContext->ndef_cntx.pClientNdefFmtCb;
1657 p_upper_layer_ctxt = gpphLibContext->ndef_cntx.pClientNdefFmtCntx;
1658 gpphLibContext->ndef_cntx.pClientNdefFmtCb = NULL;
1659 gpphLibContext->ndef_cntx.pClientNdefFmtCntx = NULL;
1682 if(eLibNfcHalStateShutdown == gpphLibContext->LibNfcState.next_state)
1688 else if(eLibNfcHalStateRelease == gpphLibContext->LibNfcState.next_state)
1700 gpphLibContext->status.GenCb_pending_status = FALSE;
1702 phLibNfc_UpdateCurState(status,gpphLibContext);
1710 gpphLibContext->CBInfo.pClientNdefNtfRespCb(
1711 gpphLibContext->CBInfo.pClientNdefNtfRespCntx,
1713 gpphLibContext->Connected_handle,
1715 gpphLibContext->CBInfo.pClientNdefNtfRespCb = NULL;
1716 gpphLibContext->CBInfo.pClientNdefNtfRespCntx = NULL;
1722 gpphLibContext->phLib_NdefRecCntx.ndef_message.buffer,
1723 gpphLibContext->phLib_NdefRecCntx.ndef_message.length,
1725 gpphLibContext->phLib_NdefRecCntx.IsChunked,
1726 &(gpphLibContext->phLib_NdefRecCntx.NumberOfRawRecords));
1728 NdefInfo.pNdefMessage = gpphLibContext->phLib_NdefRecCntx.ndef_message.buffer;
1729 NdefInfo.NdefMessageLengthActual = gpphLibContext->ndef_cntx.NdefActualSize;
1730 NdefInfo.NdefMessageLengthMaximum = gpphLibContext->ndef_cntx.NdefLength;
1735 (sizeof(phFriNfc_NdefRecord_t)* gpphLibContext->phLib_NdefRecCntx.NumberOfRawRecords );
1738 gpphLibContext->CBInfo.pClientNdefNtfRespCb(
1739 gpphLibContext->CBInfo.pClientNdefNtfRespCntx,
1741 gpphLibContext->Connected_handle,
1743 gpphLibContext->CBInfo.pClientNdefNtfRespCb = NULL;
1744 gpphLibContext->CBInfo.pClientNdefNtfRespCntx = NULL;
1750 if(gpphLibContext->ndef_cntx.pNdef_NtfSrch_Type==NULL)
1753 gpphLibContext->phLib_NdefRecCntx.ndef_message.buffer,
1754 gpphLibContext->phLib_NdefRecCntx.ndef_message.length,
1755 gpphLibContext->phLib_NdefRecCntx.RawRecords,
1756 gpphLibContext->phLib_NdefRecCntx.IsChunked,
1757 &(gpphLibContext->phLib_NdefRecCntx.NumberOfRawRecords));
1759 for (Index = 0; Index < gpphLibContext->phLib_NdefRecCntx.NumberOfRawRecords; Index++)
1763 gpphLibContext->phLib_NdefRecCntx.RawRecords[Index]);
1773 &(gpphLibContext->phLib_NdefRecCntx.NdefReg),
1774 gpphLibContext->phLib_NdefRecCntx.ndef_message.buffer,
1775 (uint16_t)gpphLibContext->phLib_NdefRecCntx.ndef_message.length);
1779 gpphLibContext->CBInfo.pClientNdefNtfRespCb(gpphLibContext->CBInfo.pClientNdefNtfRespCntx,
1780 NULL,gpphLibContext->Connected_handle,NFCSTATUS_FAILED);
1781 gpphLibContext->CBInfo.pClientNdefNtfRespCb = NULL;
1782 gpphLibContext->CBInfo.pClientNdefNtfRespCntx = NULL;
1789 RegStatus = phFriNfc_NdefReg_Process( &(gpphLibContext->phLib_NdefRecCntx.NdefReg),
1797 for(Index=0;Index<gpphLibContext->phLib_NdefRecCntx.CbParam.Count;Index++)
1799 pNdefRecord->Tnf = gpphLibContext->phLib_NdefRecCntx.CbParam.Records[Index].Tnf;
1801 gpphLibContext->phLib_NdefRecCntx.CbParam.Records[Index].TypeLength;
1803 gpphLibContext->phLib_NdefRecCntx.CbParam.Records[Index].PayloadLength;
1805 gpphLibContext->phLib_NdefRecCntx.CbParam.Records[Index].IdLength;
1807 gpphLibContext->phLib_NdefRecCntx.CbParam.Records[Index].Flags;
1814 gpphLibContext->phLib_NdefRecCntx.CbParam.Records[Index].Id,
1817 gpphLibContext->phLib_NdefRecCntx.CbParam.Records[Index].PayloadData,
1820 gpphLibContext->phLib_NdefRecCntx.CbParam.Records[Index].Type,
1832 gpphLibContext->CBInfo.pClientNdefNtfRespCb(
1833 gpphLibContext->CBInfo.pClientNdefNtfRespCntx,
1834 &NdefInfo,gpphLibContext->Connected_handle,
1842 gpphLibContext->CBInfo.pClientNdefNtfRespCb(
1843 gpphLibContext->CBInfo.pClientNdefNtfRespCntx,
1844 &NdefInfo,gpphLibContext->Connected_handle,
1848 &(gpphLibContext->phLib_NdefRecCntx.NdefReg),
1849 gpphLibContext->phLib_NdefRecCntx.NdefCb );
1851 if(gpphLibContext->ndef_cntx.pNdef_NtfSrch_Type!=NULL)
1854 for(Index=0;Index<gpphLibContext->phLib_NdefRecCntx.CbParam.Count;Index++)
1864 gpphLibContext->CBInfo.pClientNdefNtfRespCb = NULL;
1865 gpphLibContext->CBInfo.pClientNdefNtfRespCntx = NULL;
1891 if((NULL == gpphLibContext) ||
1892 (gpphLibContext->LibNfcState.cur_state
1898 else if(gpphLibContext->LibNfcState.next_state
1913 else if(0 == gpphLibContext->Connected_handle)
1917 else if(hRemoteDevice != gpphLibContext->Connected_handle)
1921 else if((TRUE == gpphLibContext->status.GenCb_pending_status)
1922 ||(NULL!=gpphLibContext->CBInfo.pClientNdefNtfRespCb))
1929 gpphLibContext->ndef_cntx.pNdef_NtfSrch_Type = psSrchTypeList;
1934 gpphLibContext->phLib_NdefRecCntx.NumberOfRecords = 255;
1937 &(gpphLibContext->phLib_NdefRecCntx.NdefReg),
1938 gpphLibContext->phLib_NdefRecCntx.NdefTypes_array,
1939 &(gpphLibContext->phLib_NdefRecCntx.RecordsExtracted),
1940 &(gpphLibContext->phLib_NdefRecCntx.CbParam),
1941 gpphLibContext->phLib_NdefRecCntx.ChunkedRecordsarray,
1942 gpphLibContext->phLib_NdefRecCntx.NumberOfRecords);
1944 gpphLibContext->phLib_NdefRecCntx.NdefCb = phOsalNfc_GetMemory(sizeof(phFriNfc_NdefReg_Cb_t));
1945 if(gpphLibContext->phLib_NdefRecCntx.NdefCb==NULL)
1950 gpphLibContext->phLib_NdefRecCntx.NdefCb->NdefCallback = phLibNfc_Ndef_Rtd_Cb;
1952 gpphLibContext->phLib_NdefRecCntx.NdefCb->NumberOfRTDs = uNoSrchRecords;
1955 gpphLibContext->phLib_NdefRecCntx.NdefCb->NdefType[Index] = psSrchTypeList->Type;
1956 gpphLibContext->phLib_NdefRecCntx.NdefCb->Tnf[Index] = psSrchTypeList->Tnf ;
1957 gpphLibContext->phLib_NdefRecCntx.NdefCb->NdeftypeLength[Index] = psSrchTypeList->TypeLength;
1962 RetVal = phFriNfc_NdefReg_AddCb(&(gpphLibContext->phLib_NdefRecCntx.NdefReg),
1963 gpphLibContext->phLib_NdefRecCntx.NdefCb );
1966 gpphLibContext->phLib_NdefRecCntx.ndef_message.buffer =
1967 phOsalNfc_GetMemory(gpphLibContext->ndef_cntx.NdefActualSize);
1968 gpphLibContext->phLib_NdefRecCntx.ndef_message.length =
1969 gpphLibContext->ndef_cntx.NdefActualSize;
1974 gpphLibContext->ndef_cntx.psNdefMap,
1977 (void *)gpphLibContext);
1980 gpphLibContext->ndef_cntx.NdefContinueRead = PH_FRINFC_NDEFMAP_SEEK_BEGIN;
1982 RetVal = phFriNfc_NdefMap_RdNdef(gpphLibContext->ndef_cntx.psNdefMap,
1983 gpphLibContext->phLib_NdefRecCntx.ndef_message.buffer,
1984 (uint32_t*)&gpphLibContext->phLib_NdefRecCntx.ndef_message.length,
1989 gpphLibContext->CBInfo.pClientNdefNtfRespCb = pNdefNtfRspCb;
1990 gpphLibContext->CBInfo.pClientNdefNtfRespCntx = pContext;
1991 gpphLibContext->status.GenCb_pending_status=TRUE;
1992 gpphLibContext->LibNfcState.next_state = eLibNfcHalStateTransaction;