예제 #1
0
      CError CPmpCoreProtocol::disableByClient(iviLink::CUid id)
      {
         LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__ );
         LOG4CPLUS_INFO(msLogger, "id: " + id.value());
         UInt32 reqSize = sizeof(PMPFrame);
         reqSize += stringInBufSize(id.value());
         PMPFrame * pReq = reinterpret_cast<PMPFrame*>(new UInt8[reqSize]);
         pReq->size = reqSize;
         pReq->reqType = PMP_REQ_CORE_DIS_BY_CLIENT;
         stringToBuffer(id.value(),pReq->data,true);

         PMPFrame * pResp = mpPmpProtocol->makeCoreRequest(*pReq);
         delete [] pReq;

         LOG4CPLUS_INFO(msLogger, "after pReq deleting");

         if (!pResp)
         {
            return CPmpError(CPmpError::ERROR_NETWORK);
         }

         bool res = pResp->data[0];
         delete[] pResp;
         return res ? CPmpError::NoPmpError() : CPmpError(CPmpError::ERROR_FUNCTION_FAILED);
      }
예제 #2
0
파일: CPIM.cpp 프로젝트: Vanuan/iviLink
void CPIM::incomingProfile(iviLink::CUid const& profileUid,
         iviLink::Profile::ApiUid const& papiUid,
         iviLink::Profile::IUid const& piuid,
         iviLink::Service::Uid const& serviceUID)
{
   LOG4CPLUS_TRACE_METHOD(logger, __PRETTY_FUNCTION__ + (" uid " + profileUid.value() + " piuid" + piuid.value() + " sid " + serviceUID.value()));
   // Here is the thread border - to return the code flow to the ipc as
   // fast as possible
   CIncomingProfileJobData* data = new CIncomingProfileJobData(this, profileUid, papiUid, piuid, serviceUID);
   CThreadPoolJob job(CPIMJobStarter::incomingProfile, data);
   mpThreadPool->addJob(job);
}
예제 #3
0
CError CBufferReader::read<iviLink::CUid>(iviLink::CUid & val)
{
   UInt32 uidSize = 0;
   CError err = read(uidSize);
   if (!err.isNoError())
      return err;
   if (uidSize > mFullSize - mUsedSize)
      return CError(1, moduleName, CError::ERROR, "insufficient buffer size (from CUid write)");

   err = val.fromByteArray(mpBuffer + mUsedSize, uidSize);
   mUsedSize += uidSize;

   return err;
}
예제 #4
0
CError CBufferWriter::write<iviLink::CUid>(iviLink::CUid const& val)
{
   UInt8 const* uid = NULL;
   UInt32 uidSize = val.getByteArray(uid);
   CError err = write(uidSize);
   if (!err.isNoError())
      return err;
   if (uidSize > mFullSize - mUsedSize)
      return CError(1, moduleName, CError::ERROR, "insufficient buffer size (from CUid write)");

   memcpy(mpBuffer + mUsedSize, uid, uidSize);
   mUsedSize += uidSize;
   return CError::NoError(moduleName);
}