From 8281cfe87c62ac5dc792701ccb357da1e0c7ca2a Mon Sep 17 00:00:00 2001 From: Kim Gunsoo Date: Mon, 23 Nov 2015 15:20:53 +0900 Subject: [PATCH] Add the can_launch member to capability structure. - The can_launch member is used to determine whether to install/launch an Application for the corresponding platform in the IDE. - To obtain the can_launch information, queries the sdbd plugin. Change-Id: Ic39cc0dce2267190de2e6052172a6333a1e5882b Signed-off-by: Kim Gunsoo --- src/sdb.c | 26 +++++++++++++++++++++++--- src/sdb.h | 4 ++++ src/sdbd_plugin.h | 1 + src/services.c | 12 ++++++++++-- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/src/sdb.c b/src/sdb.c index 22d2794..f44b32d 100644 --- a/src/sdb.c +++ b/src/sdb.c @@ -1599,6 +1599,10 @@ static int get_plugin_capability(const char* in_buf, sdbd_plugin_param out) { } else { snprintf(out.data, out.len, "%s", SDBD_CAP_RET_DISABLED); } + ret = SDBD_PLUGIN_RET_SUCCESS; + } else if (SDBD_CMP_CAP(in_buf, CANLAUNCH)) { + snprintf(out.data, out.len, "%s", UNKNOWN); + ret = SDBD_PLUGIN_RET_SUCCESS; } else if (SDBD_CMP_CAP(in_buf, PLUGIN_VER)) { snprintf(out.data, out.len, "%s", UNKNOWN); ret = SDBD_PLUGIN_RET_SUCCESS; @@ -2093,6 +2097,16 @@ static void init_capabilities(void) { } + // Target name of the launch possible + if(!request_plugin_cmd(SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_CANLAUNCH, + g_capabilities.can_launch, + sizeof(g_capabilities.can_launch))) { + D("failed to request. (%s:%s) \n", SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_CANLAUNCH); + snprintf(g_capabilities.can_launch, sizeof(g_capabilities.can_launch), + "%s", UNKNOWN); + } + + // Platform version ret = system_info_get_platform_string("http://tizen.org/feature/platform.version", &value); if (ret != SYSTEM_INFO_ERROR_NONE) { @@ -2132,6 +2146,7 @@ static void init_capabilities(void) { "%s", UNKNOWN); } + // sdbd log enable if(!request_plugin_cmd(SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_LOG_ENABLE, g_capabilities.log_enable, @@ -2139,16 +2154,21 @@ static void init_capabilities(void) { D("failed to request. (%s:%s) \n", SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_LOG_ENABLE); snprintf(g_capabilities.log_enable, sizeof(g_capabilities.log_enable), "%s", DISABLED); - } + } - // sdbd log path + // sdbd log path if(!request_plugin_cmd(SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_LOG_PATH, g_capabilities.log_path, sizeof(g_capabilities.log_path))) { D("failed to request. (%s:%s) \n", SDBD_CMD_PLUGIN_CAP, SDBD_CAP_TYPE_LOG_PATH); snprintf(g_capabilities.log_path, sizeof(g_capabilities.log_path), "%s", UNKNOWN); - } + } + + + // Capability version + snprintf(g_capabilities.sdbd_cap_version, sizeof(g_capabilities.sdbd_cap_version), + "%d.%d", SDBD_CAP_VERSION_MAJOR, SDBD_CAP_VERSION_MINOR); } static int is_support_usbproto() diff --git a/src/sdb.h b/src/sdb.h index c9a9e0c..75dba43 100644 --- a/src/sdb.h +++ b/src/sdb.h @@ -247,6 +247,8 @@ typedef struct platform_info { #define CAPBUF_ITEMSIZE 32 #define CAPBUF_L_ITEMSIZE 256 #define CAPBUF_LL_ITEMSIZE PATH_MAX +#define SDBD_CAP_VERSION_MAJOR 1 +#define SDBD_CAP_VERSION_MINOR 0 typedef struct platform_capabilities { char secure_protocol[CAPBUF_ITEMSIZE]; // enabled or disabled @@ -266,11 +268,13 @@ typedef struct platform_capabilities char profile_name[CAPBUF_ITEMSIZE]; // profile name (ex. mobile) char vendor_name[CAPBUF_ITEMSIZE]; // vendor name (ex. Tizen) char sdk_toolpath[CAPBUF_L_ITEMSIZE]; // sdk tool path + char can_launch[CAPBUF_L_ITEMSIZE]; // target name char platform_version[CAPBUF_ITEMSIZE]; // platform version (ex. 2.3.0) char product_version[CAPBUF_ITEMSIZE]; // product version (ex. 1.0) char sdbd_version[CAPBUF_ITEMSIZE]; // sdbd version char sdbd_plugin_version[CAPBUF_ITEMSIZE]; // sdbd plugin version + char sdbd_cap_version[CAPBUF_ITEMSIZE]; // capability version } pcap; pcap g_capabilities; diff --git a/src/sdbd_plugin.h b/src/sdbd_plugin.h index 2d94157..dce56e1 100644 --- a/src/sdbd_plugin.h +++ b/src/sdbd_plugin.h @@ -35,6 +35,7 @@ #define SDBD_CAP_TYPE_USBPROTO "usb_protocol_support" #define SDBD_CAP_TYPE_SOCKPROTO "socket_protocol_support" #define SDBD_CAP_TYPE_ROOTONOFF "root_onoff_support" +#define SDBD_CAP_TYPE_CANLAUNCH "can_launch_target" #define SDBD_CAP_TYPE_PLUGIN_VER "sdbd_plugin_version" #define SDBD_CAP_TYPE_PRODUCT_VER "product_version" #define SDBD_CAP_TYPE_LOG_ENABLE "sdbd_log_enable" diff --git a/src/services.c b/src/services.c index bc2f35a..2fbcaa7 100644 --- a/src/services.c +++ b/src/services.c @@ -924,6 +924,10 @@ static void get_capability(int fd, void *cookie) { offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, "sockproto_support", g_capabilities.sockproto_support); + // Window size synchronization support + offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, + "syncwinsz_support", g_capabilities.syncwinsz_support); + // Root command support offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, "rootonoff_support", g_capabilities.rootonoff_support); @@ -952,6 +956,10 @@ static void get_capability(int fd, void *cookie) { offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, "vendor_name", g_capabilities.vendor_name); + // Target name of the launch possible + offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, + "can_launch", g_capabilities.can_launch); + // Platform version offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, "platform_version", g_capabilities.platform_version); @@ -968,9 +976,9 @@ static void get_capability(int fd, void *cookie) { offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, "sdbd_plugin_version", g_capabilities.sdbd_plugin_version); - // Window size synchronization support + // Capability version offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, - "syncwinsz_support", g_capabilities.syncwinsz_support); + "sdbd_cap_version", g_capabilities.sdbd_cap_version); // Sdbd log enable offset += put_key_value_string(cap_buffer, offset, CAPBUF_SIZE, -- 2.7.4