mirror of
https://github.com/vale981/yabar
synced 2025-03-05 09:31:39 -05:00
More graceful error handling for ya_wifi internal block
In case the wireless connection was not yet established or has been lost, the block should not immediately fall into an error state and exit. Rather, print a warning message and keep trying...
This commit is contained in:
parent
d682dd6c8d
commit
96714d0025
1 changed files with 6 additions and 5 deletions
|
@ -734,12 +734,13 @@ void ya_int_wifi(ya_block_t *blk) {
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
if (ya_int_get_wireless_info(&ws, blk->internal->option[0]) || ws.link_qual_max == 0) {
|
if (ya_int_get_wireless_info(&ws, blk->internal->option[0]) || ws.link_qual_max == 0) {
|
||||||
ya_block_error(blk, "Failed to retrieve wireless info for device %s", blk->internal->option[0]);
|
ya_block_warning(blk, "Failed to retrieve wireless info for device %s", blk->internal->option[0]);
|
||||||
}
|
sprintf(startstr, "- (0%%)");
|
||||||
|
} else {
|
||||||
sprintf(startstr, "%s (%d%%)", ws.essid, ws.link_qual*100 / ws.link_qual_max);
|
sprintf(startstr, "%s (%d%%)", ws.essid, ws.link_qual*100 / ws.link_qual_max);
|
||||||
if(suflen)
|
if(suflen)
|
||||||
strcat(blk->buf, blk->internal->suffix);
|
strcat(blk->buf, blk->internal->suffix);
|
||||||
|
}
|
||||||
|
|
||||||
ya_draw_pango_text(blk);
|
ya_draw_pango_text(blk);
|
||||||
sleep(blk->sleep);
|
sleep(blk->sleep);
|
||||||
|
|
Loading…
Add table
Reference in a new issue