本文整理汇总了C++中SyncEvent::notifyOne方法的典型用法代码示例。如果您正苦于以下问题:C++ SyncEvent::notifyOne方法的具体用法?C++ SyncEvent::notifyOne怎么用?C++ SyncEvent::notifyOne使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SyncEvent
的用法示例。
在下文中一共展示了SyncEvent::notifyOne方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nativeNfcTag_abortWaits
/*******************************************************************************
**
** Function: nativeNfcTag_abortWaits
**
** Description: Unblock all thread synchronization objects.
**
** Returns: None
**
*******************************************************************************/
void nativeNfcTag_abortWaits ()
{
ALOGD ("%s", __FUNCTION__);
{
SyncEventGuard g (sReadEvent);
sReadEvent.notifyOne ();
}
sem_post (&sWriteSem);
sem_post (&sFormatSem);
{
SyncEventGuard g (sTransceiveEvent);
sTransceiveEvent.notifyOne ();
}
{
SyncEventGuard g (sReconnectEvent);
sReconnectEvent.notifyOne ();
}
sem_post (&sCheckNdefSem);
{
SyncEventGuard guard (sPresenceCheckEvent);
sPresenceCheckEvent.notifyOne ();
}
sem_post (&sMakeReadonlySem);
sCurrentRfInterface = NFA_INTERFACE_ISO_DEP;
sCurrentConnectedTargetType = TARGET_TYPE_UNKNOWN;
}
示例2: nativeNfcSnep_doPutReceived
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 ();
}
}
示例3: nativeNfcTag_doDeactivateStatus
/*******************************************************************************
**
** Function: nativeNfcTag_doDeactivateStatus
**
** Description: Receive the completion status of deactivate operation.
**
** Returns: None
**
*******************************************************************************/
void nativeNfcTag_doDeactivateStatus (int status)
{
sGotDeactivate = (status == 0);
SyncEventGuard g (sReconnectEvent);
sReconnectEvent.notifyOne ();
}
示例4: nativeNfcSnep_doPutCompleted
static void nativeNfcSnep_doPutCompleted (tNFA_STATUS status)
{
NXPLOG_API_D ("%s: status=0x%X", __FUNCTION__, status);
sSnepClientPutState = status;
SyncEventGuard g (sNfaSnepClientPutMsgEvent);
sNfaSnepClientPutMsgEvent.notifyOne ();
}
示例5: nativeNfcLlcp_doClientReadCompleted
static void nativeNfcLlcp_doClientReadCompleted (tNFA_STATUS status)
{
NXPLOG_API_D ("%s: status=0x%X", __FUNCTION__, status);
SyncEventGuard g (sNfaLlcpConnLessReadEvent);
bClientReadState = TRUE;
sNfaLlcpConnLessReadEvent.notifyOne ();
}
示例6: nativeNfcSnep_abortClientWaits
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__);
}
示例7: nativeNfcTag_doConnectStatus
/*******************************************************************************
**
** Function: nativeNfcTag_doConnectStatus
**
** Description: Receive the completion status of connect operation.
** isConnectOk: Status of the operation.
**
** Returns: None
**
*******************************************************************************/
void nativeNfcTag_doConnectStatus (jboolean isConnectOk)
{
if (sConnectWaitingForComplete != JNI_FALSE)
{
sConnectWaitingForComplete = JNI_FALSE;
sConnectOk = isConnectOk;
SyncEventGuard g (sReconnectEvent);
sReconnectEvent.notifyOne ();
}
}
示例8: nativeNfcLlcp_abortClientWaits
void nativeNfcLlcp_abortClientWaits()
{
NXPLOG_API_D ("%s", __FUNCTION__);
sLlcpConnLessClientHandle = 0;
{
SyncEventGuard g (sNfaLlcpClientRegEvent);
sNfaLlcpClientRegEvent.notifyOne ();
}
NXPLOG_API_D ("%s exit", __FUNCTION__);
}
示例9: nativeNfcSnep_abortServerWaits
/*******************************************************************************
**
** 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();
}
}
示例10: nativeNfcTag_notifyRfTimeout
void nativeNfcTag_notifyRfTimeout ()
{
SyncEventGuard g (sTransceiveEvent);
ALOGD ("%s: waiting for transceive: %d", __FUNCTION__, sWaitingForTransceive);
if (!sWaitingForTransceive)
return;
sTransceiveRfTimeout = true;
sTransceiveEvent.notifyOne ();
}
示例11: nativeNfcLlcp_doServerReadCompleted
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 ();
}
示例12: stackCallback
void RoutingManager::stackCallback (UINT8 event, tNFA_CONN_EVT_DATA* eventData)
{
static const char fn [] = "RoutingManager::stackCallback";
ALOGD("%s: event=0x%X", fn, event);
RoutingManager& routingManager = RoutingManager::getInstance();
switch (event)
{
case NFA_CE_REGISTERED_EVT:
{
tNFA_CE_REGISTERED& ce_registered = eventData->ce_registered;
ALOGD("%s: NFA_CE_REGISTERED_EVT; status=0x%X; h=0x%X", fn, ce_registered.status, ce_registered.handle);
}
break;
case NFA_CE_DEREGISTERED_EVT:
{
tNFA_CE_DEREGISTERED& ce_deregistered = eventData->ce_deregistered;
ALOGD("%s: NFA_CE_DEREGISTERED_EVT; h=0x%X", fn, ce_deregistered.handle);
}
break;
case NFA_CE_ACTIVATED_EVT:
{
routingManager.notifyActivated();
}
break;
case NFA_DEACTIVATED_EVT:
case NFA_CE_DEACTIVATED_EVT:
{
ALOGD("%s: NFA_DEACTIVATED_EVT, NFA_CE_DEACTIVATED_EVT", fn);
routingManager.notifyDeactivated();
SyncEventGuard g (gDeactivatedEvent);
gActivated = false; //guard this variable from multi-threaded access
gDeactivatedEvent.notifyOne ();
}
break;
case NFA_CE_DATA_EVT:
{
tNFA_CE_DATA& ce_data = eventData->ce_data;
ALOGD("%s: NFA_CE_DATA_EVT; stat=0x%X; h=0x%X; data len=%u", fn, ce_data.status, ce_data.handle, ce_data.len);
getInstance().handleData(ce_data.p_data, ce_data.len, ce_data.status);
}
break;
}
}
示例13: nativeNfcTag_doTransceiveStatus
/*******************************************************************************
**
** Function: nativeNfcTag_doTransceiveStatus
**
** Description: Receive the completion status of transceive operation.
** status: operation status.
** buf: Contains tag's response.
** bufLen: Length of buffer.
**
** Returns: None
**
*******************************************************************************/
void nativeNfcTag_doTransceiveStatus (tNFA_STATUS status, uint8_t* buf, uint32_t bufLen)
{
SyncEventGuard g (sTransceiveEvent);
ALOGD ("%s: data len=%d", __FUNCTION__, bufLen);
if (!sWaitingForTransceive)
{
ALOGE ("%s: drop data", __FUNCTION__);
return;
}
sRxDataStatus = status;
if (sRxDataStatus == NFA_STATUS_OK || sRxDataStatus == NFA_STATUS_CONTINUE)
sRxDataBuffer.append (buf, bufLen);
if (sRxDataStatus == NFA_STATUS_OK)
sTransceiveEvent.notifyOne ();
}
示例14: nativeNfcTag_doReadCompleted
/*******************************************************************************
**
** Function: nativeNfcTag_doReadCompleted
**
** Description: Receive the completion status of read operation. Called by
** NFA_READ_CPLT_EVT.
** status: Status of operation.
**
** Returns: None
**
*******************************************************************************/
void nativeNfcTag_doReadCompleted (tNFA_STATUS status)
{
ALOGD ("%s: status=0x%X; is reading=%u", __FUNCTION__, status, sIsReadingNdefMessage);
if (sIsReadingNdefMessage == false)
return; //not reading NDEF message right now, so just return
if (status != NFA_STATUS_OK)
{
sReadDataLen = 0;
if (sReadData)
free (sReadData);
sReadData = NULL;
}
SyncEventGuard g (sReadEvent);
sReadEvent.notifyOne ();
}
示例15: nfaSnepServerCallback
static void nfaSnepServerCallback (tNFA_SNEP_EVT snepEvent, tNFA_SNEP_EVT_DATA *eventData)
{
NXPLOG_API_D("%s: Function Entry snepEvent: 0x%X\n",__FUNCTION__, snepEvent);
switch (snepEvent)
{
case NFA_SNEP_REG_EVT:
NXPLOG_API_D ("%s: NFA_SNEP_REG_EVT; Status: 0x%04x\n", __FUNCTION__, eventData->reg.status);
NXPLOG_API_D ("%s: NFA_SNEP_REG_EVT; Server Register Handle: 0x%04x\n", __FUNCTION__, eventData->reg.reg_handle);
sSnepServerHandle = eventData->reg.reg_handle;
{
SyncEventGuard guard (sNfaSnepServerRegEvent);
sNfaSnepServerRegEvent.notifyOne ();
}
break;
case NFA_SNEP_DEFAULT_SERVER_STARTED_EVT:
NXPLOG_API_D ("%s: NFA_SNEP_DEFAULT_SERVER_STARTED_EVT\n", __FUNCTION__);
break;
case NFA_SNEP_DEFAULT_SERVER_STOPPED_EVT:
NXPLOG_API_D ("%s: NFA_SNEP_DEFAULT_SERVER_STOPPED_EVT\n", __FUNCTION__);
break;
case NFA_SNEP_ACTIVATED_EVT:
NXPLOG_API_D ("%s: NFA_SNEP_ACTIVATED_EVT: Server Activated\n", __FUNCTION__);
break;
case NFA_SNEP_DEACTIVATED_EVT:
NXPLOG_API_D ("%s: NFA_SNEP_DEACTIVATED_EVT: Server Deactivated\n", __FUNCTION__);
break;
case NFA_SNEP_CONNECTED_EVT:
NXPLOG_API_D ("%s: NFA_SNEP_CONNECTED_EVT: Server Register Handle: 0x%04x\n", __FUNCTION__, eventData->connect.reg_handle);
NXPLOG_API_D ("%s: NFA_SNEP_CONNECTED_EVT: Server Connection handle: 0x%04x\n", __FUNCTION__, eventData->connect.conn_handle);
if((eventData->connect.reg_handle) &&
(eventData->connect.conn_handle))
{
sSnepServerConnectionHandle = eventData->connect.conn_handle;
nativeNfcSnep_notifyServerActivated();
}
break;
case NFA_SNEP_DISC_EVT:
NXPLOG_API_D ("%s: NFA_SNEP_DISC_EVT: Server Connection/Register Handle: 0x%04x\n", __FUNCTION__, eventData->disc.conn_handle);
if(sSnepServerConnectionHandle == eventData->disc.conn_handle)
{
nativeNfcSnep_notifyServerDeactivated();
}
break;
case NFA_SNEP_PUT_REQ_EVT:
NXPLOG_API_D ("%s: NFA_SNEP_PUT_REQ_EVT: Server Connection Handle: 0x%04x\n", __FUNCTION__, eventData->put_req.conn_handle);
NXPLOG_API_D ("%s: NFA_SNEP_PUT_REQ_EVT: NDEF Message Length: 0x%04x\n", __FUNCTION__, eventData->put_req.ndef_length);
nativeNfcSnep_doPutReceived(eventData->put_req.conn_handle, eventData->put_req.p_ndef, eventData->put_req.ndef_length);
break;
case NFA_SNEP_ALLOC_BUFF_EVT:
NXPLOG_API_D ("%s: NFA_SNEP_ALLOC_BUFF_EVT: Server Connection Handle: 0x%04x\n", __FUNCTION__, eventData->alloc.conn_handle);
NXPLOG_API_D ("%s: NFA_SNEP_ALLOC_BUFF_EVT: Request Code: 0x%04x\n", __FUNCTION__, eventData->alloc.req_code);
NXPLOG_API_D ("%s: NFA_SNEP_ALLOC_BUFF_EVT: NDEF Message Length: 0x%04x\n", __FUNCTION__, eventData->alloc.ndef_length);
NXPLOG_API_D ("%s: NFA_SNEP_ALLOC_BUFF_EVT: Response Code: 0x%04x\n", __FUNCTION__, eventData->alloc.resp_code);
if(0x00 != eventData->alloc.ndef_length)
{
eventData->alloc.p_buff = (UINT8*)malloc(eventData->alloc.ndef_length);
if(NULL == eventData->alloc.p_buff)
{
NXPLOG_API_D("Memory Allocation Failed !!!\n");
}
}
break;
case NFA_SNEP_FREE_BUFF_EVT:
NXPLOG_API_D ("%s: NFA_SNEP_FREE_BUFF_EVT: Server Connection Handle: 0x%04x\n",__FUNCTION__, eventData->free.conn_handle);
NXPLOG_API_D ("%s: NFA_SNEP_FREE_BUFF_EVT: Buffer to Free: 0x%04x\n",__FUNCTION__, eventData->free.p_buff);
if(eventData->free.p_buff)
{
free(eventData->free.p_buff);
eventData->free.p_buff = NULL;
}
break;
default:
NXPLOG_API_D ("%s: unknown event 0x%X ?\n", __FUNCTION__, snepEvent);
break;
}
}