[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-dev] stuck in consume_packets/multipoll loop
From: |
Bernd Ocklin |
Subject: |
[gpsd-dev] stuck in consume_packets/multipoll loop |
Date: |
Wed, 20 Nov 2013 14:53:29 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 |
Hi,
asking for some advice of how to fix this best or what I am missing. I
am looking for a solution for my own device driver but its identically
to a nmea2000 case.
In order to loop forever in gpsd_multipoll()'s for-loop over packet
fragments you need to have
1. "slow" gpsd host (400MHz embedded)
2. chatty nmea2000 device
3. single-frame CAN transmissions (e.g. PGN
Due to 1. and 2. every nmea2000_get() returns > 0.
Due to 3. every packet is complete, outbuflen > 0.
In gpsd_poll() this qualifies for PACKET_SET. In gpsd_multipoll() this
means != NO_DATAIS and & PACKET_SET != 0. Thus gpsd_multipoll() just
loops and gpsd is locked into the nmea 2000 device.
An ugly hack would obviously be to make every second nmea2000_get() call
a no-op returning 0. But a simple
/* give other devices a chance */
if (changed & PACKET_SET)
break;
at the end of the loop fixed the problem for me. Not 100% sure about
side effects for other cases though.
Bernd
- [gpsd-dev] stuck in consume_packets/multipoll loop,
Bernd Ocklin <=