Beispiel #1
0
/**
 * @brief    Unregister a profile
 */
int TMLCoreListener::TMLCoreListener_UnregisterProfile(const char* profile) 
{
  int iRet = TML_SUCCESS;
  if (NULL != m_ctx){
    bool bUnegisterProfile = true;
    bool bUnegisterCallback = true;
    m_pHandler->tmlProfileUnregister(profile);
    int bOk;
    if (bUnegisterCallback)
    {
        m_log->log (TML_LOG_VORTEX_CMD, "TMLCoreListener", "TMLCoreListener_UnregisterProfile", "Vortex CMD", "vortex_profiles_set_received_handler");
        bOk = vortex_profiles_set_received_handler (m_ctx, profile, NULL, NULL);
        if (axl_false == bOk){
          iRet = TML_ERR_LISTENER_COMMUNICATION;
        }
    }
    if (bUnegisterProfile)
    {
        m_log->log (TML_LOG_VORTEX_CMD, "TMLCoreListener", "TMLCoreListener_UnregisterProfile", "Vortex CMD", "vortex_profiles_unregister");
        bOk = vortex_profiles_unregister (m_ctx, profile);
        if (axl_true == bOk){
           m_log->log (TML_LOG_VORTEX_CMD, "TMLCoreListener", "Profile deregistration of profile", profile, " succeeded");
        }
        else{
          m_log->log (TML_LOG_VORTEX_CMD, "TMLCoreListener", "Profile deregistration of profile", profile, " failed !");
          iRet = TML_ERR_LISTENER_COMMUNICATION;
        }
    }
  }
  else
  {
    iRet = TML_ERR_LISTENER_NOT_INITIALIZED;
  }
  return iRet;
}
Beispiel #2
0
/* mod_test_10_prev init handler */
static int  mod_test_10_prev_init (TurbulenceCtx * _ctx) {
	/* configure the module */
	TBC_MOD_PREPARE (_ctx);

	msg ("Test 10_prev: calling to init module 10_prev..");

	/* register here all profiles required by tests */
	REGISTER ("urn:aspl.es:beep:profiles:reg-test:profile-1");
	REGISTER ("urn:aspl.es:beep:profiles:reg-test:profile-2");
	REGISTER ("urn:aspl.es:beep:profiles:reg-test:profile-3");
	REGISTER ("urn:aspl.es:beep:profiles:reg-test:profile-4");

	/* register a frame received for the remote side (child process) */
	vortex_profiles_set_received_handler (TBC_VORTEX_CTX(ctx), "urn:aspl.es:beep:profiles:reg-test:profile-1", 
					      test_10_received, ctx);
	vortex_profiles_set_received_handler (TBC_VORTEX_CTX(ctx), "urn:aspl.es:beep:profiles:reg-test:profile-2", 
					      test_10_received, ctx);

	/* register here all profiles required by tests */
	REGISTER("urn:aspl.es:beep:profiles:reg-test:profile-1-failed");

	/* register a frame received for the remote side (child process) */
	vortex_profiles_set_received_handler (TBC_VORTEX_CTX(ctx), "urn:aspl.es:beep:profiles:reg-test:profile-1-failed", 
					      test_10_a_received, NULL);

	/* test 16 */
	REGISTER ("urn:aspl.es:beep:profiles:reg-test:profile-16");
	vortex_profiles_set_received_handler (TBC_VORTEX_CTX(ctx), "urn:aspl.es:beep:profiles:reg-test:profile-16", 
					      test_16_received, NULL);

	/* test 17 */
	REGISTER("urn:aspl.es:beep:profiles:reg-test:profile-17");

	/* test 20 and test 21 */
	REGISTER ("urn:aspl.es:beep:profiles:reg-test:profile-20:1");
	vortex_profiles_set_received_handler (TBC_VORTEX_CTX(ctx), "urn:aspl.es:beep:profiles:reg-test:profile-20:1",
					      test_20_frame_received, NULL);
	REGISTER ("urn:aspl.es:beep:profiles:reg-test:profile-20:2");
	REGISTER ("urn:aspl.es:beep:profiles:reg-test:profile-20:3");

	/* test 22 */
	REGISTER ("urn:aspl.es:beep:profiles:reg-test:profile-22:1");

	/* register a frame received handler */
	vortex_profiles_set_received_handler (TBC_VORTEX_CTX(ctx), "urn:aspl.es:beep:profiles:reg-test:profile-22:1",
					      test_22_frame_received, NULL);

	return axl_true;
} /* end mod_test_10_prev_init */
Beispiel #3
0
/**
 * @brief    Register a profile
 */
int TMLCoreListener::TMLCoreListener_RegisterProfile(const char* profile) 
{
  int iRet = TML_SUCCESS;
  if (NULL != m_ctx){
        bool bRegisterProfile = false;
        bool bRegisterCB = false;
        m_pHandler->tmlProfileRegister(profile, true, (void*)listenerFrameReceivedCallback, &m_callbackData, &bRegisterProfile, &bRegisterCB);

        int bOk;
        if (bRegisterProfile){
          m_log->log (TML_LOG_VORTEX_CMD, "TMLCoreListener", "TMLCoreListener_RegisterProfile", "Vortex CMD", "vortex_profiles_register");
          bOk = vortex_profiles_register (m_ctx, profile, 
                                          NULL, NULL,
                                          NULL, NULL,
                                          NULL, NULL);

          if (axl_false == bOk){
            m_log->log (TML_LOG_VORTEX_CMD, "TMLCoreListener", "Profile registration of profile", profile, " failed !");
            iRet = TML_ERR_LISTENER_COMMUNICATION;
          }
          else{
            m_log->log (TML_LOG_VORTEX_CMD, "TMLCoreListener", "Profile registration of profile", profile, " succeeded");
          }
        }
        if (TML_SUCCESS == iRet){
          if (bRegisterCB){
            m_log->log (TML_LOG_VORTEX_CMD, "TMLCoreListener", "TMLCoreListener_RegisterProfile", "Vortex CMD", "vortex_profiles_set_received_handler");
            bOk = vortex_profiles_set_received_handler (m_ctx, profile, 
                                          listenerFrameReceivedCallback, &m_callbackData);
            if (axl_false == bOk){
              iRet = TML_ERR_LISTENER_COMMUNICATION;
            }
          }
        }
  }
  else
  {
    iRet = TML_ERR_LISTENER_NOT_INITIALIZED;
  }
  return iRet;
}