Add device control support 38/311738/1 accepted/tizen_8.0_unified tizen_8.0 accepted/tizen/8.0/unified/20240527.164839
authorJaehyun Kim <jeik01.kim@samsung.com>
Thu, 26 Jan 2023 09:36:39 +0000 (18:36 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Mon, 27 May 2024 04:26:39 +0000 (13:26 +0900)
Change-Id: I48b1f8f7829492feeaaba5175c00a448d351a238
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
include/hal-wifi-interface.h
include/hal-wifi.h
packaging/hal-api-wifi.spec
src/hal-api-wifi.c

index ec41354f41146b3ee52cdc269bb79430e2acbeb8..7e20b469a309ea631dc3938896c61fd67f4f53e1 100644 (file)
@@ -31,6 +31,7 @@ typedef struct _hal_backend_wifi_funcs {
        int (*softap_start)(const char *ifname);
        int (*stop)(const char *ifname);
        int (*get_mac)(const char *ifname, char **mac);
+       int (*device_control)(const char *command, int argc, char *argv[]);
 } hal_backend_wifi_funcs;
 
 #ifdef __cplusplus
index 68a66ca588b250fd18922a86a70f0bb76fd892ec..20aeca89d83e60a44f311f8ad637a9a08a546bd5 100644 (file)
@@ -31,6 +31,7 @@ int hal_wifi_p2p_start(const char *ifname);
 int hal_wifi_softap_start(const char *ifname);
 int hal_wifi_stop(const char *ifname);
 int hal_wifi_get_mac(const char *ifname, char **mac);
+int hal_wifi_device_control(const char *command, int argc, char *argv[]);
 
 #ifdef __cplusplus
 }
index 48dc8c83cc8dc6310692384111da59b7179f7449..40371522ac25824ce11b28d62780104dd6e9fb0f 100644 (file)
@@ -6,7 +6,7 @@
 Name:       %{name}
 Summary:    %{name} interface
 Version:    0.0.1
-Release:    1
+Release:    2
 Group:      Development/Libraries
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
index 6905789eb3269b39f69ebafe5e49ab7870d1b7d1..a16d1f9dfa3d35cf7bd20cec77830c794dc000a2 100644 (file)
@@ -73,6 +73,10 @@ int hal_wifi_sta_start(const char *ifname)
 {
        if (!g_wifi_funcs)
                return -ENOTSUP;
+
+       if (!g_wifi_funcs->sta_start)
+               return -ENOTSUP;
+
        return g_wifi_funcs->sta_start(ifname);
 }
 
@@ -81,6 +85,10 @@ int hal_wifi_p2p_start(const char *ifname)
 {
        if (!g_wifi_funcs)
                return -ENOTSUP;
+
+       if (!g_wifi_funcs->p2p_start)
+               return -ENOTSUP;
+
        return g_wifi_funcs->p2p_start(ifname);
 }
 
@@ -89,6 +97,10 @@ int hal_wifi_softap_start(const char *ifname)
 {
        if (!g_wifi_funcs)
                return -ENOTSUP;
+
+       if (!g_wifi_funcs->softap_start)
+               return -ENOTSUP;
+
        return g_wifi_funcs->softap_start(ifname);
 }
 
@@ -97,6 +109,10 @@ int hal_wifi_stop(const char *ifname)
 {
        if (!g_wifi_funcs)
                return -ENOTSUP;
+
+       if (!g_wifi_funcs->stop)
+               return -ENOTSUP;
+
        return g_wifi_funcs->stop(ifname);
 }
 
@@ -105,5 +121,21 @@ int hal_wifi_get_mac(const char *ifname, char **mac)
 {
        if (!g_wifi_funcs)
                return -ENOTSUP;
+
+       if (!g_wifi_funcs->get_mac)
+               return -ENOTSUP;
+
        return g_wifi_funcs->get_mac(ifname, mac);
 }
+
+EXPORT
+int hal_wifi_device_control(const char *command, int argc, char *argv[])
+{
+       if (!g_wifi_funcs)
+               return -ENOTSUP;
+
+       if (!g_wifi_funcs->device_control)
+               return -ENOTSUP;
+
+       return g_wifi_funcs->device_control(command, argc, argv);
+}