Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

naranek
Copy link

@naranek naranek commented Jan 17, 2016

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.

@MS3FGX
Copy link
Owner

MS3FGX commented Jan 18, 2016

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.

@naranek
Copy link
Author

naranek commented Jan 18, 2016

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 😆

@MS3FGX
Copy link
Owner

MS3FGX commented Jan 18, 2016

Oh yeah, forgot all about -s for syslog. Running out of letters...

@naranek
Copy link
Author

naranek commented Jan 18, 2016

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.

@MS3FGX
Copy link
Owner

MS3FGX commented Apr 16, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants