free(address);
}
+static const char *mesh_plink_state_to_string(guchar plink)
+{
+ switch (plink) {
+ case 0:
+ return "LISTEN";
+ case 1:
+ return "OPN_SNT";
+ case 2:
+ return "OPN_RCVD";
+ case 3:
+ return "CNF_RCVD";
+ case 4:
+ return "ESTAB";
+ case 5:
+ return "HOLDING";
+ case 6:
+ return "BLOCKED";
+ default:
+ return "UNKNOWN";
+ }
+}
+
+static const char *power_mode_to_string(guint pm)
+{
+ switch (pm) {
+ case 1: /* NL80211_MESH_POWER_ACTIVE */
+ return "ACTIVE";
+ case 2: /* NL80211_MESH_POWER_LIGHT_SLEEP */
+ return "LIGHT SLEEP";
+ case 3: /* NL80211_MESH_POWER_DEEP_SLEEP */
+ return "DEEP SLEEP";
+ default:
+ return "UNKNOWN";
+ }
+}
+
static void found_station_cb(wifi_mesh_station_info_h station, void* user_data)
{
int ret = WIFI_MESH_ERROR_NONE;
msg("bssid = %s", bssid);
ret = wifi_mesh_get_sta_inactive_time(station, &inactive_time);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("inactive_time = %d", inactive_time);
+ msg("inactive_time = %d ms", inactive_time);
ret = wifi_mesh_get_sta_rx_bytes(station, &rx_bytes);
if (WIFI_MESH_ERROR_NONE == ret)
msg("rx_bytes = %"G_GUINT64_FORMAT, rx_bytes);
msg("rx_drop_misc = %"G_GUINT64_FORMAT, rx_drop_misc);
ret = wifi_mesh_get_sta_signal(station, &signal);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("signal = %d", signal);
+ msg("signal = %d dBm", signal);
ret = wifi_mesh_get_sta_signal_avg(station, &signal_avg);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("signal_avg = %d", signal_avg);
+ msg("signal_avg = %d dBm", signal_avg);
ret = wifi_mesh_get_sta_tx_bitrate(station, &tx_bitrate);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("inactive_time = %d", inactive_time);
+ msg("tx_bitrate = %d.%d MBit/s", tx_bitrate / 10, tx_bitrate % 10);
ret = wifi_mesh_get_sta_rx_bitrate(station, &rx_bitrate);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("tx_bitrate = %d", tx_bitrate);
+ msg("rx_bitrate = %d.%d MBit/s", rx_bitrate / 10, rx_bitrate % 10);
ret = wifi_mesh_get_sta_mesh_llid(station, &mesh_llid);
if (WIFI_MESH_ERROR_NONE == ret)
msg("mesh_llid = %d", mesh_llid);
msg("mesh_plid = %d", mesh_plid);
ret = wifi_mesh_get_sta_mesh_plink(station, &mesh_plink);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("inactive_time = %d", inactive_time);
+ msg("mesh_plink = %s", mesh_plink_state_to_string(mesh_plink));
ret = wifi_mesh_get_sta_local_ps_mode(station, &local_ps_mode);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("inactive_time = %d", inactive_time);
+ msg("local_ps_mode = %s", power_mode_to_string(local_ps_mode));
ret = wifi_mesh_get_sta_peer_ps_mode(station, &peer_ps_mode);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("local_ps_mode = %d", local_ps_mode);
+ msg("peer_ps_mode = %s", power_mode_to_string(peer_ps_mode));
ret = wifi_mesh_get_sta_non_peer_ps_mode(station, &non_peer_ps_mode);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("local_ps_mode = %d", local_ps_mode);
+ msg("non_peer_ps_mode = %s", power_mode_to_string(non_peer_ps_mode));
ret = wifi_mesh_get_sta_authorized(station, &authorized);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("authorized = %d", authorized);
+ msg("authorized = %s", authorized ? "yes" : "no");
ret = wifi_mesh_get_sta_authenticated(station, &authenticated);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("authenticated = %d", authenticated);
+ msg("authenticated = %s", authenticated ? "yes" : "no");
ret = wifi_mesh_get_sta_associated(station, &associated);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("associated = %d", associated);
+ msg("associated = %s", associated ? "yes" : "no");
ret = wifi_mesh_get_sta_preamble(station, &preamble);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("preamble = %d", preamble);
+ msg("preamble = %s", preamble ? "short" : "long");
ret = wifi_mesh_get_sta_wmm_wme(station, &wmm_wme);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("wmm_wme = %d", wmm_wme);
+ msg("wmm_wme = %s", wmm_wme ? "yes" : "no");
ret = wifi_mesh_get_sta_mfp(station, &mfp);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("wmm_wme = %d", wmm_wme);
+ msg("mfp = %s", mfp ? "yes" : "no");
ret = wifi_mesh_get_sta_tdls_peer(station, &tdls_peer);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("tdls_peer = %d", tdls_peer);
+ msg("tdls_peer = %s", tdls_peer ? "yes" : "no");
ret = wifi_mesh_get_sta_dtim_period(station, &dtim_period);
if (WIFI_MESH_ERROR_NONE == ret)
msg("dtim_period = %d", dtim_period);
msg("short_preamble = %d", short_preamble);
ret = wifi_mesh_get_sta_short_slot_time(station, &short_slot_time);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("short_slot_time = %d", short_slot_time);
+ msg("short_slot_time = %s", short_slot_time ? "yes" : "no");
ret = wifi_mesh_get_sta_connected_time(station, &connected_time);
if (WIFI_MESH_ERROR_NONE == ret)
- msg("connected_time = %d", connected_time);
+ msg("connected_time = %d seconds", connected_time);
}