本文整理汇总了C++中phDal4Nfc_link_cbk_interface_t::close方法的典型用法代码示例。如果您正苦于以下问题:C++ phDal4Nfc_link_cbk_interface_t::close方法的具体用法?C++ phDal4Nfc_link_cbk_interface_t::close怎么用?C++ phDal4Nfc_link_cbk_interface_t::close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phDal4Nfc_link_cbk_interface_t
的用法示例。
在下文中一共展示了phDal4Nfc_link_cbk_interface_t::close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: phDal4Nfc_ConfigRelease
NFCSTATUS phDal4Nfc_ConfigRelease(void *pHwRef)
{
NFCSTATUS result = NFCSTATUS_SUCCESS;
void * pThreadReturn;
DAL_PRINT("phDal4Nfc_ConfigRelease ");
if (gDalContext.hw_valid == TRUE)
{
/* Signal the read and write threads to exit. NOTE: there
actually is no write thread! :) */
DAL_PRINT("Stop Reader Thread");
gReadWriteContext.nReadThreadAlive = 0;
gReadWriteContext.nWriteThreadAlive = 0;
/* Wake up the read thread so it can exit */
DAL_PRINT("Release Read Semaphore");
sem_post(&nfc_read_sem);
DAL_DEBUG("phDal4Nfc_ConfigRelease - doing pthread_join(%d)",
gReadWriteContext.nReadThread);
if (pthread_join(gReadWriteContext.nReadThread, &pThreadReturn) != 0)
{
result = PHNFCSTVAL(CID_NFC_DAL, NFCSTATUS_FAILED);
DAL_PRINT("phDal4Nfc_ConfigRelease KO");
}
/* Close the message queue */
#ifdef USE_MQ_MESSAGE_QUEUE
mq_close(nDeferedCallMessageQueueId);
#endif
/* Shutdown NFC Chip */
phDal4Nfc_Reset(0);
/* Close the link */
gLinkFunc.close();
if (gDalContext.pDev != NULL) {
nfc_pn544_close(gDalContext.pDev);
}
/* Reset the Read Writer context to NULL */
memset((void *)&gReadWriteContext,0,sizeof(gReadWriteContext));
/* Reset the DAL context values to NULL */
memset((void *)&gDalContext,0,sizeof(gDalContext));
}
gDalContext.hw_valid = FALSE;
DAL_DEBUG("phDal4Nfc_ConfigRelease(): %04x\n", result);
return result;
}