Based on a patch by Felicitus.
};
cfg_opt_t wireless_opts[] = {
- CFG_STR("format_up", "W: (%quality at %essid) %ip", CFGF_NONE),
+ CFG_STR("format_up", "W: (%quality at %essid, %bitrate) %ip", CFGF_NONE),
CFG_STR("format_down", "W: down", CFGF_NONE),
CFG_END()
};
order += "time"
wireless wlan0 {
- format_up = "W: (%quality at %essid) %ip"
+ format_up = "W: (%quality at %essid, %bitrate) %ip"
format_down = "W: down"
}
*Example order*: +wireless wlan0+
-*Example format*: +W: (%quality at %essid) %ip+
+*Example format*: +W: (%quality at %essid, %bitrate) %ip+
=== Ethernet
int signal_level_max;
int noise_level;
int noise_level_max;
+ int bitrate;
} wireless_info_t;
static int get_wireless_info(const char *interface, wireless_info_t *info) {
}
}
+ struct iwreq wrq;
+ if (iw_get_ext(skfd, interface, SIOCGIWRATE, &wrq) >= 0)
+ info->bitrate = wrq.u.bitrate.value;
+
close(skfd);
return 1;
#endif
else (void)printf("no IP");
walk += strlen("ip");
}
+
+ if (BEGINS_WITH(walk+1, "bitrate")) {
+ char buffer[128];
+
+ iw_print_bitrate(buffer, sizeof(buffer), info.bitrate);
+
+ printf("%s", buffer);
+ walk += strlen("bitrate");
+ }
}
(void)printf("%s", endcolor());