diff options
author | OLFDB <olf@eisenzelt.de> | 2021-03-10 08:51:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-10 08:51:44 +0100 |
commit | 2f42f57ecf27f0ae84cff43f20a4b52b616a03c7 (patch) | |
tree | 4dcb1c6ce19327f5aa996c91bb1a297960a07795 /navit | |
parent | 4dca2cb34675ae8aeed7f01879126e51b18fcedb (diff) | |
download | navit-2f42f57ecf27f0ae84cff43f20a4b52b616a03c7.tar.gz |
fix:vehicle:gpsd:Retry connect after 10 seconds not performed (#1099)
* FIX: Retry connect after 10 seconds not performed
Set priv->cbt before starting the timer.
* Set priv->cbt in vehicle_gpsd_try_open to be able to reconnect any time not just at startup
* Don't release the gps object
Diffstat (limited to 'navit')
-rw-r--r-- | navit/vehicle/gpsd/vehicle_gpsd.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/navit/vehicle/gpsd/vehicle_gpsd.c b/navit/vehicle/gpsd/vehicle_gpsd.c index 7544d037d..92d663ef9 100644 --- a/navit/vehicle/gpsd/vehicle_gpsd.c +++ b/navit/vehicle/gpsd/vehicle_gpsd.c @@ -236,6 +236,7 @@ static int vehicle_gpsd_try_open(struct vehicle_priv *priv) { priv->gps = gps_open(source + 7, port); if(!priv->gps) { #endif + priv->cbt = callback_new_1(callback_cast(vehicle_gpsd_try_open), priv); dbg(lvl_error,"gps_open failed for '%s'. Retrying in %d seconds. Have you started gpsd?", priv->source, priv->retry_interval); g_free(source); @@ -312,10 +313,11 @@ static void vehicle_gpsd_close(struct vehicle_priv *priv) { } if (priv->gps) { gps_close(priv->gps); -#if GPSD_API_MAJOR_VERSION >= 5 - g_free(priv->gps); -#endif - priv->gps = NULL; +//if we release the gps object a reconnect is no longer working. +//#if GPSD_API_MAJOR_VERSION >= 5 +// g_free(priv->gps); +//#endif +// priv->gps = NULL; } #ifdef HAVE_GPSBT err = gpsbt_stop(&priv->context); |