return TTS_ERROR_INVALID_PARAMETER;
}
- rpc_port_tts_notify_cb_h cb;
-
if (!tts->connected) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Not Connected");
return TTS_ERROR_OPERATION_FAILED;
SLOG(LOG_DEBUG, TAG_TTSC, ">>>>> TTS Hello");
/* register callback - needed to create new client before adding callback */
- cb = rpc_port_tts_notify_cb_create(__notify_cb, false, NULL);
+ rpc_port_tts_notify_cb_h cb = rpc_port_tts_notify_cb_create(__notify_cb, false, NULL);
if (0 != rpc_port_proxy_tts_invoke_register_cb(tts->rpc_h, client->pid, client->uid, cb)) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Failed to invoke register");
return TTS_ERROR_OPERATION_FAILED;
}
- SLOG(LOG_DEBUG, TAG_TTSC, "TTS Register callback");
- if (0 != rpc_port_proxy_tts_invoke_request_hello(tts->rpc_h, client->pid, client->uid)) {
- SLOG(LOG_ERROR, TAG_TTSC, ">>> Request tts hello : Fail to invoke message");
- return TTS_ERROR_OPERATION_FAILED;
- }
SLOG(LOG_DEBUG, TAG_TTSC, "<<<<");
-
return TTS_ERROR_NONE;
}
{
SLOG(LOG_INFO, tts_tag(), "[Server] Server initialize");
- if (-1 != ttsd_data_is_client(uid) && false == ttsd_data_is_client_use_tidl(uid)) {
+ if (-1 != ttsd_data_is_client(uid)) {
SLOG(LOG_WARN, tts_tag(), "[Server WARNING] Uid has already been registered");
return TTSD_ERROR_NONE;
}
}
}
- if (false == ttsd_data_is_client_use_tidl(uid)) {
- if (0 != ttsd_data_new_client(pid, uid)) {
- SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to add client info");
- return TTSD_ERROR_OPERATION_FAILED;
- }
+ if (0 != ttsd_data_new_client(pid, uid)) {
+ SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to add client info");
+ return TTSD_ERROR_OPERATION_FAILED;
}
if (0 != ttsd_player_create_instance(uid)) {
#include "ttsd_data.h"
#include "ttsd_server.h"
+#include "ttsd_tidl.h"
+
rpc_port_stub_tts_callback_s g_callback;
void __send_msg(int pid, int uid, bundle* msg)
{
SLOG(LOG_DEBUG, tts_tag(), ">>>>> TTS REGISTER CALLBACK uid(%d)", uid);
- if (-1 == ttsd_data_is_client(uid)) {
- SLOG(LOG_WARN, tts_tag(), "[Server WARNING] Uid has not yet been registered");
- if (0 != ttsd_data_new_client(pid, uid)) {
- SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to add client info");
- return TTSD_ERROR_OPERATION_FAILED;
- }
+ bool credential_needed = false;
+ if (0 != ttsd_server_initialize(pid, uid, &credential_needed)) {
+ SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] ttsd Hello : server initialize");
+ return TTSE_ERROR_OPERATION_FAILED;
}
if (0 != ttsd_data_set_notify_h(uid, callback, NULL)) {
return TTSD_ERROR_OPERATION_FAILED;
}
+ SLOG(LOG_INFO, tts_tag(), "create player instance");
+ ttsdc_tidl_send_hello(pid, uid, (int)credential_needed);
+
SLOG(LOG_ERROR, tts_tag(), "<<<<<<<<<<<");
return TTSE_ERROR_NONE;
return TTSE_ERROR_NONE;
}
-static int __request_hello_cb(rpc_port_stub_tts_context_h context, int pid, int uid, void *user_data)
-{
- SLOG(LOG_INFO, tts_tag(), "[IN] ttsd hello : pid(%d), uid(%d)", pid, uid);
-
- if (ttsd_data_get_notify_handle(uid)) {
- SLOG(LOG_INFO, tts_tag(), "notify callback is set");
-
- bool credential_needed = 0;
- if (0 != ttsd_server_initialize(pid, uid, &credential_needed)) {
- SLOG(LOG_ERROR, tts_tag(), "[IN ERROR] ttsd Hello : server initialize");
- return TTSE_ERROR_OPERATION_FAILED;
- }
- SLOG(LOG_INFO, tts_tag(), "create player instance");
- ttsdc_tidl_send_hello(pid, uid, (int)credential_needed);
- }
-
- return TTSE_ERROR_NONE;
-}
-
static int __initialize_cb(rpc_port_stub_tts_context_h context, int uid, int pid, bool *credential_needed, void *user_data)
{
SECURE_SLOG(LOG_DEBUG, tts_tag(), "[IN] tts initialize : pid(%d), uid(%d)", pid , uid);
g_callback.create = __create_client_cb;
g_callback.terminate = __destroy_client_cb;
g_callback.set_mode = __set_mode_cb;
- g_callback.request_hello = __request_hello_cb;
g_callback.register_cb = __register_cb;
g_callback.unregister_cb = __unregister_cb;
g_callback.initialize = __initialize_cb;