emuld: support sap command
authormunkyu.im <munkyu.im@samsung.com>
Fri, 29 Nov 2013 08:21:03 +0000 (17:21 +0900)
committermunkyu.im <munkyu.im@samsung.com>
Fri, 29 Nov 2013 08:21:03 +0000 (17:21 +0900)
added to process_evdi_command(...) to support sap protocol

Change-Id: I30db58acf32ff500b5ac7d8d601edae19eab23e0
Signed-off-by: munkyu.im <munkyu.im@samsung.com>
include/emuld.h
src/emuld.cpp

index c70fd1dc31799458dc7d194af17ed9390f5e8076..8193399ff1905c7ca441b8b1e5e18fc4ba594110 100644 (file)
@@ -67,7 +67,7 @@
 #define SDBD_PORT           26101
 #define DEFAULT_PORT        3577
 #define VMODEM_PORT         3578
-#define SAP_PORT                   9999
+#define SAP_PORT            26871
 #define GPSD_PORT           3579
 #define SENSORD_PORT        3580
 #define SRV_IP              "10.0.2.2"
 
 enum
 {
-       fdtype_server = 0,
-       fdtype_device = 1,
-       fdtype_vmodem = 2,
-       fdtype_sap    = 3,
-       fdtype_ij         = 4,
-       fdtype_sensor = 5, //udp
-       fdtype_max    = 6
+    fdtype_server = 0,
+    fdtype_device = 1,
+    fdtype_vmodem = 2,
+    fdtype_sap    = 3,
+    fdtype_ij     = 4,
+    fdtype_sensor = 5, //udp
+    fdtype_max    = 6
 };
 
 extern pthread_t tid[MAX_CLIENT + 1];
@@ -95,7 +95,7 @@ extern int g_fd[fdtype_max];
 
 
 #define IJTYPE_TELEPHONY    "telephony"
-#define IJTYPE_SAP                 "sap"
+#define IJTYPE_SAP          "sap"
 #define IJTYPE_SDCARD       "sdcard"
 
 bool epoll_ctl_add(const int fd);
index c2a7b05add4cb42c4a21a0c848fa62d802d586b6..4f89923852a03c98ff8423c49316375965792eee 100644 (file)
@@ -348,7 +348,7 @@ bool epoll_ctl_add(const int fd)
         return false;
     }
 
-    printf("[START] epoll events set success for server\n");
+    LOG("[START] epoll events set success for server\n");
     return true;
 }
 
@@ -680,8 +680,11 @@ void recv_from_ij(int fd)
         return;
     }
 
-
-    if (strncmp(ijcmd.cmd, "telephony", 9) == 0)
+    if (strncmp(ijcmd.cmd, "sap", 3) == 0)
+    {
+        msgproc_sap(fd, &ijcmd, false);
+    }
+    else if (strncmp(ijcmd.cmd, "telephony", 9) == 0)
     {
         msgproc_telephony(fd, &ijcmd, false);
     }
@@ -705,10 +708,6 @@ void recv_from_ij(int fd)
     {
         msgproc_sdcard(fd, &ijcmd, false);
     }
-    else if (strncmp(ijcmd.cmd, "sap", 3) == 0)
-    {
-        msgproc_sap(fd, &ijcmd, false);
-    }
     else
     {
         LOG("Unknown packet: %s", ijcmd.cmd);
@@ -746,7 +745,11 @@ void process_evdi_command(ijcommand* ijcmd)
 {
     int fd = -1;
 
-    if (strncmp(ijcmd->cmd, "telephony", 9) == 0)
+    if (strncmp(ijcmd->cmd, "sap", 3) == 0)
+    {
+        msgproc_sap(fd, ijcmd, true);
+    }
+    else if (strncmp(ijcmd->cmd, "telephony", 9) == 0)
     {
         msgproc_telephony(fd, ijcmd, true);
     }