} __tethering_cbs;
tethering_h th = NULL;
+tethering_h th5 = NULL;
static bool __is_err(tethering_error_e ret)
{
printf("Tethering create is failed\n");
return -1;
}
+
+ ret = tethering_create(&th5);
+
+ if (__is_err(ret) == false) __register_cbs(th5, &cbs, NULL);
+ else {
+ printf("Tethering create is failed\n");
+ return -1;
+ }
printf("Tethering create and register callback success\n");
return 1;
int ret = TETHERING_ERROR_NONE;
tethering_type_e type;
int address_type = 0;
+ int freq = 0;
+
+ printf("Choose tethering handle ( 0 : 2.4GHz , 1 : 5.0GHz ) \n ");
+ ret = scanf("%d", &freq);
+
+ tethering_h handle = freq ? th5 : th;
printf("IPv4: 0, IPv6: 1\n");
ret = scanf("%d", &address_type);
}
if (address_type)
- ret = tethering_ipv6_enable(th, type);
+ ret = tethering_ipv6_enable(handle, type);
else
- ret = tethering_enable(th, type);
+ ret = tethering_enable(handle, type);
if (__is_err(ret) == true) {
printf("Fail to enable tethering\n");
int ret = TETHERING_ERROR_NONE;
tethering_type_e type;
int address_type = 0;
+ int freq = 0;
+
+ printf("Choose tethering handle ( 0 : 2.4GHz , 1 : 5.0GHz ) \n ");
+ ret = scanf("%d", &freq);
+
+ tethering_h handle = freq ? th5 : th;
printf("IPv4: 0, IPv6: 1\n");
ret = scanf("%d", &address_type);
return -1;
if (address_type)
- ret = tethering_ipv6_disable(th, type);
+ ret = tethering_ipv6_disable(handle, type);
else
- ret = tethering_disable(th, type);
+ ret = tethering_disable(handle, type);
if (__is_err(ret) == true) {
printf("Fail to disable tethering\n");
{
int ret;
tethering_type_e type;
+ int freq = 0;
+
+ printf("Choose tethering handle ( 0 : 2.4GHz , 1 : 5.0GHz ) \n ");
+ ret = scanf("%d", &freq);
+
+ tethering_h handle = freq ? th5 : th;
if (!__get_tethering_type(&type))
return -1;
- ret = tethering_foreach_connected_clients(th, type,
+ ret = tethering_foreach_connected_clients(handle, type,
__clients_foreach_cb, NULL);
if (__is_err(ret) == true) {
printf("Fail to disable tethering\n");
static int test_tethering_get_interface_info(void)
{
tethering_type_e type;
+ int freq = 0;
+ int ret;
+ printf("Choose tethering handle ( 0 : 2.4GHz , 1 : 5.0GHz ) \n ");
+ ret = scanf("%d", &freq);
+
+ tethering_h handle = freq ? th5 : th;
if (!__get_tethering_type(&type))
return -1;
- __print_interface_info(th, type);
-
- return 1;
+ __print_interface_info(handle, type);
+ ret = 1;
+ return ret;
}
static int test_tethering_get_data_usage(void)
static int test_tethering_wifi_get_setting(void)
{
- __print_wifi_tethering_setting(th);
- return 1;
+ int ret;
+ int freq = 0;
+ printf("Choose tethering handle ( 0 : 2.4GHz , 1 : 5.0GHz ) \n ");
+ ret = scanf("%d", &freq);
+
+ tethering_h handle = freq ? th5 : th;
+ __print_wifi_tethering_setting(handle);
+ ret = 1;
+ return ret;
}
static int test_tethering_wifi_set_ssid(void)
{
int ret;
char ssid[100] = {0, };
+ int freq = 0;
+ printf("Choose tethering handle ( 0 : 2.4GHz , 1 : 5.0GHz ) \n ");
+ ret = scanf("%d", &freq);
+
+ tethering_h handle = freq ? th5 : th;
if (test_get_user_string("Input SSID for Wi-Fi tethering:",
ssid, 100) == false) {
return -1;
}
- ret = tethering_wifi_set_ssid(th, ssid);
+ ret = tethering_wifi_set_ssid(handle, ssid);
if (__is_err(ret) == true) {
printf("Fail to set wifi ssid!!\n");
return -1;
{
int ret;
int security_type;
+ int freq = 0;
+ printf("Choose tethering handle ( 0 : 2.4GHz , 1 : 5.0GHz ) \n ");
+ ret = scanf("%d", &freq);
+
+ tethering_h handle = freq ? th5 : th;
printf("Input security type for Wi-Fi tethering (0:NONE, 1:WPA2_PSK, 2:WPS, 3:SAE)");
ret = scanf("%9d", &security_type);
if (ret < 0) {
return -1;
}
- ret = tethering_wifi_set_security_type(th, security_type);
+ ret = tethering_wifi_set_security_type(handle, security_type);
if (__is_err(ret) == true) {
printf("Fail to set security type!!\n");
return -1;
{
int ret;
int visibility;
+ int freq = 0;
+
+ printf("Choose tethering handle ( 0 : 2.4GHz , 1 : 5.0GHz ) \n ");
+ ret = scanf("%d", &freq);
+
+ tethering_h handle = freq ? th5 : th;
printf("Input security type for Wi-Fi tethering (0:invisible, 1:visible)");
ret = scanf("%9d", &visibility);
return -1;
}
- ret = tethering_wifi_set_ssid_visibility(th, visibility);
+ ret = tethering_wifi_set_ssid_visibility(handle, visibility);
if (__is_err(ret) == true) {
printf("Fail to set visibility!!\n");
return -1;
{
int ret;
char passphrase[100] = {0, };
+ int freq = 0;
+ printf("Choose tethering handle ( 0 : 2.4GHz , 1 : 5.0GHz ) \n ");
+ ret = scanf("%d", &freq);
+
+ tethering_h handle = freq ? th5 : th;
if (test_get_user_string("Input passphrase for Wi-Fi tethering:",
passphrase, 100) == false) {
return -1;
}
- ret = tethering_wifi_set_passphrase(th, passphrase);
+ ret = tethering_wifi_set_passphrase(handle, passphrase);
if (__is_err(ret) == true) {
printf("Fail to set passphrase!!\n");
return -1;
{
int ret;
int channel;
+ int freq = 0;
+ printf("Choose tethering handle ( 0 : 2.4GHz , 1 : 5.0GHz ) \n ");
+ ret = scanf("%d", &freq);
+
+ tethering_h handle = freq ? th5 : th;
printf("Input channel for Wi-Fi tethering: ");
ret = scanf("%d", &channel);
- ret = tethering_wifi_set_channel(th, channel);
+ ret = tethering_wifi_set_channel(handle, channel);
if (__is_err(ret) == true) {
printf("Fail to set channel!!\n");
return -1;
{
int ret;
int type;
+ int freq = 0;
+ printf("Choose tethering handle ( 0 : 2.4GHz , 1 : 5.0GHz ) \n ");
+ ret = scanf("%d", &freq);
+
+ tethering_h handle = freq ? th5 : th;
printf("Input hw_mode for Wi-Fi tethering(0-b, 1-g, 2-a, 3-ad): ");
ret = scanf("%d", &type);
- ret = tethering_wifi_set_mode(th, type);
+ ret = tethering_wifi_set_mode(handle, type);
if (__is_err(ret) == true) {
printf("Fail to set mode!!\n");
return -1;
return 1;
}
+static int test_tethering_wifi_is_dualband_supported(void)
+{
+ return 1;
+}
+
int main(int argc, char **argv)
{
GMainLoop *mainloop;
printf("F - Set vpn passthrough rule\n");
printf("G - Push WPS button\n");
printf("H - Set WPS PIN\n");
+ printf("I - Is Wi-Fi dualband supported \n");
+ printf("J - Set Wi-Fi dualband \n");
printf("0 - \n");
printf("ENTER - Show options menu.......\n");
}
case 'H':
rv = test_tethering_wifi_set_wps_pin();
break;
+ case 'I':
+ rv = test_tethering_wifi_is_dualband_supported();
+ break;
}
if (rv == 1)