// .DiscardOkReply -- Generic Reply callback handler ---------------------------------DdmOsServices- // ERC DdmOsServices::DiscardOkReply(Message *pMsg) { TRACEF(TRACE_L3,("EXEC Ddm::DiscardOkReply; RQ=%x did=%x pMsg=%x\n",pMsg->reqCode,GetDid(),pMsg)); if (pMsg->Status() != OK) { Tracef("*\n* did=%lx(%s) Rq=%s(%x) erc=%u (DdmOsServices::DiscardOkReply)\n*\n",GetDid(),GetDdmClassName(), NameRq(pMsg->reqCode),pMsg->reqCode,pMsg->Status()); } delete pMsg; return OK; }
STATUS DdmTestSample::Initialize(Message *pMsg) { Tracef("DdmTestSample::Initialize()\n"); Tracef("Registering as DID %d\n", GetDid()); TestMsgRegister *pTestMsg = new TestMsgRegister("TestSample\0", "0d\0", GetDid()); Send(pTestMsg, NULL, REPLYCALLBACK(DdmTestSample, Registered)); DispatchRequest(REQ_TEST_RUN, REQUESTCALLBACK(DdmTestSample, TestProc)); Reply(pMsg, OK); return OK; }
// .DiscardReply -- Generic Reply callback handler -----------------------------------DdmOsServices- // ERC DdmOsServices::DiscardReply(Message *pMsg) { TRACEF(TRACE_L3,("EXEC Ddm::DiscardReply; RQ=%x did=%x pMsg=%x\n",pMsg->reqCode,GetDid(),pMsg)); delete pMsg; return OK; }
void DdmSSAPIDriver::SubmitFirstAlarm() { Event* p_SSAPIEvt = new Event(CTS_SSAPI_ALARM_TOO_MANY_WRONG_LOGINS, GetVdn(), GetDid()); p_SSAPIEvt->AddEventParameter("ssapi"); pSSAPIAlarmContext1 = new SSAPIAlarmContext; pSSAPIAlarmContext1->dummy = 22; SubmitAlarm(p_SSAPIEvt, sizeof(SSAPIAlarmContext), pSSAPIAlarmContext1); }
// .Quiesce -- End-it-all -----------------------------------------------------------------DdmDemo1- // ERC DdmDemo1::Quiesce(Message *_pQuiesceMsg) { Tracef("Quiescing Demo did=%x (DdmDemo1::Quiesce)\n",GetDid()); // Start a timer Message *pMsg = new RqOsTimerStop(pStartMsg); Send(pMsg, _pQuiesceMsg, REPLYCALLBACK(DdmDemo1,ProcessReplyStopTimer)); return OK; }
// .Send -- Send a message to particular Ddm selected by the did ---------------------DdmOsServices- // // Non-FailSafe message methods // STATUS DdmOsServices::Send(Message *pMsg, long signature, void *pContext, DID didTarget) { pMsg->BindContext(signature, pContext, GetDid()); // Use FailSafe anyway, so messages get returned if target fails. STATUS status_= FailSafe::Send(didTarget, pMsg); if (status_ != OK) return Reply(pMsg, status_); return OK; }
// .Enable -- Start-it-up -------------------------------------------------------------DdmPing- // ERC DdmPing::Enable(Message *_pEnableMsg) { Tracef("Enabling DID=%x (DdmPing::Enable)\n",GetDid()); // Start a timer Message *pMsg = new RqOsTimerStart(1000000,1000000); // Time in uSec. Send(pMsg, REPLYCALLBACK(DdmPing,ProcessReplyTimer)); Reply(_pEnableMsg); return OK; }
void autobots_toutiao::initialDevices() { for (size_t i = 0; i < 10; i++) { DeviceParam dev; dev._uuid = GetUuid(); dev._did = GetDid(); dev._useragent = "Mozilla / 5.0 (iPhone; CPU iPhone OS 9_3_5 like Mac OS X) AppleWebKit / 601.1.46 (KHTML, like Gecko) Mobile / 13G36 NewsArticle / 5.8.3.2 JsSdk / 2.0 NetType / WIFI(News 5.8.3 9.300000)"; dev._device_type = GetDeviceType(); m_devices_list.push_back(dev); } }
void DdmSSAPIDriver::SubmitSecondAlarm() { TRACE_ENTRY(DdmSSAPIDriver::SubmitSecondAlarm()); Event* p_SSAPIEvt = new Event(CTS_SSAPI_ALARM_TOO_MANY_WRONG_LOGINS, GetVdn(), GetDid()); p_SSAPIEvt->AddEventParameter("ssapi"); p_SSAPIEvt->AddEventParameter(32); p_SSAPIEvt->AddEventParameter("and another string parameter"); SSAPIAlarmContext* pSSAPIAlarmContext = new SSAPIAlarmContext; pSSAPIAlarmContext->dummy = 11; SubmitAlarm(p_SSAPIEvt, sizeof(SSAPIAlarmContext), pSSAPIAlarmContext); }
void DdmSSAPIDriver::SubmitElevenAlarms() { Event* p_SSAPIEvt; SSAPIAlarmContext* pSSAPIAlarmContext; U16 i; for (i =0; i <=10; i++) { p_SSAPIEvt = new Event(CTS_SSAPI_ALARM_TOO_MANY_WRONG_LOGINS, GetVdn(), GetDid()); p_SSAPIEvt->AddEventParameter(i); pSSAPIAlarmContext = new SSAPIAlarmContext; pSSAPIAlarmContext->dummy = i; SubmitAlarm(p_SSAPIEvt, sizeof(SSAPIAlarmContext), pSSAPIAlarmContext); } }
// .Send -- Route request code messages w/callback -----------------------------------DdmOsServices- // STATUS DdmOsServices::Send(Message *pMsg, void *pContext, ReplyCallback rc) { pMsg->BindContext(this, rc, pContext, GetDid()); STATUS status_; if (DdmManager::requestRouteMap.Get(pMsg->reqCode)->IsDid()) status_= FailSafe::Send(DdmManager::requestRouteMap.Get(pMsg->reqCode)->did, pMsg); else if (DdmManager::requestRouteMap.Get(pMsg->reqCode)->IsVdn()) status_= FailSafe::Send(DdmManager::requestRouteMap.Get(pMsg->reqCode)->vdn, pMsg); else status_=CTS_CHAOS_UNKNOWN_FUNCTION; if (status_ != OK) return Reply(pMsg, status_); return OK; }
// .Enable -- Start-it-up ---------------------------------------------------DdmTimerTest- // STATUS TestDdm::Enable(Message *pMsgReq) { ERC erc; U32 iDid; RqOsSiGetClassTable* pMsg = new RqOsSiGetClassTable(); iDid = GetDid(); counter++; Tracef("TestDdm::Enable() did=%x\n",iDid); erc = Send(pMsg, (ReplyCallback) &ShowClassTable); if (erc != OS_DETAIL_STATUS_SUCCESS) delete pMsg; Reply(pMsgReq,OK); return OK; }
// .Action -- Queue Action Callback Static -------------------------------------------DdmOsServices- // STATUS DdmOsServices::Action(ActionCallbackStatic ecbs,void *pPayload) { U32 idLocal = DeviceId::IdLocal(GetDid()); return DidMan::PutAction(idLocal,ecbs,pPayload); }
// .Action -- Queue Action Callback --------------------------------------------------DdmOsServices- // STATUS DdmOsServices::Action(DdmServices *pInst,ActionCallback ecb,void *pPayload) { U32 idLocal = DeviceId::IdLocal(GetDid()); return DidMan::PutAction(idLocal,pInst,ecb,pPayload); }
// .Signal -- Signal Ddm (ourself) ---------------------------------------------------DdmOsServices- // STATUS DdmOsServices::Signal(SIGNALCODE nSignal,void *pPayload) { return Messenger::Signal(nSignal,pPayload,GetDid()); // Signal Myself }
// .Reply -- Reply to message -------------------------------------------------------DdmOsServices- // STATUS DdmOsServices::Reply(Message *pMsg, STATUS detailedStatus, BOOL fLast) { TRACE(TRACE_MESSAGE, TRACE_L4, ("%s(%08lx)::Reply(%s(%08lx),%x)\n",DdmOsServices::GetDdmClassName(GetDid()),GetDid(),NameRq(pMsg->reqCode),pMsg->reqCode,detailedStatus)); if (pMsg->flags & MESSAGE_FLAGS_FILTER) FilterReply(pMsg); pMsg->DetailedStatusCode = detailedStatus; return Messenger::Reply(pMsg, fLast); }