mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-16 01:57:09 +00:00
Add support for $wireless_freq
This commit is contained in:
parent
7b9d69950c
commit
99fc975780
@ -4179,6 +4179,16 @@
|
|||||||
<listitem>Wireless access point ESSID (Linux only)
|
<listitem>Wireless access point ESSID (Linux only)
|
||||||
<para /></listitem>
|
<para /></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<command>
|
||||||
|
<option>wireless_freq</option>
|
||||||
|
</command>
|
||||||
|
<option>(net)</option>
|
||||||
|
</term>
|
||||||
|
<listitem>Frequency on which device 'net' is listening (Linux only)
|
||||||
|
<para /></listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<command>
|
<command>
|
||||||
|
@ -363,6 +363,9 @@ struct text_object *construct_text_object(char *s, const char *arg, long
|
|||||||
END OBJ(wireless_channel, &update_net_stats)
|
END OBJ(wireless_channel, &update_net_stats)
|
||||||
parse_net_stat_arg(obj, arg, free_at_crash);
|
parse_net_stat_arg(obj, arg, free_at_crash);
|
||||||
obj->callbacks.print = &print_wireless_channel;
|
obj->callbacks.print = &print_wireless_channel;
|
||||||
|
END OBJ(wireless_freq, &update_net_stats)
|
||||||
|
parse_net_stat_arg(obj, arg, free_at_crash);
|
||||||
|
obj->callbacks.print = &print_wireless_frequency;
|
||||||
END OBJ(wireless_mode, &update_net_stats)
|
END OBJ(wireless_mode, &update_net_stats)
|
||||||
parse_net_stat_arg(obj, arg, free_at_crash);
|
parse_net_stat_arg(obj, arg, free_at_crash);
|
||||||
obj->callbacks.print = &print_wireless_mode;
|
obj->callbacks.print = &print_wireless_mode;
|
||||||
|
@ -546,12 +546,14 @@ int update_net_stats(void)
|
|||||||
snprintf(ns->essid, 32, "off/any");
|
snprintf(ns->essid, 32, "off/any");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// get channel
|
// get channel and freq
|
||||||
if (winfo->b.has_freq) {
|
if (winfo->b.has_freq) {
|
||||||
if(winfo->has_range == 1) {
|
if(winfo->has_range == 1) {
|
||||||
ns->channel = iw_freq_to_channel(winfo->b.freq, &(winfo->range));
|
ns->channel = iw_freq_to_channel(winfo->b.freq, &(winfo->range));
|
||||||
|
iw_print_freq_value(ns->freq, 16, winfo->b.freq);
|
||||||
} else {
|
} else {
|
||||||
ns->channel = 0;
|
ns->channel = 0;
|
||||||
|
ns->freq[0] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,6 +260,19 @@ void print_wireless_channel(struct text_object *obj, char *p, int p_max_size)
|
|||||||
snprintf(p, p_max_size, "/");
|
snprintf(p, p_max_size, "/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void print_wireless_frequency(struct text_object *obj, char *p, int p_max_size)
|
||||||
|
{
|
||||||
|
struct net_stat *ns = (struct net_stat *)obj->data.opaque;
|
||||||
|
|
||||||
|
if (!ns)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(ns->freq[0] != 0) {
|
||||||
|
snprintf(p, p_max_size, "%s", ns->freq);
|
||||||
|
} else {
|
||||||
|
snprintf(p, p_max_size, "/");
|
||||||
|
}
|
||||||
|
}
|
||||||
void print_wireless_bitrate(struct text_object *obj, char *p, int p_max_size)
|
void print_wireless_bitrate(struct text_object *obj, char *p, int p_max_size)
|
||||||
{
|
{
|
||||||
struct net_stat *ns = (struct net_stat *)obj->data.opaque;
|
struct net_stat *ns = (struct net_stat *)obj->data.opaque;
|
||||||
|
@ -47,6 +47,7 @@ struct net_stat {
|
|||||||
// wireless extensions
|
// wireless extensions
|
||||||
char essid[32];
|
char essid[32];
|
||||||
int channel;
|
int channel;
|
||||||
|
char freq[16];
|
||||||
char bitrate[16];
|
char bitrate[16];
|
||||||
char mode[16];
|
char mode[16];
|
||||||
int link_qual;
|
int link_qual;
|
||||||
@ -78,6 +79,7 @@ double upspeedgraphval(struct text_object *);
|
|||||||
#ifdef BUILD_WLAN
|
#ifdef BUILD_WLAN
|
||||||
void print_wireless_essid(struct text_object *, char *, int);
|
void print_wireless_essid(struct text_object *, char *, int);
|
||||||
void print_wireless_channel(struct text_object *, char *, int);
|
void print_wireless_channel(struct text_object *, char *, int);
|
||||||
|
void print_wireless_frequency(struct text_object *, char *, int);
|
||||||
void print_wireless_mode(struct text_object *, char *, int);
|
void print_wireless_mode(struct text_object *, char *, int);
|
||||||
void print_wireless_bitrate(struct text_object *, char *, int);
|
void print_wireless_bitrate(struct text_object *, char *, int);
|
||||||
void print_wireless_ap(struct text_object *, char *, int);
|
void print_wireless_ap(struct text_object *, char *, int);
|
||||||
|
Loading…
Reference in New Issue
Block a user