Add device control support 17/287317/1 accepted/tizen_7.0_unified tizen tizen_7.0 accepted/tizen/7.0/unified/20230127.052915
authorJaehyun Kim <jeik01.kim@samsung.com>
Thu, 26 Jan 2023 09:36:39 +0000 (18:36 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Thu, 26 Jan 2023 09:36:39 +0000 (18:36 +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 ec41354..7e20b46 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 68a66ca..20aeca8 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 48dc8c8..4037152 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 6905789..a16d1f9 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);
+}