Ejemplo n.º 1
0
void ScreenSharingViewer::onInitDone(iviLink::ELaunchInfo launcher)
{
   if (iviLink::LAUNCHED_BY_USER == launcher)
   {
      startedByUser = true;
      LOG4CPLUS_INFO(msLogger, "started by user");

      registerProfileCallbacks(iviLink::Profile::ApiUid("ScreenSharingProfile_PAPI_UID"), this);
      //loading service with required UID
      iviLink::Error loadError = loadService(iviLink::Service::Uid("ScreenSharingViewerService"));
      if (loadError.isNoError())
      {
         LOG4CPLUS_INFO(msLogger, "ScreenSharingViewer::initDone() : sending data : " 
            + getMessageTypeStr(iviLink::SCR_SHARING_START) );
         if (mpViewerProfileProxy)
            mpViewerProfileProxy->sendData(getMessageTypeStr(iviLink::SCR_SHARING_START) );         
      }
      else
      {
         LOG4CPLUS_ERROR(msLogger, "service NOT started: " + loadError.toString());
         qApp->quit();
      }
   }
  
   //if application was launched by other side
   else
   {
      startedByUser = false;
      LOG4CPLUS_INFO(msLogger, "started by iviLink");
   }
}
Ejemplo n.º 2
0
void NaviPlayer::onInitDone(iviLink::ELaunchInfo launcher)
{
   LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__);
   if (iviLink::LAUNCHED_BY_USER == launcher)
   {
      LOG4CPLUS_INFO(msLogger, "started by user");
      LOG4CPLUS_INFO(msLogger, "Registering profile callbacks");
      registerProfileCallbacks(iviLink::Profile::ApiUid("NaviReceiverProfile_PAPI_UID"),this);
      mpParent->setText("Loading...");
	  iviLink::Error loadError = loadService(iviLink::Service::Uid(SERVICE));
      if (loadError.isNoError())
      {
         LOG4CPLUS_INFO(msLogger, "service started successfully!");
         mpParent->setText("Click to exit");
         mpParent->setEnabled(true);
      }
      else
      {
         LOG4CPLUS_ERROR(msLogger, std::string("service NOT started") + loadError.toString());
         kill(getpid(), SIGKILL);
      }
   }
   else
   {
      LOG4CPLUS_INFO(msLogger, "started by iviLink");
   }
}
Ejemplo n.º 3
0
void CScreenSharingViewer::onInitDone(iviLink::ELaunchInfo launcher)
{
   LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__);

   if (iviLink::LAUNCHED_BY_USER == launcher)
   {
      LOG4CPLUS_INFO(msLogger, "started by user");
      registerProfileCallbacks(iviLink::Profile::ApiUid("ScreenSharingProfile_PAPI_UID"), this);
      iviLink::Error loadResult = loadService(iviLink::Service::Uid("ScreenSharingViewerService"));
      if (loadResult.isNoError())
      {
         LOG4CPLUS_INFO(msLogger, "service started");
         isServiceAlive = true;

         std::stringstream startStream;
         startStream << iviLink::SCR_SHARING_START;
         LOG4CPLUS_INFO(msLogger, "CScreenSharingViewer::initDone() : sending data : " + startStream.str());
         mpViewerProfileProxy->sendData(startStream.str() );
      }
      else
      {
         LOG4CPLUS_ERROR(msLogger, "service NOT started: " + loadResult.toString());
         isServiceAlive = false;
         killProcess(1);
      }
   }
   else
   {
      LOG4CPLUS_INFO(msLogger, "started by iviLink");
   }

   LOG4CPLUS_INFO(msLogger, "EXIT: CScreenSharingViewer::initDone()");
}
Ejemplo n.º 4
0
void NaviPlayer::onIncomingServiceBeforeLoading(const iviLink::Service::Uid &service)
{
   LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__);
   LOG4CPLUS_INFO(msLogger, "Registering profile callbacks");
   registerProfileCallbacks(iviLink::Profile::ApiUid("NaviReceiverProfile_PAPI_UID"),this);
   mpParent->setText("Loading...");
}
Ejemplo n.º 5
0
void CBasicSample::init()
{
   // initialize application in iviLink core
   initInIVILink();

   //registration profile callbacks for given profile API
   registerProfileCallbacks(iviLink::Profile::ApiUid("BasicSampleProfile_PAPI_UID"), &mBasicSampleCallbacks);
}
Ejemplo n.º 6
0
void CBasicSample::init()
{
    LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__);
    //registration profile callbacks for given profile API
    registerProfileCallbacks(iviLink::Profile::ApiUid("BasicSampleProfile_PAPI_UID"), &mBasicSampleCallbacks);
   // initialize application in iviLink core
   initInIVILink();
}
Ejemplo n.º 7
0
CStateUpdater::CStateUpdater(CRequestProcessor * pCRequestProcessor)
   : CApp(iviLink::Service::Uid(SERVICE_NAME))
   , mSeatClientCallbacks(this)
{
   isQmlReady = false;
   isInitDone = false;
   mLogger = Logger::getInstance("SeatClientSample.CStateUpdater");
   LOG4CPLUS_INFO(mLogger, "CStateUpdater created");
   mpRequestProcessor = pCRequestProcessor;
   registerProfileCallbacks(iviLink::Profile::ApiUid(PROFILE_API_NAME), &mSeatClientCallbacks);
   std::string msg = std::string("registered profile callbacks for api ")+std::string(PROFILE_API_NAME);
   LOG4CPLUS_INFO(mLogger, msg);
}
Ejemplo n.º 8
0
void AuthenticationStateMachine::onInitDone(iviLink::ELaunchInfo launcher)
{
    LOG4CPLUS_TRACE_METHOD(sLogger, __PRETTY_FUNCTION__);

    if (iviLink::LAUNCHED_BY_USER == launcher)
    {
        LOG4CPLUS_INFO(sLogger, "started by user");
        registerProfileCallbacks(iviLink::Profile::ApiUid("AuthenticationProfile_PAPI_UID"), this);
        if(loadService(iviLink::Service::Uid("AuthenticationService")).isNoError())
        {
            LOG4CPLUS_INFO(sLogger, "started by user - service loaded!");
        }
        else
        {
            LOG4CPLUS_FATAL(sLogger, "could not load the service!");
            onProfileError();
        }
        mKeygenThread->start(); //generates keys and sends public key and uid to the other side
    }
    else
    {
        LOG4CPLUS_INFO(sLogger, "started by iviLink");
    }
}
Ejemplo n.º 9
0
void ScreenSharingViewer::onIncomingServiceBeforeLoading(const iviLink::Service::Uid &service)
{
   LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__);
   LOG4CPLUS_INFO(msLogger, "Registering profile callbacks");
   registerProfileCallbacks(iviLink::Profile::ApiUid("ScreenSharingProfile_PAPI_UID"), this);
}
Ejemplo n.º 10
0
void AuthenticationStateMachine::onIncomingServiceBeforeLoading(const iviLink::Service::Uid &service)
{
    LOG4CPLUS_TRACE_METHOD(sLogger, __PRETTY_FUNCTION__);
    registerProfileCallbacks(iviLink::Profile::ApiUid("AuthenticationProfile_PAPI_UID"),this);
}