[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-users] Right baud rate could not be detected "-n" flag is NOT used
From: |
Carlo Lobrano |
Subject: |
[gpsd-users] Right baud rate could not be detected "-n" flag is NOT used |
Date: |
Mon, 18 May 2015 11:09:33 +0000 |
Hello,
I am facing this strange behavior with a Sirf IV based gps module configured in NMEA mode with baudrate 115200.
When I run gpsd with -n flag, I am able to detect the correct speed (115200), instead when no -n flag is provided, and the client connects, the detected speed is 4800.
Using gdb I saw that the problem originates in serial.c: gpsd_serial_open function when it calls tcgetattr.
- When "-n" flag is NOT provided, tcgetattr returns a termios structure with c_ispeed and c_outspeed equal to B4800
- When the "-n" flag is provided, as soon as gpsd starts and connects with gps module tcgetattr returns a structure with c_ispeed and c_ospeed correctly set at B115200
How is this even possible? The call chain is basically the same as far as I can see: gpsd_activate => gps_open => gpsd_serial_open.
I know that the error derives from a call to tcgetattr, so it should not be caused by gpsd, but it puzzles me that just changing how gpsd is called the speed is correctly detected.
Does anyone had a similar problem?
Thanks in advance,
Carlo Lobrano
- [gpsd-users] Right baud rate could not be detected "-n" flag is NOT used,
Carlo Lobrano <=