gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] Fixing parsing code patch


From: Tuukka Pasanen
Subject: [gpsd-dev] Fixing parsing code patch
Date: Thu, 30 May 2013 10:02:02 +0300

Hello,
I noted with perl Net::GPSD3 that it's not allways connecting correctly to even with gpsd 3.9. It's just hanging up in place where it's waiting response. So I digged little bit futher and noted that it sends too fast commands '?DEVICES;' and '?POLL;'. First one is handled by gpsd right but another one it treated as error. That is not correct! It can be tested with netcat line:

echo -e "?POLL;?DEVICES;\n" | netcat 127.0.0.1 2947

So I figured out little patch that can handle this line

echo -e "\r\n ?POLL;  \r\r\n\n  ?DEVICES; \n?VERSION;?DEVICE;" | netcat 127.0.0.1 2947

It's not pretty string to send but clients can send what ever they like.. After patch this line is handled as it should. Patch only adds handling '?' char and seek for first '?' char in buffer. Patch didn't break cgps or xgps because they seems to use JSON.
It's made against git but I didn't use git format-patch command only git diff and I don't know should I open bug?

Thanks,
Tuukka

Attachment: gpsd-better_str_parsing.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]