wifi ap file

Change-Id: I80c20b72980a422bda8d7de8abb2e41161693033
diff --git a/mbtk/include/mbtk/mbtk_wifi_ap.h b/mbtk/include/mbtk/mbtk_wifi_ap.h
index da0e43c..8b89613 100644
--- a/mbtk/include/mbtk/mbtk_wifi_ap.h
+++ b/mbtk/include/mbtk/mbtk_wifi_ap.h
@@ -9,6 +9,10 @@
 #define SETTING_KEY_MAX_LEN		64				

 #define SETTING_VALUE_MAX_LEN		190 

 #define SETTING_SPLIT_CHAR		'='	

+#define ACL_DENY_FILE "/etc/wifi/hostapd.deny"

+#define ACL_ACCEPT_FILE "/etc/wifi/hostapd.accept"

+

+

 

 

 

@@ -16,5 +20,9 @@
 int mbtk_wifi_set_setting(const char *path, const char *key, const char *value);

 int mbtk_wifi_ap_start(void);

 int mbtk_wifi_ap_stop(void);

+int mbtk_wifi_set_file(const char *path, const char *value);

+int mbtk_wifi_get_file(const char *path, char *value, int value_max_len);

+

+

 

 

diff --git a/mbtk/libmbtk_lib/wifi/mbtk_wifi_ap.c b/mbtk/libmbtk_lib/wifi/mbtk_wifi_ap.c
index 6cd1463..74e1c16 100644
--- a/mbtk/libmbtk_lib/wifi/mbtk_wifi_ap.c
+++ b/mbtk/libmbtk_lib/wifi/mbtk_wifi_ap.c
@@ -252,4 +252,43 @@
 

 }

 

+int mbtk_wifi_set_file(const char *path, const char *value)

+{

+    FILE *file;

+    

+    file = fopen(path, "w");

+    if (!file) 

+    {

+        return -1;

+    }

+

+    fputs(value, file);

+

+

+    fclose(file);

+    return 0;

+}

+

+int mbtk_wifi_get_file(const char *path, char *value, int value_max_len)

+{

+    FILE *file;

+    

+    file = fopen(path, "r");

+    if (!file) 

+    {

+        return -1;

+    }

+

+    if(NULL == fgets(value, value_max_len, file))

+    {

+        fclose(file);

+        return -1;

+    }

+

+

+    fclose(file);

+    return 0;

+}

+

+