* @since_tizen 4.0
*
* @param[in] handle The Wi-Fi mesh handle
+ * @param[in] sta_type Type of Station
* @param[in] cb The callback function to receive station information
* @param[in] user_data User data
*
* @see mesh_get_path_info()
*
*/
-int wifi_mesh_get_stations_info(wifi_mesh_h handle, wifi_mesh_found_station_cb cb,
+int wifi_mesh_get_stations_info(wifi_mesh_h handle,
+ wifi_mesh_station_type_e sta_type, wifi_mesh_found_station_cb cb,
void *user_data);
/**
int _mesh_disconnect_network(wifi_mesh_h handle, wifi_mesh_network_h _network);
int _mesh_forget_network(wifi_mesh_h handle, wifi_mesh_network_h _network);
int _mesh_set_interface(wifi_mesh_h handle, const char *mesh, const char *gate, const char *softap);
-int _wifi_mesh_get_stations_info(wifi_mesh_h handle, wifi_mesh_found_station_cb cb, void *user_data);
+int _wifi_mesh_get_stations_info(wifi_mesh_h handle,
+ wifi_mesh_station_type_e sta_type, wifi_mesh_found_station_cb cb,
+ void *user_data);
int _wifi_mesh_get_mpath_info(wifi_mesh_h handle, mesh_found_mpath_cb cb, void *user_data);
int _wifi_mesh_set_interfaces(wifi_mesh_h handle, const char *mesh, const char *gate, const char *softap);
int _wifi_mesh_get_meshconf_info(wifi_mesh_h handle,
};
struct mesh_station_info_s {
+ wifi_mesh_station_type_e sta_type; /* Type of Station */
gchar bssid[MAX_BSSID_LEN]; /* station bssid ex) 7c:dd:90:62:37:cf (on mesh0) */
guint inactive_time; /**< inactive time ex) 1685 ms */
guint64 rx_bytes; /**< rx bytes ex) 34174 */
return result;
}
-int _wifi_mesh_get_stations_info(wifi_mesh_h handle, wifi_mesh_found_station_cb cb, void *user_data)
+int _wifi_mesh_get_stations_info(wifi_mesh_h handle,
+ wifi_mesh_station_type_e sta_type, wifi_mesh_found_station_cb cb,
+ void *user_data)
{
GVariant *variant = NULL;
int result = WIFI_MESH_ERROR_NONE;
}
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "get_station_info",
- NULL,
+ g_variant_new("(i)", sta_type),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL, &error);
struct mesh_station_info_s station;
memset(&station, 0, sizeof(struct mesh_station_info_s));
/* LCOV_EXCL_START */
+ station.sta_type = sta_type;
while (g_variant_iter_loop(iter_row, "{sv}", &key, &val)) {
if (strcasecmp(key, "bssid") == 0) {
const char *buf = g_variant_get_string(val, &len);
}
EXPORT_API int wifi_mesh_get_stations_info(wifi_mesh_h handle,
- wifi_mesh_found_station_cb cb, void *user_data)
+ wifi_mesh_station_type_e sta_type, wifi_mesh_found_station_cb cb,
+ void *user_data)
{
int rv = 0;
CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
/* LCOV_EXCL_STOP */
}
- rv = _wifi_mesh_get_stations_info(handle, cb, user_data);
+ switch (sta_type) {
+ case MESH_STATION_TYPE_MESH_POINT:
+ case MESH_STATION_TYPE_SOFTAP:
+ rv = _wifi_mesh_get_stations_info(handle, sta_type, cb, user_data);
+ break;
+ default:
+ LOGE("Invalid Station Type");
+ return WIFI_MESH_ERROR_INVALID_PARAMETER;
+ }
return rv;
}
gboolean short_slot_time; /**< short slot time supported ex) yes */
guint connected_time; /**< connected time : ex) 256 seconds */
- msgp("[%d] tation Information Received", g_idx++);
+ msgp("[%d] Station Information Received", g_idx++);
if (NULL == station)
return;
g_idx = 1;
- ret = wifi_mesh_get_stations_info(mesh, found_station_cb, NULL);
+ ret = wifi_mesh_get_stations_info(mesh, MESH_STATION_TYPE_MESH_POINT,
+ found_station_cb, NULL);
if (WIFI_MESH_ERROR_NONE != ret) {
msgr("Failed to wifi_mesh_get_stations_info: [%s(0x%X)]",
wifi_mesh_error_to_string(ret), ret);
return RET_SUCCESS;
}
+static int run_get_softap_station_info(MManager *mm, struct menu_data *menu)
+{
+ int ret;
+ msg("Get SoftAP Station Information");
+
+ g_idx = 1;
+
+ ret = wifi_mesh_get_stations_info(mesh, MESH_STATION_TYPE_SOFTAP,
+ found_station_cb, NULL);
+ if (WIFI_MESH_ERROR_NONE != ret) {
+ msgr("Failed to wifi_mesh_get_stations_info: [%s(0x%X)]",
+ wifi_mesh_error_to_string(ret), ret);
+ return RET_FAILURE;
+ }
+ msg(" - wifi_mesh_get_stations_info() ret: [0x%X] [%s]",
+ ret, wifi_mesh_error_to_string(ret));
+
+ return RET_SUCCESS;
+}
+
static struct menu_data menu_specific_scan[] = {
{ "1", "Mesh ID", NULL, NULL, meshid },
{ "2", "Channel", NULL, NULL, mesh_channel },
{ "19", "Get mesh path information", NULL, run_get_mpath_information, NULL },
{ "20", "Get mesh conf information", NULL, run_get_meshconf_information,
NULL },
+ { "21", "Get softap station information", NULL, run_get_softap_station_info,
+ NULL },
{ NULL, NULL, },
};