-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added -g switch to follow chanGes in device states. #6
base: master
Are you sure you want to change the base?
Conversation
Very interesting idea, I'll definitely give this a look. One thing I did notice right off the bat was that the code as-is gives a warning about strcpy overflowing the buffer on line 826. On closer inspection you're trying to save "returned" to .status which is only setup for 8 characters; you need to make it 9 characters so there is space for the newline after the actual text. So either doing status[9] or simply changing "returned" to something shorter gets it going. How important is the use of -g to enable this function? I've always kind of anticipated using -g for enabling GPS mode whenever I manage to get that included, so I'd like to preserve it if possible. What about using -s for "status"? Seems like that's a fitting name since it's referenced as .status in the code anyway. |
Thanks for the heads up. I'll fix that. I ran "make" and it compiles without errors, but I guess I should use some additional switches. I haven't written anything in c before. -s is perfectly fine with me, but it conflicts with the syslog only mode. I had a really hard time finding a suitable letter for this 😆 |
Oh yeah, forgot all about -s for syslog. Running out of letters... |
I updated the length of the status. It would also be nice to have the program try to find the name again later for the VOID devices, but I haven't yet figured out a smart way to do it. |
I haven't forgotten about this and definitely want to work on getting it included. Just haven't had a lot of free time, and want to try to get a stable milestone release out before adding something relatively large like this. So hoping to revisit this in the very near future in the next wave of changes/updates. |
Hi,
I added a switch which allows monitoring of switches in states of devices. You can see devices going out of range or shutting down and coming back up. It's useful when the scanner is in the same place for a longer period of time.