extern struct notification_handler_t notification_handler;
void _init_notification_handler(void);
void _deinit_notification_handler(void);
+
+int _create_timeout_noti(mobile_ap_type_e type);
+int _create_connected_noti(mobile_ap_type_e type, int count);
+int _update_connected_noti(mobile_ap_type_e type, int count);
+int _delete_connected_noti(void);
+void _create_security_restriction_noti(mobile_ap_type_e type);
#endif
mobile_ap_address_type_e address_type;
uint32_t ip_addr;
+ int txpower;
} softap_settings_t;
typedef struct {
mobile_ap_error_code_e _reload_softap_settings(Tethering *obj, softap_settings_t *settings);
gboolean tethering_enable_wifi_tethering(Tethering *obj,
- GDBusMethodInvocation *context,
- gchar *ssid, gchar *key, gchar* mode, gint channel, gint visibility,
- gint mac_filter, gint max_sta, gint security_type, gint address_type);
+ GDBusMethodInvocation *context, gchar *ssid,
+ gchar *key, gchar *mode, gint channel, gint visibility,
+ gint mac_filter, gint max_sta, gint security_type,
+ gint txpower, gint address_type);
/* Soft AP */
softap_settings_t *_get_softap_settings();
GDBusMethodInvocation *context, gint address_type);
gboolean tethering_reload_wifi_settings(Tethering *obj,
- GDBusMethodInvocation *context,
- gchar *ssid, gchar *key, gchar* mode, gint channel, gint visibility,
- gint mac_filter, gint max_sta, gint security_type);
+ GDBusMethodInvocation *context, gchar *ssid,
+ gchar *key, gchar *mode, gint channel, gint visibility,
+ gint mac_filter, gint max_sta, gint security_type,
+ gint txpower);
gboolean tethering_get_wifi_tethering_passphrase(Tethering *obj,
GDBusMethodInvocation *context);
<arg type="i" name="mac_filter" direction="in"/>
<arg type="i" name="max_sta" direction="in"/>
<arg type="i" name="security" direction="in"/>
+ <arg type="i" name="txpower" direction="in"/>
<arg type="i" name="address_type" direction="in"/>
<arg type="u" name="result" direction="out"/>
</method>
<arg type="i" name="mac_filter" direction="in"/>
<arg type="i" name="max_sta" direction="in"/>
<arg type="i" name="security" direction="in"/>
+ <arg type="i" name="txpower" direction="in"/>
<arg type="u" name="result" direction="out"/>
</method>
Name: mobileap-agent
Summary: Mobile AP daemon for setting tethering environments
-Version: 1.0.136
+Version: 1.0.137
Release: 1
Group: System/Network
License: Apache-2.0
return MOBILE_AP_ERROR_NONE;
}
-static int _create_timeout_noti(mobile_ap_type_e type)
+int _create_timeout_noti(mobile_ap_type_e type)
{
DBG("+\n");
return MOBILE_AP_ERROR_NONE;
}
-static int _create_connected_noti(mobile_ap_type_e type, int count)
+int _create_connected_noti(mobile_ap_type_e type, int count)
{
DBG("+\n");
notification_h noti = NULL;
return MOBILE_AP_ERROR_INTERNAL;
}
-static int _update_connected_noti(mobile_ap_type_e type, int count)
+int _update_connected_noti(mobile_ap_type_e type, int count)
{
DBG("+\n");
return MOBILE_AP_ERROR_INTERNAL;
}
-static int _delete_connected_noti(void)
+int _delete_connected_noti(void)
{
DBG("+\n");
notification_h noti = NULL;
return;
}
-static void _create_security_restriction_noti(mobile_ap_type_e type)
+void _create_security_restriction_noti(mobile_ap_type_e type)
{
bundle *b = NULL;
char restricted_type[MAX_BUF_SIZE] = {0, };
static guint wifi_recovery_timeout_id = 0;
static gboolean prev_wifi_on = FALSE;
static gboolean is_softap = FALSE;
-static softap_settings_t wifi_settings = {"", "", "", "", 0, 0, 0, 0, 0, 0, 0};
-static softap_settings_t wifi_ap_settings = {"", "", "", "", 0, 0, 0, MOBILE_AP_MAX_WIFI_STA, 0, 0, 0};
-static softap_settings_t obj_softap_settings = {"", "", "", "", 0, 0, 0, 0, 0, 0, 0};
+static softap_settings_t wifi_settings = {"", "", "", "", 0, 0, 0, 0, 0, 0, 0, 0};
+static softap_settings_t wifi_ap_settings = {"", "", "", "", 0, 0, 0, MOBILE_AP_MAX_WIFI_STA, 0, 0, 0, 0};
+static softap_settings_t obj_softap_settings = {"", "", "", "", 0, 0, 0, 0, 0, 0, 0, 0};
static wifi_manager_h wifi_manager = NULL;
dst->max_sta = src->max_sta;
dst->address_type = src->address_type;
dst->ip_addr = src->ip_addr;
+ dst->txpower = src->txpower;
- SDBG("ssid : %s security type : %d ip address: 0x%X hide mode : %d mac filter : %d max_sta: %d hw_mode: %s vendor: %s \n",
- dst->ssid, dst->security_type, dst->ip_addr, dst->hide_mode, dst->mac_filter, dst->max_sta, dst->mode, dst->vendor_elements);
+ SDBG("ssid : %s security type : %d ip address: 0x%X hide mode : %d mac filter : %d max_sta: %d hw_mode: %s vendor: %s txpower: %d\n",
+ dst->ssid, dst->security_type, dst->ip_addr, dst->hide_mode, dst->mac_filter, dst->max_sta, dst->mode, dst->vendor_elements, dst->txpower);
return MOBILE_AP_ERROR_NONE;
}
if (a->ip_addr != b->ip_addr)
return FALSE;
+ if (a->txpower != b->txpower)
+ return FALSE;
+
return TRUE;
}
gboolean tethering_enable_wifi_tethering(Tethering *obj,
GDBusMethodInvocation *context, gchar *ssid,
- gchar *key, gchar *mode, gint channel, gint visibility, gint mac_filter, gint max_sta, gint security_type, gint address_type)
+ gchar *key, gchar *mode, gint channel, gint visibility,
+ gint mac_filter, gint max_sta, gint security_type,
+ gint txpower, gint address_type)
{
DBG("+\n");
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
wifi_settings.mac_filter = mac_filter;
wifi_settings.max_sta = max_sta;
wifi_settings.address_type = address_type;
+ wifi_settings.txpower = txpower;
if (wifi_recovery_timeout_id) {
DBG("Wi-Fi recovery is cancelled\n"); //LCOV_EXCL_LINE
gboolean tethering_reload_wifi_settings(Tethering *obj,
GDBusMethodInvocation *context, gchar *ssid,
- gchar *key, gchar *mode, gint channel, gint visibility, gint mac_filter, gint max_sta, gint security_type)
+ gchar *key, gchar *mode, gint channel, gint visibility,
+ gint mac_filter, gint max_sta, gint security_type,
+ gint txpower)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
softap_settings_t settings = {0, };
g_strlcpy(settings.vendor_elements, "", sizeof(settings.vendor_elements));
+ settings.txpower = txpower;
+
ret = _reload_softap_settings(obj, &settings);
if (ret != MOBILE_AP_ERROR_NONE)
ERR("_reload_softap_settings is failed\n"); //LCOV_EXCL_LINE
}
TEST_F(MobileAP, mobileap_agent_test_usb_tethering_enable_disable_p) {
- int ret = tethering_enable_usb_tethering(obj, NULL);
+ int ret = tethering_enable_usb_tethering(obj, NULL, MOBILE_AP_ADDRESS_TYPE_IPV4);
EXPECT_EQ(ret, TRUE);
- ret = tethering_disable_usb_tethering(obj, NULL);
+ ret = tethering_disable_usb_tethering(obj, NULL, MOBILE_AP_ADDRESS_TYPE_IPV4);
EXPECT_EQ(ret, TRUE);
}
int ret = 0;
/* SSID Length: 0 */
- ret = tethering_enable_wifi_tethering(obj, NULL, "", "password", "g", 6, 1, 0, 10, 1, 0);
+ ret = tethering_enable_wifi_tethering(obj, NULL, "", "password", "g", 6, 1, 0, 10, 1, 0, 100);
EXPECT_EQ(ret, FALSE);
/* Security Type: WPA2_PSK, Password Length: 0 */
- ret = tethering_enable_wifi_tethering(obj, NULL, "test", "", "g", 6, 1, 0, 10, 1, 0);
+ ret = tethering_enable_wifi_tethering(obj, NULL, "test", "", "g", 6, 1, 0, 10, 1, 0, 100);
EXPECT_EQ(ret, FALSE);
/* Invalid address type */
- ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 3);
+ ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 3, 100);
EXPECT_EQ(ret, FALSE);
ret = tethering_disable_wifi_tethering(obj, NULL, MOBILE_AP_ADDRESS_TYPE_IPV4);
}
TEST_F(MobileAP, mobileap_agent_test_enable_reload_disable_wifi_tethering_p) {
- int ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 0);
+ int ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 0, 100);
run_gmain_loop(2000);
EXPECT_EQ(ret, TRUE);
- ret = tethering_reload_wifi_settings(obj, NULL, "test", "password", "g", 11, 1, 0, 10, 1);
+ ret = tethering_reload_wifi_settings(obj, NULL, "test", "password", "g", 11, 1, 0, 10, 1, 100);
run_gmain_loop(3000);
EXPECT_EQ(ret, TRUE);
}
TEST_F(MobileAP, mobileap_agent_test_get_data_packet_usage_p) {
- int ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 0);
+ int ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 0, 100);
run_gmain_loop(2000);
EXPECT_EQ(ret, TRUE);
}
TEST_F(MobileAP, mobileap_agent_test_set_mtu_p) {
- int ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 0);
+ int ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 0, 100);
run_gmain_loop(2000);
EXPECT_EQ(ret, TRUE);
}
TEST_F(MobileAP, mobileap_agent_test_wps_p) {
- int ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 0);
+ int ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 0, 100);
run_gmain_loop(2000);
EXPECT_EQ(ret, TRUE);
}
TEST_F(MobileAP, mobileap_agent_test_enable_disable_wifi_ipv6_tethering_p) {
- int ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 1);
+ int ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 1, 100);
run_gmain_loop(2000);
EXPECT_EQ(ret, TRUE);
run_gmain_loop(2000);
EXPECT_EQ(ret, TRUE);
- ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 1);
+ ret = tethering_enable_wifi_tethering(obj, NULL, "test", "password", "g", 6, 1, 0, 10, 1, 1, 100);
run_gmain_loop(4000);
EXPECT_EQ(ret, TRUE);