|
Hello all,I have ported the software to a wireless embedded ARM system, and I am trying to figure out where to add some wireless link quality checking. Since it is feasible that the embedded system could roam out of range of the wireless access point, i need to warn the user when it happens. I have working code for it, but i need a good place to put it that wont tax my system. The way I am checking the link is by opening a read pipe and running a small binary like ifconfig that will give me the link quality. I grep out the data i want then sscanf it. It really bogs the system down if I do this too much (i tried doing it on each stream_get_byte, but that was a BAD idea... ).
Anybody have any ideas on where to put this check? Code snippet follows: //Begin RF Link check FILE *rd_pipe; char output[256]; int result; int linkQnum=0; int linkQden=0; int sigL=0; int noiseL=0; memset(output, 0x00, sizeof(output));if((rd_pipe = popen("iwconfig wlan0 2> /dev/null | grep Link", "r")) == (FILE *)NULL)
{ // some error msg } result = fread(output,1,sizeof(output), rd_pipe); pclose(rd_pipe);sscanf(output, " Link Quality:%d/%d Signal level:-%d dBm Noise level:-%d dBm",
&linkQnum, &linkQden, &sigL, &noiseL); //End RF Link check Thanks, Brian
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.