return NET_STATE_TYPE_UNKNOWN;
}
+net_ip_config_type_t _get_ip_config_type(const char *config)
+{
+ net_ip_config_type_t config_type;
+
+ if (!g_strcmp0(config, "manual"))
+ config_type = NET_IP_CONFIG_TYPE_STATIC;
+ else if (!g_strcmp0(config, "dhcp"))
+ config_type = NET_IP_CONFIG_TYPE_AUTO_IP;
+ else if (!g_strcmp0(config, "fixed"))
+ config_type = NET_IP_CONFIG_TYPE_FIXED;
+ else if (!g_strcmp0(config, "off"))
+ config_type = NET_IP_CONFIG_TYPE_OFF;
+ else
+ config_type = NET_IP_CONFIG_TYPE_DYNAMIC;
+
+ return config_type;
+}
+
const char *_get_ip_config_str(net_ip_config_type_t ip_config_type)
{
switch (ip_config_type) {
}
struct connman_service *service = ap;
+ if (!service)
+ return NET_ERR_INVALID_PARAM;
+
*essid = g_strdup(connman_service_get_name(service));
if (*essid == NULL)
return WIFI_ERROR_OUT_OF_MEMORY;
if (*bssid == NULL)
return WIFI_ERROR_OUT_OF_MEMORY;*/
+ struct connman_service *service = ap;
+ if (!service)
+ return NET_ERR_INVALID_PARAM;
+
+ *bssid = g_strdup(connman_service_get_bssid(service));
+ if (*bssid == NULL)
+ return WIFI_ERROR_OUT_OF_MEMORY;
+
return WIFI_ERROR_NONE;
}
/* net_profile_info_t *profile_info = ap;
*rssi = (int)profile_info->ProfileInfo.Wlan.Strength;*/
+ struct connman_service *service = ap;
+ if (!service)
+ return NET_ERR_INVALID_PARAM;
+
+ *rssi = connman_service_get_strength(service);
+
return WIFI_ERROR_NONE;
}
/* net_profile_info_t *profile_info = ap;
*frequency = (int)profile_info->ProfileInfo.Wlan.frequency;*/
+ struct connman_service *service = ap;
+ if (!service)
+ return NET_ERR_INVALID_PARAM;
+
+ *frequency = connman_service_get_frequency(service);
+
return WIFI_ERROR_NONE;
}
/* net_profile_info_t *profile_info = ap;
*max_speed = (int)profile_info->ProfileInfo.Wlan.max_rate / 1000000;*/
+ struct connman_service *service = ap;
+ if (!service)
+ return NET_ERR_INVALID_PARAM;
+
+ *max_speed = connman_service_get_max_rate(service);
+
return WIFI_ERROR_NONE;
}
else
*favorite = false;*/
+ struct connman_service *service = ap;
+ if (!service)
+ return NET_ERR_INVALID_PARAM;
+
+ *favorite = connman_service_get_favorite(service);
+
return WIFI_ERROR_NONE;
}
return WIFI_ERROR_OPERATION_FAILED;
}*/
+ const struct service_ipv4 *ipv4_config;
+ struct connman_service *service = ap;
+ if (!service)
+ return NET_ERR_INVALID_PARAM;
+
+ ipv4_config = connman_service_get_ipv4_config(service);
+
+ switch (_get_ip_config_type(ipv4_config->method)) {
+ case NET_IP_CONFIG_TYPE_STATIC:
+ *type = WIFI_IP_CONFIG_TYPE_STATIC;
+ break;
+ case NET_IP_CONFIG_TYPE_DYNAMIC:
+ *type = WIFI_IP_CONFIG_TYPE_DYNAMIC;
+ break;
+ case NET_IP_CONFIG_TYPE_AUTO_IP:
+ *type = WIFI_IP_CONFIG_TYPE_AUTO;
+ break;
+ case NET_IP_CONFIG_TYPE_FIXED:
+ *type = WIFI_IP_CONFIG_TYPE_FIXED;
+ break;
+ case NET_IP_CONFIG_TYPE_OFF:
+ *type = WIFI_IP_CONFIG_TYPE_NONE;
+ break;
+ default:
+ return WIFI_ERROR_OPERATION_FAILED;
+ }
+
return WIFI_ERROR_NONE;
}
*ip_address = __ap_convert_ip_to_string(&profile_info->ProfileInfo.Wlan.net_info.IpAddr);
if (*ip_address == NULL)
return WIFI_ERROR_OUT_OF_MEMORY;*/
+ const struct service_ipv4 *ipv4;
+ struct connman_service *service = ap;
+ if (!service)
+ return NET_ERR_INVALID_PARAM;
+
+ ipv4 = connman_service_get_ipv4_info(service);
+ *ip_address = ipv4->address;
+ if (*ip_address == NULL)
+ return WIFI_ERROR_OUT_OF_MEMORY;
return WIFI_ERROR_NONE;
}
if (*subnet_mask == NULL)
return WIFI_ERROR_OUT_OF_MEMORY;*/
+ const struct service_ipv4 *ipv4;
+ struct connman_service *service = ap;
+ if (!service)
+ return NET_ERR_INVALID_PARAM;
+
+ ipv4 = connman_service_get_ipv4_info(service);
+ *subnet_mask = ipv4->netmask;
+ if (*subnet_mask == NULL)
+ return WIFI_ERROR_OUT_OF_MEMORY;
+
return WIFI_ERROR_NONE;
}
if (*gateway_address == NULL)
return WIFI_ERROR_OUT_OF_MEMORY;*/
+ const struct service_ipv4 *ipv4;
+ struct connman_service *service = ap;
+ if (!service)
+ return NET_ERR_INVALID_PARAM;
+
+ ipv4 = connman_service_get_ipv4_info(service);
+ *gateway_address = ipv4->gateway;
+ if (*gateway_address == NULL)
+ return WIFI_ERROR_OUT_OF_MEMORY;
+
return WIFI_ERROR_NONE;
}