Home | History | Annotate | Download | only in src

Lines Matching refs:pLlcpTransport

453    phFriNfc_LlcpTransport_t* pLlcpTransport = (phFriNfc_LlcpTransport_t*)pContext;
457 pLlcpTransport->LinkStatusError = TRUE;
478 Handle_Connectionless_IncommingFrame(pLlcpTransport,
489 Handle_Discovery_IncomingFrame(pLlcpTransport,
512 Handle_ConnectionOriented_IncommingFrame(pLlcpTransport,
525 status = phFriNfc_Llcp_Recv(pLlcpTransport->pLlcp,
527 pLlcpTransport);
652 NFCSTATUS phFriNfc_LlcpTransport_Reset (phFriNfc_LlcpTransport_t *pLlcpTransport,
659 if(pLlcpTransport == NULL || pLlcp == NULL)
666 pLlcpTransport->pLlcp = pLlcp;
667 pLlcpTransport->LinkStatusError = FALSE;
668 pLlcpTransport->bSendPending = FALSE;
669 pLlcpTransport->bRecvPending = FALSE;
670 pLlcpTransport->bDmPending = FALSE;
671 pLlcpTransport->bFrmrPending = FALSE;
672 pLlcpTransport->socketIndex = FALSE;
673 pLlcpTransport->LinkStatusError = 0;
674 pLlcpTransport->pfDiscover_Cb = NULL;
677 memset(pLlcpTransport->pCachedServiceNames, 0x00, sizeof(phFriNfc_Llcp_CachedServiceName_t)*PHFRINFC_LLCP_SDP_ADVERTISED_NB);
682 pLlcpTransport->pSocketTable[i].eSocket_State = phFriNfc_LlcpTransportSocket_eSocketDefault;
683 pLlcpTransport->pSocketTable[i].eSocket_Type = phFriNfc_LlcpTransport_eDefaultType;
684 pLlcpTransport->pSocketTable[i].index = i;
685 pLlcpTransport->pSocketTable[i].pContext = NULL;
686 pLlcpTransport->pSocketTable[i].pListenContext = NULL;
687 pLlcpTransport->pSocketTable[i].pAcceptContext = NULL;
688 pLlcpTransport->pSocketTable[i].pRejectContext = NULL;
689 pLlcpTransport->pSocketTable[i].pConnectContext = NULL;
690 pLlcpTransport->pSocketTable[i].pDisconnectContext = NULL;
691 pLlcpTransport->pSocketTable[i].pSendContext = NULL;
692 pLlcpTransport->pSocketTable[i].pRecvContext = NULL;
693 pLlcpTransport->pSocketTable[i].pSocketErrCb = NULL;
694 pLlcpTransport->pSocketTable[i].bufferLinearLength = 0;
695 pLlcpTransport->pSocketTable[i].bufferSendMaxLength = 0;
696 pLlcpTransport->pSocketTable[i].bufferRwMaxLength = 0;
697 pLlcpTransport->pSocketTable[i].ReceiverBusyCondition = FALSE;
698 pLlcpTransport->pSocketTable[i].RemoteBusyConditionInfo = FALSE;
699 pLlcpTransport->pSocketTable[i].socket_sSap = PHFRINFC_LLCP_SAP_DEFAULT;
700 pLlcpTransport->pSocketTable[i].socket_dSap = PHFRINFC_LLCP_SAP_DEFAULT;
701 pLlcpTransport->pSocketTable[i].bSocketRecvPending = FALSE;
702 pLlcpTransport->pSocketTable[i].bSocketSendPending = FALSE;
703 pLlcpTransport->pSocketTable[i].bSocketListenPending = FALSE;
704 pLlcpTransport->pSocketTable[i].bSocketDiscPending = FALSE;
705 pLlcpTransport->pSocketTable[i].bSocketConnectPending = FALSE;
706 pLlcpTransport->pSocketTable[i].bSocketAcceptPending = FALSE;
707 pLlcpTransport->pSocketTable[i].bSocketRRPending = FALSE;
708 pLlcpTransport->pSocketTable[i].bSocketRNRPending = FALSE;
709 pLlcpTransport->pSocketTable[i].psTransport = pLlcpTransport;
710 pLlcpTransport->pSocketTable[i].pfSocketSend_Cb = NULL;
711 pLlcpTransport->pSocketTable[i].pfSocketRecv_Cb = NULL;
712 pLlcpTransport->pSocketTable[i].pfSocketRecvFrom_Cb = NULL;
713 pLlcpTransport->pSocketTable[i].pfSocketListen_Cb = NULL;
714 pLlcpTransport->pSocketTable[i].pfSocketConnect_Cb = NULL;
715 pLlcpTransport->pSocketTable[i].pfSocketDisconnect_Cb = NULL;
716 pLlcpTransport->pSocketTable[i].socket_VS = 0;
717 pLlcpTransport->pSocketTable[i].socket_VSA = 0;
718 pLlcpTransport->pSocketTable[i].socket_VR = 0;
719 pLlcpTransport->pSocketTable[i].socket_VRA = 0;
720 pLlcpTransport->pSocketTable[i].remoteRW = 0;
721 pLlcpTransport->pSocketTable[i].localRW = 0;
722 pLlcpTransport->pSocketTable[i].remoteMIU = 0;
723 pLlcpTransport->pSocketTable[i].localMIUX = 0;
724 pLlcpTransport->pSocketTable[i].index = 0;
725 pLlcpTransport->pSocketTable[i].indexRwRead = 0;
726 pLlcpTransport->pSocketTable[i].indexRwWrite = 0;
728 memset(&pLlcpTransport->pSocketTable[i].sSocketOption, 0x00, sizeof(phFriNfc_LlcpTransport_sSocketOptions_t));
730 if (pLlcpTransport->pSocketTable[i].sServiceName.buffer != NULL) {
731 phOsalNfc_FreeMemory(pLlcpTransport->pSocketTable[i].sServiceName.buffer);
733 pLlcpTransport->pSocketTable[i].sServiceName.buffer = NULL;
734 pLlcpTransport->pSocketTable[i].sServiceName.length = 0;
738 status = phFriNfc_Llcp_Recv(pLlcpTransport->pLlcp,
740 pLlcpTransport);
746 NFCSTATUS phFriNfc_LlcpTransport_CloseAll (phFriNfc_LlcpTransport_t *pLlcpTransport)
753 if(pLlcpTransport == NULL)
761 if(pLlcpTransport->pSocketTable[i].eSocket_Type == phFriNfc_LlcpTransport_eConnectionOriented)
763 switch(pLlcpTransport->pSocketTable[i].eSocket_State)
771 phFriNfc_LlcpTransport_Close(&pLlcpTransport->pSocketTable[i]);
780 phFriNfc_LlcpTransport_Close(&pLlcpTransport->pSocketTable[i]);
787 pCachedServiceName = &pLlcpTransport->pCachedServiceNames[i];
1138 NFCSTATUS phFriNfc_LlcpTransport_DiscoverServices( phFriNfc_LlcpTransport_t *pLlcpTransport,
1148 pLlcpTransport->psDiscoveryServiceNameList = psServiceNameList;
1149 pLlcpTransport->pnDiscoverySapList = pnSapList;
1150 pLlcpTransport->nDiscoveryListSize = nListSize;
1151 pLlcpTransport->pfDiscover_Cb = pDiscover_Cb;
1152 pLlcpTransport->pDiscoverContext = pContext;
1155 pLlcpTransport->nDiscoveryReqOffset = 0;
1156 pLlcpTransport->nDiscoveryResOffset = 0;
1159 result = phFriNfc_LlcpTransport_DiscoverServicesEx(pLlcpTransport);
1196 NFCSTATUS phFriNfc_LlcpTransport_Socket(phFriNfc_LlcpTransport_t *pLlcpTransport,
1215 || (pLlcpTransport == NULL))
1234 status = phFriNfc_Llcp_GetLocalInfo(pLlcpTransport->pLlcp,&LlcpLinkParamInfo);
1245 pLlcpTransport->pSocketTable[index].eSocket_State == phFriNfc_LlcpTransportSocket_eSocketDefault)
1248 *pLlcpSocket = &pLlcpTransport->pSocketTable[index];
1251 pLlcpTransport->pSocketTable[index].eSocket_Type = eType;
1252 pLlcpTransport->pSocketTable[index].pSocketErrCb = pErr_Cb;
1255 pLlcpTransport->pSocketTable[index].pContext = pContext;
1268 memcpy(&pLlcpTransport->pSocketTable[index].sSocketOption, psOptions, sizeof(phFriNfc_LlcpTransport_sSocketOptions_t));
1271 pLlcpTransport->pSocketTable[index].localMIUX = (pLlcpTransport->pSocketTable[index].sSocketOption.miu - PHFRINFC_LLCP_MIU_DEFAULT) & PHFRINFC_LLCP_TLV_MIUX_MASK;
1272 pLlcpTransport->pSocketTable[index].localRW = pLlcpTransport->pSocketTable[index].sSocketOption.rw & PHFRINFC_LLCP_TLV_RW_MASK;
1275 pLlcpTransport->pSocketTable[index].bufferSendMaxLength = pLlcpTransport->pSocketTable[index].sSocketOption.miu;
1276 pLlcpTransport->pSocketTable[index].bufferRwMaxLength = pLlcpTransport->pSocketTable[index].sSocketOption.miu * ((pLlcpTransport->pSocketTable[index].sSocketOption.rw & PHFRINFC_LLCP_TLV_RW_MASK));
1277 pLlcpTransport->pSocketTable[index].bufferLinearLength = psWorkingBuffer->length - pLlcpTransport->pSocketTable[index].bufferSendMaxLength - pLlcpTransport->pSocketTable[index].bufferRwMaxLength;
1280 if((pLlcpTransport->pSocketTable[index].bufferSendMaxLength + pLlcpTransport->pSocketTable[index].bufferRwMaxLength) > psWorkingBuffer->length
1281 || ((pLlcpTransport->pSocketTable[index].bufferLinearLength < PHFRINFC_LLCP_MIU_DEFAULT) && (pLlcpTransport->pSocketTable[index].bufferLinearLength != 0)))
1288 for(cpt=0;cpt<pLlcpTransport->pSocketTable[index].localRW;cpt++)
1290 pLlcpTransport->pSocketTable[index].sSocketRwBufferTable[cpt].buffer = psWorkingBuffer->buffer + (cpt*pLlcpTransport->pSocketTable[index].sSocketOption.miu);
1291 pLlcpTransport->pSocketTable[index].sSocketRwBufferTable[cpt].length = 0;
1295 pLlcpTransport->pSocketTable[index].sSocketSendBuffer.buffer = psWorkingBuffer->buffer + pLlcpTransport->pSocketTable[index].bufferRwMaxLength;
1296 pLlcpTransport->pSocketTable[index].sSocketSendBuffer.length = pLlcpTransport->pSocketTable[index].bufferSendMaxLength;
1299 pLlcpTransport->pSocketTable[index].sSocketLinearBuffer.buffer = psWorkingBuffer->buffer + pLlcpTransport->pSocketTable[index].bufferRwMaxLength + pLlcpTransport->pSocketTable[index].bufferSendMaxLength;
1300 pLlcpTransport->pSocketTable[index].sSocketLinearBuffer.length = pLlcpTransport->pSocketTable[index].bufferLinearLength;
1302 if(pLlcpTransport->pSocketTable[index].sSocketLinearBuffer.length != 0)
1305 phFriNfc_Llcp_CyclicFifoInit(&pLlcpTransport->pSocketTable[index].sCyclicFifoBuffer,
1306 pLlcpTransport->pSocketTable[index].sSocketLinearBuffer.buffer,
1307 pLlcpTransport->pSocketTable[index].sSocketLinearBuffer.length);
1317 pLlcpTransport->pSocketTable[index].localRW = psWorkingBuffer->length / (pLlcpTransport->pLlcp->sLocalParams.miu + 1);
1321 pLlcpTransport->pSocketTable[index].localRW = 0;
1324 if (pLlcpTransport->pSocketTable[index].localRW > PHFRINFC_LLCP_RW_MAX)
1326 pLlcpTransport->pSocketTable[index].localRW = PHFRINFC_LLCP_RW_MAX;
1330 for(cpt=0 ; cpt<pLlcpTransport->pSocketTable[index].localRW ; cpt++)
1332 pLlcpTransport->pSocketTable[index].sSocketRwBufferTable[cpt].buffer = psWorkingBuffer->buffer + (cpt*(pLlcpTransport->pLlcp->sLocalParams.miu + 1));
1333 pLlcpTransport->pSocketTable[index].sSocketRwBufferTable[cpt].length = 0;
1337 pLlcpTransport->pSocketTable[index].indexRwRead = 0;
1338 pLlcpTransport->pSocketTable[index].indexRwWrite = 0;
1342 pLlcpTransport->pSocketTable[index].index = index;
1345 pLlcpTransport->pSocketTable[index].eSocket_State = phFriNfc_LlcpTransportSocket_eSocketCreated;