/* check state */
RETVM_IF(state != VC_STATE_INITIALIZED, VC_ERROR_INVALID_STATE, TAG_VCC, "[ERROR] Invalid State: Current state(%d) is not 'Initialized'", state);
+ ret = vc_tidl_request_hello_sync();
+ if (VC_ERROR_NONE != ret) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request hello_sync, ret(%d)", ret);
+ return ret;
+ }
+
int cnt = 0;
while (EINA_TRUE == __vc_connect_daemon(NULL) && VC_CONNECTION_RETRY_COUNT > cnt) {
cnt++;
info->connection_requesting = true;
}
+static int __request_tidl_connect_sync(vc_tidl_info_s* info)
+{
+ int ret = rpc_port_proxy_vc_proxy_vc_connect_sync(info->rpc_h);
+ if (RPC_PORT_ERROR_NONE != ret) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to request connection to stub. ret(%d)", ret);
+ return VC_ERROR_OPERATION_FAILED;
+ }
+
+ SLOG(LOG_INFO, TAG_VCC, "[INFO] Success to connect stub synchronously. ret(%d)", ret);
+ return VC_ERROR_NONE;
+}
+
+
static void __notify_cb(void* user_data, int pid, bundle* msg)
{
// corresponding to listener_event_callback
}
+int vc_tidl_request_hello_sync()
+{
+ SLOG(LOG_INFO, TAG_VCC, "[TIDL] vc_tidl_request_hello");
+
+ int pid = getpid();
+ vc_tidl_info_s* info = __get_tidl_info_s(pid);
+ RETVM_IF(NULL == info, VC_ERROR_INVALID_PARAMETER, TAG_VCC, "[ERROR] Fail to get tidl info");
+
+ if (!info->connected) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Not Connected. Call __request_tidl_connect()");
+ int ret = __request_tidl_connect_sync(info);
+ if (VC_ERROR_NONE != ret) {
+ SLOG(LOG_ERROR, TAG_VCC, "[TIDL] Fail to connect, ret(%d)", ret);
+ return VC_ERROR_OPERATION_FAILED;
+ }
+ SLOG(LOG_ERROR, TAG_VCC, "[TIDL] Stub is connected");
+ }
+
+ SLOG(LOG_DEBUG, TAG_VCC, ">>>>> VCC Hello");
+ if (VC_ERROR_NONE != __invoke_register_notify_callback(pid, info)) {
+ SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Fail to invoke register callback");
+ return VC_ERROR_OPERATION_FAILED;
+ }
+
+ SLOG(LOG_DEBUG, TAG_VCC, "<<<<");
+ return VC_ERROR_NONE;
+}
+
static int __convert_unhandled_error(int ret)
{
if (RPC_PORT_ERROR_IO_ERROR == ret || RPC_PORT_ERROR_OUT_OF_MEMORY == ret) {