TRACE("----------------------------------------\n");
if (strcmp(command, "3\n" ) == 0) {
TRACE("command:%s\n", command);
- notify_sdb_daemon_start();
notify_sensor_daemon_start();
}
else if (strcmp(command, "4\n") == 0) {
return s;\r
\r
}\r
-\r
-void notify_sdb_daemon_start(void) {\r
-\r
- int s;\r
- /*\r
- * send a simple message to the SDB host server to tell it we just started.\r
- * it should be listening on port 26099.\r
- */\r
- char *targetname = g_path_get_basename(tizen_target_path);\r
- char tmp[MAXPACKETLEN] = { 0 };\r
- // when connecting to loopback:26099, do not use tcp_socket_outgoing function\r
- // tcp_socket_outgoing may occur "dns name service not known" in case of network unavaliable status.\r
- s = sdb_loopback_client(SDB_HOST_PORT, SOCK_STREAM);\r
- if (s < 0) {\r
- INFO("can not create socket to talk to the SDB server.\n");\r
- INFO("SDB server might not be started yet.\n");\r
- free(targetname);\r
- return;\r
- }\r
-\r
- /* length is hex host:emulator:port: -> 0x13 = 20 */\r
- sprintf(tmp, "00%2xhost:emulator:%d:%s", 20 + strlen(targetname), tizen_base_port + 1, targetname);\r
- INFO("message to send to SDB server: %s\n", tmp);\r
- if (send(s, tmp, MAXPACKETLEN,0) < 0) {\r
- ERR( "message sending to SDB server error!\n");\r
- perror("sdb.c: ");\r
- }\r
-\r
- if (s >= 0){\r
- socket_close(s);\r
- }\r
-\r
- free(targetname);\r
-}\r