Exemplo n.º 1
0
/**
 * Callback that should be invoked by application library thread 
 * after initialization application in application manager 
 */
void CBasicSample::onInitDone(iviLink::ELaunchInfo launcher)
{

   //if application was launched by user
   if (iviLink::LAUNCHED_BY_USER == launcher)
   {
      LOG4CPLUS_INFO(msLogger, "started by user");

      //loading service with required UID
      iviLink::Error loadError = loadService(iviLink::Service::Uid("BasicSampleService"));
      if (loadError.isNoError())
      {
         LOG4CPLUS_INFO(msLogger, "service started");

         //loading profile proxy which corresponds to given service UID
         CBasicSampleProfileProxy sampleProxy(iviLink::Service::Uid("BasicSampleService"));

         //using method from profile API
         sampleProxy.sendOperands(8,21);
      }
      else
      {
         LOG4CPLUS_ERROR(msLogger, std::string("service NOT started: ") + loadError.toString());
         mpSemaphore->signal();
      }
   }
  
   //if application was launched by other side
   else
   {
      LOG4CPLUS_INFO(msLogger, "started by iviLink");
   }
}
Exemplo n.º 2
0
// iOS
void CBasicSample::onLinkUp()
{
    LOG4CPLUS_INFO(msLogger, "started by user");
    iviLink::Error loadError = loadService(iviLink::Service::Uid("BasicSampleService"));
    assert (loadError.isNoError());
    CBasicSampleProfileProxy sampleProxy(iviLink::Service::Uid("BasicSampleService"));
    sampleProxy.sendOperands(5,3);
}