return false;
}
-/**
- * @function ServerCustomCommandCallBack
- * @description Callback Function
- * @parameter const char* client_name, const char *command, bundle *data, void *user_data
- * @return NA
- */
-void ServerCustomCommandCallBack(const char* client_name, const char *command, bundle *data, void *user_data)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s] %s Callback Invoked\\n", __LINE__, API_NAMESPACE, "ServerCustomCommandCallBack");
-#endif
-
- strncpy(g_szClientName, client_name, PATHLEN);
- g_CallBackHit = true;
- QuitGmainLoop();
- return;
-}
-
/**
* @function ClientCustomComandReplyCallBack
* @description Callback Function
* @parameter const char client_name, const char *request_id, const char *command, bundle *data, void *user_data
* @return NA
*/
-void ServerCustomCmdReceivedCallback(const char client_name, const char *request_id, const char *command, bundle *data, void *user_data)
+void ServerCustomCmdReceivedCallback(const char * client_name, const char *request_id, const char *command, bundle *data, void *user_data)
{
#if DEBUG
FPRINTF("[Line : %d][%s] %s Callback Invoked\\n", __LINE__, API_NAMESPACE, "ServerCustomCmdReceivedCallback");
#endif
+ if(client_name)
+ strncpy(g_szClientName, client_name, strlen(client_name)+1);
g_CallBackHit = true;
QuitGmainLoop();
+ return;
}
/*****************************************************Callback End*****************************************************/
nRet = GetCompleteServerInfo();
PRINT_RESULT(MEDIA_CONTROLLER_ERROR_NONE, nRet, "GetCompleteServerInfo", "Return Value Not Correct");
- nRet = mc_client_send_custom_cmd(g_hMcClient, g_szServerName, TESTCOMMAND, bundle_data, g_request_id);
+ nRet = mc_client_send_custom_cmd(g_hMcClient, g_szServerName, TESTCOMMAND, bundle_data, &g_request_id);
PRINT_RESULT(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_client_send_custom_cmd", MediaControllerGetError(nRet));
return 0;
PRINT_RESULT_CLEANUP(MEDIA_CONTROLLER_ERROR_NONE, nRet, "ServerCustomCmdReceivedCallback", MediaControllerGetError(nRet), mc_client_unset_cmd_reply_received_cb(g_hMcClient));
g_CallBackHit = false;
- nRet = mc_client_send_custom_cmd(g_hMcClient, g_szServerName, TESTCOMMAND, bundle_data, g_request_id);
+ nRet = mc_client_send_custom_cmd(g_hMcClient, g_szServerName, TESTCOMMAND, bundle_data, &g_request_id);
PRINT_RESULT_CLEANUP(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_client_send_custom_cmd", MediaControllerGetError(nRet), mc_client_unset_cmd_reply_received_cb(g_hMcClient); mc_server_unset_custom_cmd_received_cb(g_hMcServer));
IterateGmainLoop();
nRet = mc_server_set_custom_cmd_received_cb(g_hMcServer, ServerCustomCommandReceivedCallback, g_UserData);
PRINT_RESULT(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_server_set_custom_cmd_received_cb", MediaControllerGetError(nRet));
- nRet = mc_client_send_custom_cmd(g_hMcClient, g_szServerName, TESTCOMMAND, bundle_data, g_request_id);
+ nRet = mc_client_send_custom_cmd(g_hMcClient, g_szServerName, TESTCOMMAND, bundle_data, &g_request_id);
PRINT_RESULT_CLEANUP(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_client_send_custom_cmd", MediaControllerGetError(nRet), mc_server_unset_custom_cmd_received_cb(g_hMcServer));
IterateGmainLoop();