Skip to content

Added -g switch to follow chanGes in device states. - #6

Open
naranek wants to merge 4 commits into
MS3FGX:masterfrom
naranek:master
Open

Added -g switch to follow chanGes in device states.#6
naranek wants to merge 4 commits into
MS3FGX:masterfrom
naranek:master

Conversation

@naranek

@naranek naranek commented Jan 17, 2016

Copy link
Copy Markdown

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

MS3FGX commented Jan 18, 2016

Copy link
Copy Markdown
Owner

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

naranek commented Jan 18, 2016

Copy link
Copy Markdown
Author

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

MS3FGX commented Jan 18, 2016

Copy link
Copy Markdown
Owner

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

@naranek

naranek commented Jan 18, 2016

Copy link
Copy Markdown
Author

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

MS3FGX commented Apr 16, 2016

Copy link
Copy Markdown
Owner

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