summaryrefslogtreecommitdiff
path: root/navit/vehicle/gpsd
diff options
context:
space:
mode:
authorsteven_s <steven_s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-11-01 02:48:32 +0000
committersteven_s <steven_s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-11-01 02:48:32 +0000
commit554d5793d40d4159a5a73e26b25255ed8de80273 (patch)
tree20f202e58f5e98fa6bebf6cb6a015ccb18e8f464 /navit/vehicle/gpsd
parent9c9926186d7e4c5aa035a709e40355892253d9ca (diff)
downloadnavit-554d5793d40d4159a5a73e26b25255ed8de80273.tar.gz
Fix:core: Fix for vehicles not routing until position is set with the GUI. |
If navit was started before the gps daemon was running vehicle_gpsd would report the vehicle as active=0 so navit->vehcile would be null. We now report the active status based on the attribute value not the current status of the gps link. Same applies to vehicle_file and vehicle_gypsy git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1626 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/vehicle/gpsd')
-rw-r--r--navit/vehicle/gpsd/vehicle_gpsd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/navit/vehicle/gpsd/vehicle_gpsd.c b/navit/vehicle/gpsd/vehicle_gpsd.c
index 4e972d06c..2cb661f35 100644
--- a/navit/vehicle/gpsd/vehicle_gpsd.c
+++ b/navit/vehicle/gpsd/vehicle_gpsd.c
@@ -47,6 +47,7 @@ static struct vehicle_priv {
char *nmea_data;
char *nmea_data_buf;
guint retry_timer;
+ struct attr ** attrs;
} *vehicle_last;
#define DEFAULT_RETRY_INTERVAL 10 // seconds
@@ -224,6 +225,7 @@ static int
vehicle_gpsd_position_attr_get(struct vehicle_priv *priv,
enum attr_type type, struct attr *attr)
{
+ struct attr * active=NULL;
switch (type) {
case attr_position_height:
attr->u.numd = &priv->height;
@@ -249,10 +251,11 @@ vehicle_gpsd_position_attr_get(struct vehicle_priv *priv,
return 0;
break;
case attr_active:
- if ( priv->watch)
- attr->u.num=1;
- else
- attr->u.num=0;
+ active = attr_search(priv->attrs,NULL,attr_active);
+ if(active != NULL && active->u.num == 1)
+ return 1;
+ else
+ return 0;
break;
default:
return 0;
@@ -298,6 +301,7 @@ vehicle_gpsd_new_gpsd(struct vehicle_methods
}
ret->cbl = cbl;
*meth = vehicle_gpsd_methods;
+ ret->attrs = attrs;
vehicle_gpsd_open(ret);
return ret;
}