diff options
author | Pierre Grandin <grandinp@gmail.com> | 2018-04-26 23:02:15 -0700 |
---|---|---|
committer | Pierre Grandin <grandinp@gmail.com> | 2018-04-26 23:02:15 -0700 |
commit | 0a0b65f49a19ddac53605c8b66242a7bf4df5102 (patch) | |
tree | 631f26306aa056eb8fd165c533889dd9925c6833 /navit/vehicle | |
parent | f0b46b6bccf68ae233e1209d1854b1885cf62188 (diff) | |
parent | 221f783ea1caaaab2f5ceadc6b0fb3e720aac3df (diff) | |
download | navit-0a0b65f49a19ddac53605c8b66242a7bf4df5102.tar.gz |
Merge branch 'trunk' into fix_log_replay
Diffstat (limited to 'navit/vehicle')
-rw-r--r-- | navit/vehicle/android/vehicle_android.c | 24 | ||||
-rw-r--r-- | navit/vehicle/demo/vehicle_demo.c | 24 | ||||
-rw-r--r-- | navit/vehicle/file/vehicle_file.c | 70 | ||||
-rw-r--r-- | navit/vehicle/gpsd/vehicle_gpsd.c | 38 | ||||
-rw-r--r-- | navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c | 10 | ||||
-rw-r--r-- | navit/vehicle/gypsy/vehicle_gypsy.c | 12 | ||||
-rw-r--r-- | navit/vehicle/iphone/vehicle_iphone.c | 8 | ||||
-rw-r--r-- | navit/vehicle/maemo/vehicle_maemo.c | 76 | ||||
-rw-r--r-- | navit/vehicle/null/vehicle_null.c | 12 | ||||
-rw-r--r-- | navit/vehicle/qt5/vehicle_qt5.cpp | 40 | ||||
-rw-r--r-- | navit/vehicle/webos/bluetooth.c | 92 | ||||
-rw-r--r-- | navit/vehicle/webos/vehicle_webos.c | 32 | ||||
-rw-r--r-- | navit/vehicle/wince/vehicle_wince.c | 76 |
13 files changed, 257 insertions, 257 deletions
diff --git a/navit/vehicle/android/vehicle_android.c b/navit/vehicle/android/vehicle_android.c index 4165b9b31..14e9d0f8a 100644 --- a/navit/vehicle/android/vehicle_android.c +++ b/navit/vehicle/android/vehicle_android.c @@ -72,7 +72,7 @@ struct vehicle_priv { static void vehicle_android_destroy(struct vehicle_priv *priv) { - dbg(lvl_debug,"enter\n"); + dbg(lvl_debug,"enter"); g_free(priv); } @@ -88,7 +88,7 @@ static int vehicle_android_position_attr_get(struct vehicle_priv *priv, enum attr_type type, struct attr *attr) { - dbg(lvl_debug,"enter %s\n",attr_to_name(type)); + dbg(lvl_debug,"enter %s",attr_to_name(type)); switch (type) { case attr_position_fix_type: attr->u.num = priv->fix_type; @@ -125,7 +125,7 @@ vehicle_android_position_attr_get(struct vehicle_priv *priv, default: return 0; } - dbg(lvl_debug,"ok\n"); + dbg(lvl_debug,"ok"); attr->type = type; return 1; } @@ -147,7 +147,7 @@ static void vehicle_android_position_callback(struct vehicle_priv *v, jobject location) { time_t tnow; struct tm *tm; - dbg(lvl_debug,"enter\n"); + dbg(lvl_debug,"enter"); v->geo.lat = (*jnienv)->CallDoubleMethod(jnienv, location, v->Location_getLatitude); v->geo.lng = (*jnienv)->CallDoubleMethod(jnienv, location, v->Location_getLongitude); @@ -158,7 +158,7 @@ vehicle_android_position_callback(struct vehicle_priv *v, jobject location) { tnow=(*jnienv)->CallLongMethod(jnienv, location, v->Location_getTime)/1000; tm = gmtime(&tnow); strftime(v->fixiso8601, sizeof(v->fixiso8601), "%Y-%m-%dT%TZ", tm); - dbg(lvl_debug,"lat %f lon %f time %s\n",v->geo.lat,v->geo.lng,v->fixiso8601); + dbg(lvl_debug,"lat %f lon %f time %s",v->geo.lat,v->geo.lng,v->fixiso8601); if (v->valid != attr_position_valid_valid) { v->valid = attr_position_valid_valid; callback_list_call_attr_0(v->cbl, attr_position_valid); @@ -240,16 +240,16 @@ vehicle_android_init(struct vehicle_priv *ret) return 0; if (!android_find_class_global("org/navitproject/navit/NavitVehicle", &ret->NavitVehicleClass)) return 0; - dbg(lvl_debug,"at 3\n"); + dbg(lvl_debug,"at 3"); cid = (*jnienv)->GetMethodID(jnienv, ret->NavitVehicleClass, "<init>", "(Landroid/content/Context;III)V"); if (cid == NULL) { - dbg(lvl_error,"no method found\n"); + dbg(lvl_error,"no method found"); return 0; /* exception thrown */ } - dbg(lvl_debug, "at 4 android_activity=%p\n", android_activity); + dbg(lvl_debug, "at 4 android_activity=%p", android_activity); ret->NavitVehicle=(*jnienv)->NewObject(jnienv, ret->NavitVehicleClass, cid, android_activity, (int) ret->pcb, (int) ret->scb, (int) ret->fcb); - dbg(lvl_debug,"result=%p\n",ret->NavitVehicle); + dbg(lvl_debug,"result=%p",ret->NavitVehicle); if (!ret->NavitVehicle) return 0; if (ret->NavitVehicle) @@ -273,7 +273,7 @@ vehicle_android_new_android(struct vehicle_methods *meth, { struct vehicle_priv *ret; - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); ret = g_new0(struct vehicle_priv, 1); ret->cbl = cbl; ret->pcb = callback_new_1(callback_cast(vehicle_android_position_callback), ret); @@ -284,7 +284,7 @@ vehicle_android_new_android(struct vehicle_methods *meth, ret->sats_used = 0; *meth = vehicle_android_methods; vehicle_android_init(ret); - dbg(lvl_debug, "return\n"); + dbg(lvl_debug, "return"); return ret; } @@ -296,7 +296,7 @@ vehicle_android_new_android(struct vehicle_methods *meth, void plugin_init(void) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); plugin_register_category_vehicle("android", vehicle_android_new_android); } diff --git a/navit/vehicle/demo/vehicle_demo.c b/navit/vehicle/demo/vehicle_demo.c index 1e2991300..036e97e27 100644 --- a/navit/vehicle/demo/vehicle_demo.c +++ b/navit/vehicle/demo/vehicle_demo.c @@ -170,7 +170,7 @@ vehicle_demo_set_attr_do(struct vehicle_priv *priv, struct attr *attr) callback_list_call_attr_0(priv->cbl, attr_position_valid); } priv->position_set=1; - dbg(lvl_debug,"position_set %f %f\n", priv->geo.lat, priv->geo.lng); + dbg(lvl_debug,"position_set %f %f", priv->geo.lat, priv->geo.lng); break; case attr_profilename: case attr_source: @@ -180,7 +180,7 @@ vehicle_demo_set_attr_do(struct vehicle_priv *priv, struct attr *attr) // Ignore; used by Navit's infrastructure, but not relevant for this vehicle. break; default: - dbg(lvl_error,"unsupported attribute %s\n",attr_to_name(attr->type)); + dbg(lvl_error,"unsupported attribute %s",attr_to_name(attr->type)); return 0; } return 1; @@ -209,7 +209,7 @@ vehicle_demo_timer(struct vehicle_priv *priv) struct item *item=NULL; len = (priv->config_speed * priv->interval / 1000)/ 3.6; - dbg(lvl_debug, "###### Entering simulation loop\n"); + dbg(lvl_debug, "###### Entering simulation loop"); if (!priv->config_speed) return; if (priv->route) @@ -228,10 +228,10 @@ vehicle_demo_timer(struct vehicle_priv *priv) item=map_rect_get_item(mr); if (item && item_coord_get(item, &pos, 1)) { priv->position_set=0; - dbg(lvl_debug, "current pos=0x%x,0x%x\n", pos.x, pos.y); - dbg(lvl_debug, "last pos=0x%x,0x%x\n", priv->last.x, priv->last.y); + dbg(lvl_debug, "current pos=0x%x,0x%x", pos.x, pos.y); + dbg(lvl_debug, "last pos=0x%x,0x%x", priv->last.x, priv->last.y); if (priv->last.x == pos.x && priv->last.y == pos.y) { - dbg(lvl_warning, "endless loop\n"); + dbg(lvl_warning, "endless loop"); } priv->last = pos; while (item && priv->config_speed) { @@ -239,9 +239,9 @@ vehicle_demo_timer(struct vehicle_priv *priv) item=map_rect_get_item(mr); continue; } - dbg(lvl_debug, "next pos=0x%x,0x%x\n", c.x, c.y); + dbg(lvl_debug, "next pos=0x%x,0x%x", c.x, c.y); slen = transform_distance(projection_mg, &pos, &c); - dbg(lvl_debug, "len=%d slen=%d\n", len, slen); + dbg(lvl_debug, "len=%d slen=%d", len, slen); if (slen < len) { len -= slen; pos = c; @@ -258,9 +258,9 @@ vehicle_demo_timer(struct vehicle_priv *priv) ci.x = pos.x; ci.y = pos.y; priv->speed=0; - dbg(lvl_debug,"destination reached\n"); + dbg(lvl_debug,"destination reached"); } - dbg(lvl_debug, "ci=0x%x,0x%x\n", ci.x, ci.y); + dbg(lvl_debug, "ci=0x%x,0x%x", ci.x, ci.y); transform_to_geo(projection_mg, &ci, &priv->geo); if (priv->valid != attr_position_valid_valid) { @@ -288,7 +288,7 @@ vehicle_demo_new(struct vehicle_methods { struct vehicle_priv *ret; - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); ret = g_new0(struct vehicle_priv, 1); ret->cbl = cbl; ret->interval=1000; @@ -306,7 +306,7 @@ vehicle_demo_new(struct vehicle_methods void plugin_init(void) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); plugin_register_category_vehicle("demo", vehicle_demo_new); } diff --git a/navit/vehicle/file/vehicle_file.c b/navit/vehicle/file/vehicle_file.c index 868af4f57..114fd2874 100644 --- a/navit/vehicle/file/vehicle_file.c +++ b/navit/vehicle/file/vehicle_file.c @@ -154,7 +154,7 @@ static int vehicle_win32_serial_track(struct vehicle_priv *priv) int rc = 0; int dwBytes; - dbg(lvl_debug, "enter, *priv='%x', priv->source='%s'\n", priv, priv->source); + dbg(lvl_debug, "enter, *priv='%x', priv->source='%s'", priv, priv->source); if ( priv->no_data_count > 5 ) { @@ -200,7 +200,7 @@ static int vehicle_win32_serial_track(struct vehicle_priv *priv) priv->no_data_count = 0; callback_list_call_attr_0(priv->cbl, attr_position_coord_geo); if (rc > 1) - dbg(lvl_error, "Can not keep with gps data delay is %d seconds\n", rc - 1); + dbg(lvl_error, "Can not keep with gps data delay is %d seconds", rc - 1); } } @@ -208,7 +208,7 @@ static int vehicle_win32_serial_track(struct vehicle_priv *priv) { priv->no_data_count++; } - dbg(lvl_info, "leave, return '1', priv->no_data_count='%d'\n", priv->no_data_count); + dbg(lvl_info, "leave, return '1', priv->no_data_count='%d'", priv->no_data_count); return 1; } #endif @@ -266,7 +266,7 @@ vehicle_file_open(struct vehicle_priv *priv) struct sockaddr_in sin; p=strchr(s,':'); if (!p) { - dbg(lvl_error,"port number missing in %s\n",s); + dbg(lvl_error,"port number missing in %s",s); g_free(s); return 0; } @@ -274,14 +274,14 @@ vehicle_file_open(struct vehicle_priv *priv) sin.sin_family=AF_INET; sin.sin_port=ntohs(atoi(p)); if (!inet_aton(s, &sin.sin_addr)) { - dbg(lvl_error,"failed to parse %s\n",s); + dbg(lvl_error,"failed to parse %s",s); g_free(s); return 0; } priv->fd = socket(PF_INET, SOCK_STREAM, 0); if (priv->fd != -1) { if (connect(priv->fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { - dbg(lvl_error,"failed to connect to %s:%s\n",s,p); + dbg(lvl_error,"failed to connect to %s:%s",s,p); g_free(s); return 0; } @@ -315,7 +315,7 @@ vehicle_file_open(struct vehicle_priv *priv) g_free( raw_setting_str ); priv->file_type = file_type_serial; // Add the callback - dbg(lvl_info, "Add the callback ...\n", priv->source); + dbg(lvl_info, "Add the callback ...", priv->source); priv->timeout_callback=callback_new_1(callback_cast(vehicle_win32_serial_track), priv); #else //TODO - add linux serial @@ -332,7 +332,7 @@ vehicle_file_open(struct vehicle_priv *priv) static void vehicle_file_close(struct vehicle_priv *priv) { - dbg(lvl_debug, "enter, priv->fd='%d'\n", priv->fd); + dbg(lvl_debug, "enter, priv->fd='%d'", priv->fd); vehicle_file_disable_watch(priv); #ifdef _WIN32 if(priv->file_type == file_type_serial) @@ -369,7 +369,7 @@ vehicle_file_close(struct vehicle_priv *priv) static int vehicle_file_enable_watch_timer(struct vehicle_priv *priv) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); vehicle_file_enable_watch(priv); return FALSE; @@ -425,10 +425,10 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer) int valid=0; int ret = 0; - dbg(lvl_info, "enter: buffer='%s'\n", buffer); + dbg(lvl_info, "enter: buffer='%s'", buffer); for (;;) { if (len < 4) { - dbg(lvl_error, "'%s' too short\n", buffer); + dbg(lvl_error, "'%s' too short", buffer); return ret; } if (buffer[len - 1] == '\r' || buffer[len - 1] == '\n') { @@ -439,22 +439,22 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer) break; } if (buffer[0] != '$') { - dbg(lvl_error, "no leading $ in '%s'\n", buffer); + dbg(lvl_error, "no leading $ in '%s'", buffer); return ret; } if (buffer[len - 3] != '*') { - dbg(lvl_error, "no *XX in '%s'\n", buffer); + dbg(lvl_error, "no *XX in '%s'", buffer); return ret; } for (i = 1; i < len - 3; i++) { csum ^= (unsigned char) (buffer[i]); } if (!sscanf(buffer + len - 2, "%x", &bcsum) && priv->checksum_ignore != 2) { - dbg(lvl_error, "no checksum in '%s'\n", buffer); + dbg(lvl_error, "no checksum in '%s'", buffer); return ret; } if (bcsum != csum && priv->checksum_ignore == 0) { - dbg(lvl_error, "wrong checksum in '%s was %x should be %x'\n", buffer,bcsum,csum); + dbg(lvl_error, "wrong checksum in '%s was %x should be %x'", buffer,bcsum,csum); return ret; } @@ -463,7 +463,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer) g_free(priv->nmea_data_buf); priv->nmea_data_buf=nmea_data_buf; } else { - dbg(lvl_error, "nmea buffer overflow (len %zu), discarding '%s'\n", priv->nmea_data_buf?strlen(priv->nmea_data_buf):-1,buffer); + dbg(lvl_error, "nmea buffer overflow (len %zu), discarding '%s'", priv->nmea_data_buf?strlen(priv->nmea_data_buf):-1,buffer); } i = 0; p = buffer; @@ -510,7 +510,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer) strncpy(priv->fixtime, item[1], sizeof(priv->fixtime)); } - dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng); + dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng); } else { if (priv->valid == attr_position_valid_valid) @@ -550,7 +550,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer) if (valid) { priv->direction = g_ascii_strtod( item[1], NULL ); priv->speed = g_ascii_strtod( item[7], NULL ); - dbg(lvl_info,"direction %lf, speed %2.1lf\n", priv->direction, priv->speed); + dbg(lvl_info,"direction %lf, speed %2.1lf", priv->direction, priv->speed); } } if (!strncmp(&buffer[3], "RMC", 3)) { @@ -600,7 +600,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer) strncpy(priv->fixtime, item[1], sizeof(priv->fixtime)); } - dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng); + dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng); } else { if (priv->valid == attr_position_valid_valid) @@ -672,7 +672,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer) */ if (item[1]) { priv->magnetic_direction = g_ascii_strtod( item[1], NULL ); - dbg(lvl_debug,"magnetic %d\n", priv->magnetic_direction); + dbg(lvl_debug,"magnetic %d", priv->magnetic_direction); } } return ret; @@ -688,7 +688,7 @@ vehicle_file_io(struct vehicle_priv *priv) { int size, rc = 0; char *str, *tok; - dbg(lvl_debug, "vehicle_file_io : enter\n"); + dbg(lvl_debug, "vehicle_file_io : enter"); if (priv->process_statefile) { unsigned char *data; @@ -721,12 +721,12 @@ vehicle_file_io(struct vehicle_priv *priv) } priv->buffer_pos += size; priv->buffer[priv->buffer_pos] = '\0'; - dbg(lvl_debug, "size=%d pos=%d buffer='%s'\n", size, + dbg(lvl_debug, "size=%d pos=%d buffer='%s'", size, priv->buffer_pos, priv->buffer); str = priv->buffer; while ((tok = strchr(str, '\n'))) { *tok++ = '\0'; - dbg(lvl_debug, "line='%s'\n", str); + dbg(lvl_debug, "line='%s'", str); rc +=vehicle_file_parse(priv, str); str = tok; if (priv->file_type == file_type_file && rc) @@ -737,11 +737,11 @@ vehicle_file_io(struct vehicle_priv *priv) size = priv->buffer + priv->buffer_pos - str; memmove(priv->buffer, str, size + 1); priv->buffer_pos = size; - dbg(lvl_debug, "now pos=%d buffer='%s'\n", + dbg(lvl_debug, "now pos=%d buffer='%s'", priv->buffer_pos, priv->buffer); } else if (priv->buffer_pos == buffer_size - 1) { dbg(lvl_debug, - "Overflow. Most likely wrong baud rate or no nmea protocol\n"); + "Overflow. Most likely wrong baud rate or no nmea protocol"); priv->buffer_pos = 0; } if (rc) @@ -756,7 +756,7 @@ vehicle_file_io(struct vehicle_priv *priv) static void vehicle_file_enable_watch(struct vehicle_priv *priv) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); #ifdef _WIN32 // add an event : don't use glib timers and g_timeout_add if (priv->file_type == file_type_serial) @@ -764,7 +764,7 @@ vehicle_file_enable_watch(struct vehicle_priv *priv) if (priv->timeout_callback != NULL) priv->timeout = event_add_timeout(500, 1, priv->timeout_callback); else - dbg(lvl_warning, "error : watch not enabled : priv->timeout_callback is null\n"); } + dbg(lvl_warning, "error : watch not enabled : priv->timeout_callback is null"); } else #endif { @@ -781,7 +781,7 @@ vehicle_file_enable_watch(struct vehicle_priv *priv) static void vehicle_file_disable_watch(struct vehicle_priv *priv) { - dbg(lvl_debug, "vehicle_file_disable_watch : enter\n"); + dbg(lvl_debug, "vehicle_file_disable_watch : enter"); #ifdef _WIN32 if(priv->file_type == file_type_serial) { @@ -893,7 +893,7 @@ vehicle_file_position_attr_get(struct vehicle_priv *priv, attr->u.str=priv->fixiso8601; break; case attr_position_sat_item: - dbg(lvl_debug,"at here\n"); + dbg(lvl_debug,"at here"); priv->sat_item.id_lo++; if (priv->sat_item.id_lo > priv->current_count) { priv->sat_item.id_lo=0; @@ -988,7 +988,7 @@ vehicle_file_new_file(struct vehicle_methods struct attr *checksum_ignore; struct attr *state_file; - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); source = attr_search(attrs, NULL, attr_source); if(source == NULL){ @@ -1048,7 +1048,7 @@ vehicle_file_new_file(struct vehicle_methods ret->on_eof=1; if (on_eof && !g_ascii_strcasecmp(on_eof->u.str, "exit")) ret->on_eof=2; - dbg(lvl_debug,"on_eof=%d\n", ret->on_eof); + dbg(lvl_debug,"on_eof=%d", ret->on_eof); *meth = vehicle_file_methods; ret->cb=callback_new_1(callback_cast(vehicle_file_io), ret); ret->cbt=callback_new_1(callback_cast(vehicle_file_enable_watch_timer), ret); @@ -1065,15 +1065,15 @@ vehicle_file_new_file(struct vehicle_methods ret->no_data_count = 0; #endif - dbg(lvl_debug, "vehicle_file_new_file:open\n"); + dbg(lvl_debug, "vehicle_file_new_file:open"); if (!vehicle_file_open(ret)) { - dbg(lvl_error, "Failed to open '%s'\n", ret->source); + dbg(lvl_error, "Failed to open '%s'", ret->source); } vehicle_file_enable_watch(ret); // vehicle_file_destroy(ret); // return NULL; - dbg(lvl_debug, "leave\n"); + dbg(lvl_debug, "leave"); return ret; } @@ -1082,7 +1082,7 @@ vehicle_file_new_file(struct vehicle_methods */ void plugin_init(void) { - dbg(lvl_debug, "vehicle_file:plugin_init:enter\n"); + dbg(lvl_debug, "vehicle_file:plugin_init:enter"); plugin_register_category_vehicle("file", vehicle_file_new_file); plugin_register_category_vehicle("pipe", vehicle_file_new_file); plugin_register_category_vehicle("socket", vehicle_file_new_file); diff --git a/navit/vehicle/gpsd/vehicle_gpsd.c b/navit/vehicle/gpsd/vehicle_gpsd.c index 975d9c68a..285e05ccb 100644 --- a/navit/vehicle/gpsd/vehicle_gpsd.c +++ b/navit/vehicle/gpsd/vehicle_gpsd.c @@ -105,12 +105,12 @@ vehicle_gpsd_callback(struct gps_data_t *data, const char *buf, size_t len, g_free(priv->nmea_data_buf); priv->nmea_data_buf=nmea_data_buf; } else { - dbg(lvl_error, "nmea buffer overflow, discarding '%s'\n", buffer); + dbg(lvl_error, "nmea buffer overflow, discarding '%s'", buffer); } } } - dbg(lvl_debug,"data->set="LONGLONG_HEX_FMT"\n", (unsigned long long)data->set); + dbg(lvl_debug,"data->set="LONGLONG_HEX_FMT"", (unsigned long long)data->set); if (data->set & SPEED_SET) { priv->speed = data->fix.speed * MPS_TO_KPH; if(!isnan(data->fix.speed)) @@ -178,12 +178,12 @@ vehicle_gpsd_callback(struct gps_data_t *data, const char *buf, size_t len, } #ifdef HAVE_LIBGPS19 if (data->set & DOP_SET) { - dbg(lvl_debug, "pdop : %g\n", data->dop.pdop); + dbg(lvl_debug, "pdop : %g", data->dop.pdop); priv->hdop = data->dop.pdop; data->set &= ~DOP_SET; #else if (data->set & PDOP_SET) { - dbg(lvl_debug, "pdop : %g\n", data->pdop); + dbg(lvl_debug, "pdop : %g", data->pdop); priv->hdop = data->hdop; data->set &= ~PDOP_SET; #endif @@ -191,7 +191,7 @@ vehicle_gpsd_callback(struct gps_data_t *data, const char *buf, size_t len, if (data->set & LATLON_SET) { priv->geo.lat = data->fix.latitude; priv->geo.lng = data->fix.longitude; - dbg(lvl_debug,"lat=%f lng=%f\n", priv->geo.lat, priv->geo.lng); + dbg(lvl_debug,"lat=%f lng=%f", priv->geo.lat, priv->geo.lng); g_free(priv->nmea_data); priv->nmea_data=priv->nmea_data_buf; priv->nmea_data_buf=NULL; @@ -201,7 +201,7 @@ vehicle_gpsd_callback(struct gps_data_t *data, const char *buf, size_t len, if (! isnan(data->fix.speed) && priv->fix_type > 0) { callback_list_call_attr_0(priv->cbl, attr_position_coord_geo); } - dbg(lvl_info,"speed ok\n"); + dbg(lvl_info,"speed ok"); } /** @@ -219,7 +219,7 @@ vehicle_gpsd_try_open(struct vehicle_priv *priv) *colon = '\0'; port=colon+1; } - dbg(lvl_debug,"Trying to connect to %s:%s\n",source+7,port?port:"default"); + dbg(lvl_debug,"Trying to connect to %s:%s",source+7,port?port:"default"); #if GPSD_API_MAJOR_VERSION >= 5 /* gps_open returns 0 on success */ @@ -228,7 +228,7 @@ vehicle_gpsd_try_open(struct vehicle_priv *priv) priv->gps = gps_open(source + 7, port); if(!priv->gps) { #endif - dbg(lvl_error,"gps_open failed for '%s'. Retrying in %d seconds. Have you started gpsd?\n", priv->source, priv->retry_interval); + dbg(lvl_error,"gps_open failed for '%s'. Retrying in %d seconds. Have you started gpsd?", priv->source, priv->retry_interval); g_free(source); return TRUE; } @@ -252,7 +252,7 @@ vehicle_gpsd_try_open(struct vehicle_priv *priv) if (!priv->gps->gps_fd) { dbg(lvl_error,"Warning: gps_fd is 0, most likely you have used a gps.h incompatible to libgps"); } - dbg(lvl_debug,"Connected to gpsd fd=%d evwatch=%p\n", priv->gps->gps_fd, priv->evwatch); + dbg(lvl_debug,"Connected to gpsd fd=%d evwatch=%p", priv->gps->gps_fd, priv->evwatch); event_remove_timeout(priv->retry_timer2); priv->retry_timer2=NULL; return FALSE; @@ -271,11 +271,11 @@ vehicle_gpsd_open(struct vehicle_priv *priv) memset(&priv->context, 0, sizeof(gpsbt_t)); if(gpsbt_start(NULL, 0, 0, 0, errstr, sizeof(errstr), 0, &priv->context) < 0) { - dbg(lvl_error,"Error connecting to GPS with gpsbt: (%d) %s (%s)\n", + dbg(lvl_error,"Error connecting to GPS with gpsbt: (%d) %s (%s)", errno, strerror(errno), errstr); } sleep(1); /* give gpsd time to start */ - dbg(lvl_debug,"gpsbt_start: completed\n"); + dbg(lvl_debug,"gpsbt_start: completed"); #endif priv->retry_timer2=NULL; if (vehicle_gpsd_try_open(priv)) @@ -324,7 +324,7 @@ vehicle_gpsd_close(struct vehicle_priv *priv) static void vehicle_gpsd_io(struct vehicle_priv *priv) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); if (priv->gps) { vehicle_last = priv; #if GPSD_API_MAJOR_VERSION >= 5 @@ -333,7 +333,7 @@ vehicle_gpsd_io(struct vehicle_priv *priv) * No point in processing old GPS reports. */ while((read_result=gps_read(priv->gps))>0); if(read_result==-1) { - dbg(lvl_error,"gps_poll failed\n"); + dbg(lvl_error,"gps_poll failed"); vehicle_gpsd_close(priv); vehicle_gpsd_open(priv); } @@ -344,7 +344,7 @@ vehicle_gpsd_io(struct vehicle_priv *priv) } #else if (gps_poll(priv->gps)) { - dbg(lvl_error,"gps_poll failed\n"); + dbg(lvl_error,"gps_poll failed"); vehicle_gpsd_close(priv); vehicle_gpsd_open(priv); } @@ -445,7 +445,7 @@ vehicle_gpsd_new_gpsd(struct vehicle_methods struct vehicle_priv *ret; struct attr *source, *query, *retry_int; - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); source = attr_search(attrs, NULL, attr_source); ret = g_new0(struct vehicle_priv, 1); #if GPSD_API_MAJOR_VERSION >= 5 @@ -458,16 +458,16 @@ vehicle_gpsd_new_gpsd(struct vehicle_methods } else { ret->gpsd_query = g_strdup("w+x\n"); } - dbg(lvl_debug,"Format string for gpsd_query: %s\n",ret->gpsd_query); + dbg(lvl_debug,"Format string for gpsd_query: %s",ret->gpsd_query); retry_int = attr_search(attrs, NULL, attr_retry_interval); if (retry_int) { ret->retry_interval = retry_int->u.num; if (ret->retry_interval < MIN_RETRY_INTERVAL) { - dbg(lvl_error, "Retry interval %d too small, setting to %d\n", ret->retry_interval, MIN_RETRY_INTERVAL); + dbg(lvl_error, "Retry interval %d too small, setting to %d", ret->retry_interval, MIN_RETRY_INTERVAL); ret->retry_interval = MIN_RETRY_INTERVAL; } } else { - dbg(lvl_debug, "Retry interval not defined, setting to %d\n", DEFAULT_RETRY_INTERVAL); + dbg(lvl_debug, "Retry interval not defined, setting to %d", DEFAULT_RETRY_INTERVAL); ret->retry_interval = DEFAULT_RETRY_INTERVAL; } ret->cbl = cbl; @@ -480,6 +480,6 @@ vehicle_gpsd_new_gpsd(struct vehicle_methods void plugin_init(void) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); plugin_register_category_vehicle("gpsd", vehicle_gpsd_new_gpsd); } diff --git a/navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c b/navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c index ebdf08707..dd7b99ef0 100644 --- a/navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c +++ b/navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c @@ -122,7 +122,7 @@ vehicle_gpsd_dbus_open(struct vehicle_priv *priv) priv->connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error); } if (!priv->connection) { - dbg(lvl_error,"Failed to open connection to %s message bus: %s\n", priv->address?priv->address:"session",error.message); + dbg(lvl_error,"Failed to open connection to %s message bus: %s", priv->address?priv->address:"session",error.message); dbus_error_free(&error); return 0; } @@ -130,12 +130,12 @@ vehicle_gpsd_dbus_open(struct vehicle_priv *priv) dbus_bus_add_match(priv->connection,"type='signal',interface='org.gpsd'",&error); dbus_connection_flush(priv->connection); if (dbus_error_is_set(&error)) { - dbg(lvl_error,"Failed to add match to connection: %s\n", error.message); + dbg(lvl_error,"Failed to add match to connection: %s", error.message); vehicle_gpsd_dbus_close(priv); return 0; } if (!dbus_connection_add_filter(priv->connection, vehicle_gpsd_dbus_filter, priv, NULL)) { - dbg(lvl_error,"Failed to add filter to connection\n"); + dbg(lvl_error,"Failed to add filter to connection"); vehicle_gpsd_dbus_close(priv); return 0; } @@ -195,7 +195,7 @@ vehicle_gpsd_dbus_set_attr_do(struct vehicle_priv *priv, struct attr *attr, int switch (attr->type) { case attr_source: if (strncmp(vehicle_gpsd_dbus_prefix,attr->u.str,strlen(vehicle_gpsd_dbus_prefix))) { - dbg(lvl_error,"source must start with '%s'\n", vehicle_gpsd_dbus_prefix); + dbg(lvl_error,"source must start with '%s'", vehicle_gpsd_dbus_prefix); return 0; } g_free(priv->source); @@ -251,6 +251,6 @@ vehicle_gpsd_dbus_new(struct vehicle_methods void plugin_init(void) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); plugin_register_category_vehicle("gpsd_dbus", vehicle_gpsd_dbus_new); } diff --git a/navit/vehicle/gypsy/vehicle_gypsy.c b/navit/vehicle/gypsy/vehicle_gypsy.c index 16175f2e8..db3acf588 100644 --- a/navit/vehicle/gypsy/vehicle_gypsy.c +++ b/navit/vehicle/gypsy/vehicle_gypsy.c @@ -292,7 +292,7 @@ vehicle_gypsy_try_open(gpointer *data) } vehicle_last = priv; - dbg(lvl_debug,"gypsy connected to %d\n", source+8); + dbg(lvl_debug,"gypsy connected to %d", source+8); g_free(source); return FALSE; } @@ -463,11 +463,11 @@ vehicle_gypsy_new_gypsy(struct vehicle_methods *meth, dbus_message_unref(message); dbus_connection_unref(conn); } else { - dbg(lvl_error,"failed to connect to session bus\n"); + dbg(lvl_error,"failed to connect to session bus"); } } #endif - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); source = attr_search(attrs, NULL, attr_source); ret = g_new0(struct vehicle_priv, 1); ret->have_cords = 0; @@ -477,11 +477,11 @@ vehicle_gypsy_new_gypsy(struct vehicle_methods *meth, if (retry_int) { ret->retry_interval = retry_int->u.num; if (ret->retry_interval < MIN_RETRY_INTERVAL) { - dbg(lvl_error, "Retry interval %d too small, setting to %d\n", ret->retry_interval, MIN_RETRY_INTERVAL); + dbg(lvl_error, "Retry interval %d too small, setting to %d", ret->retry_interval, MIN_RETRY_INTERVAL); ret->retry_interval = MIN_RETRY_INTERVAL; } } else { - dbg(lvl_error, "Retry interval not defined, setting to %d\n", DEFAULT_RETRY_INTERVAL); + dbg(lvl_error, "Retry interval not defined, setting to %d", DEFAULT_RETRY_INTERVAL); ret->retry_interval = DEFAULT_RETRY_INTERVAL; } ret->cbl = cbl; @@ -498,6 +498,6 @@ vehicle_gypsy_new_gypsy(struct vehicle_methods *meth, void plugin_init(void) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); plugin_register_category_vehicle("gypsy", vehicle_gypsy_new_gypsy); } diff --git a/navit/vehicle/iphone/vehicle_iphone.c b/navit/vehicle/iphone/vehicle_iphone.c index f8ce5b644..28ac0beff 100644 --- a/navit/vehicle/iphone/vehicle_iphone.c +++ b/navit/vehicle/iphone/vehicle_iphone.c @@ -127,7 +127,7 @@ vehicle_iphone_update(void *arg, strcpy(priv->str_time, str_time); priv->radius = radius; - dbg(lvl_debug,"position_get lat:%f lng:%f (spd:%f dir:%f time:%s)\n", priv->geo.lat, priv->geo.lng, priv->speed, priv->direction, priv->str_time); + dbg(lvl_debug,"position_get lat:%f lng:%f (spd:%f dir:%f time:%s)", priv->geo.lat, priv->geo.lng, priv->speed, priv->direction, priv->str_time); callback_list_call_attr_0(priv->cbl, attr_position_coord_geo); } @@ -141,7 +141,7 @@ vehicle_iphone_new(struct vehicle_methods struct vehicle_priv *ret; struct attr *interval,*speed,*position_coord_geo; - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); ret = g_new0(struct vehicle_priv, 1); ret->cbl = cbl; ret->interval=1000; @@ -154,7 +154,7 @@ vehicle_iphone_new(struct vehicle_methods if ((position_coord_geo=attr_search(attrs, NULL, attr_position_coord_geo))) { ret->geo=*(position_coord_geo->u.coord_geo); ret->position_set=1; - dbg(lvl_debug,"position_set %f %f\n", ret->geo.lat, ret->geo.lng); + dbg(lvl_debug,"position_set %f %f", ret->geo.lat, ret->geo.lng); } *meth = vehicle_iphone_methods; ret->str_time[0] = '\0'; @@ -168,6 +168,6 @@ vehicle_iphone_new(struct vehicle_methods void plugin_init(void) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); plugin_register_category_vehicle("iphone", vehicle_iphone_new); } diff --git a/navit/vehicle/maemo/vehicle_maemo.c b/navit/vehicle/maemo/vehicle_maemo.c index 015f1c8e3..2ff6296d5 100644 --- a/navit/vehicle/maemo/vehicle_maemo.c +++ b/navit/vehicle/maemo/vehicle_maemo.c @@ -72,7 +72,7 @@ static void vehicle_maemo_callback(LocationGPSDevice *device, gpointer user_data priv->sats_used=device->satellites_in_use; callback_list_call_attr_0(priv->cbl, attr_position_sats); - dbg(lvl_debug,"Got update with %u/%u satellites\n",priv->sats_used,priv->sats); + dbg(lvl_debug,"Got update with %u/%u satellites",priv->sats_used,priv->sats); if (device->fix) { switch(device->fix->mode) { @@ -91,28 +91,28 @@ static void vehicle_maemo_callback(LocationGPSDevice *device, gpointer user_data priv->geo.lng=device->fix->longitude; priv->hdop=device->fix->eph/100; callback_list_call_attr_0(priv->cbl, attr_position_coord_geo); - dbg(lvl_debug,"Position: %f %f with error %f meters\n",priv->geo.lat,priv->geo.lng,priv->hdop); + dbg(lvl_debug,"Position: %f %f with error %f meters",priv->geo.lat,priv->geo.lng,priv->hdop); } if (device->fix->fields & LOCATION_GPS_DEVICE_SPEED_SET) { priv->speed=device->fix->speed; callback_list_call_attr_0(priv->cbl, attr_position_speed); - dbg(lvl_debug,"Speed: %f\n ",priv->speed); + dbg(lvl_debug,"Speed: %f ",priv->speed); } if (device->fix->fields & LOCATION_GPS_DEVICE_TRACK_SET) { priv->direction=device->fix->track; - dbg(lvl_debug,"Direction: %f\n",priv->direction); + dbg(lvl_debug,"Direction: %f",priv->direction); } if (device->fix->fields & LOCATION_GPS_DEVICE_TIME_SET) { priv->fix_time=device->fix->time; - dbg(lvl_debug,"Time: %f\n",priv->fix_time); + dbg(lvl_debug,"Time: %f",priv->fix_time); } if (device->fix->fields & LOCATION_GPS_DEVICE_ALTITUDE_SET) { priv->height=device->fix->altitude; - dbg(lvl_debug,"Elevation: %f\n",priv->height); + dbg(lvl_debug,"Elevation: %f",priv->height); } } @@ -124,19 +124,19 @@ static void vehicle_maemo_error(LocationGPSDControl *control, LocationGPSDContro { switch (error) { case LOCATION_ERROR_USER_REJECTED_DIALOG: - dbg(lvl_error,"User didn't enable requested methods\n"); + dbg(lvl_error,"User didn't enable requested methods"); break; case LOCATION_ERROR_USER_REJECTED_SETTINGS: - dbg(lvl_error,"User changed settings, which disabled location\n"); + dbg(lvl_error,"User changed settings, which disabled location"); break; case LOCATION_ERROR_BT_GPS_NOT_AVAILABLE: - dbg(lvl_error,"Problems with BT GPS\n"); + dbg(lvl_error,"Problems with BT GPS"); break; case LOCATION_ERROR_METHOD_NOT_ALLOWED_IN_OFFLINE_MODE: - dbg(lvl_error,"Requested method is not allowed in offline mode\n"); + dbg(lvl_error,"Requested method is not allowed in offline mode"); break; case LOCATION_ERROR_SYSTEM: - dbg(lvl_error,"System error\n"); + dbg(lvl_error,"System error"); break; } } @@ -153,54 +153,54 @@ vehicle_maemo_open(struct vehicle_priv *priv) if (!strcasecmp(priv->source+8,"cwp")) { g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_CWP, NULL); - dbg(lvl_debug,"Method set: CWP\n"); + dbg(lvl_debug,"Method set: CWP"); } else if (!strcasecmp(priv->source+8,"acwp")) { g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_ACWP, NULL); - dbg(lvl_debug,"Method set: ACWP\n"); + dbg(lvl_debug,"Method set: ACWP"); } else if (!strcasecmp(priv->source+8,"gnss")) { g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_GNSS, NULL); - dbg(lvl_debug,"Method set: GNSS\n"); + dbg(lvl_debug,"Method set: GNSS"); } else if (!strcasecmp(priv->source+8,"agnss")) { g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_AGNSS, NULL); - dbg(lvl_debug,"Method set: AGNSS\n"); + dbg(lvl_debug,"Method set: AGNSS"); } else { g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_USER_SELECTED, NULL); - dbg(lvl_debug,"Method set: ANY\n"); + dbg(lvl_debug,"Method set: ANY"); } switch (priv->retry_interval) { case 2: g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_2S, NULL); - dbg(lvl_debug,"Interval set: 2s\n"); + dbg(lvl_debug,"Interval set: 2s"); break; case 5: g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_5S, NULL); - dbg(lvl_debug,"Interval set: 5s\n"); + dbg(lvl_debug,"Interval set: 5s"); break; case 10: g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_10S, NULL); - dbg(lvl_debug,"Interval set: 10s\n"); + dbg(lvl_debug,"Interval set: 10s"); break; case 20: g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_20S, NULL); - dbg(lvl_debug,"Interval set: 20s\n"); + dbg(lvl_debug,"Interval set: 20s"); break; case 30: g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_30S, NULL); - dbg(lvl_debug,"Interval set: 30s\n"); + dbg(lvl_debug,"Interval set: 30s"); break; case 60: g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_60S, NULL); - dbg(lvl_debug,"Interval set: 60s\n"); + dbg(lvl_debug,"Interval set: 60s"); break; case 120: g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_120S, NULL); - dbg(lvl_debug,"Interval set: 120s\n"); + dbg(lvl_debug,"Interval set: 120s"); break; case 1: default: g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_1S, NULL); - dbg(lvl_debug,"Interval set: 1s\n"); + dbg(lvl_debug,"Interval set: 1s"); break; } @@ -230,41 +230,41 @@ vehicle_maemo_position_attr_get(struct vehicle_priv *priv, struct attr * active=NULL; switch (type) { case attr_position_fix_type: - dbg(lvl_debug,"Attr requested: position_fix_type\n"); + dbg(lvl_debug,"Attr requested: position_fix_type"); attr->u.num = priv->fix_type; break; case attr_position_height: - dbg(lvl_debug,"Attr requested: position_height\n"); + dbg(lvl_debug,"Attr requested: position_height"); attr->u.numd = &priv->height; break; case attr_position_speed: - dbg(lvl_debug,"Attr requested: position_speed\n"); + dbg(lvl_debug,"Attr requested: position_speed"); attr->u.numd = &priv->speed; break; case attr_position_direction: - dbg(lvl_debug,"Attr requested: position_direction\n"); + dbg(lvl_debug,"Attr requested: position_direction"); attr->u.numd = &priv->direction; break; case attr_position_hdop: - dbg(lvl_debug,"Attr requested: position_hdop\n"); + dbg(lvl_debug,"Attr requested: position_hdop"); attr->u.numd = &priv->hdop; break; case attr_position_sats: - dbg(lvl_debug,"Attr requested: position_sats\n"); + dbg(lvl_debug,"Attr requested: position_sats"); attr->u.num = priv->sats; break; case attr_position_sats_used: - dbg(lvl_debug,"Attr requested: position_sats_used\n"); + dbg(lvl_debug,"Attr requested: position_sats_used"); attr->u.num = priv->sats_used; break; case attr_position_coord_geo: - dbg(lvl_debug,"Attr requested: position_coord_geo\n"); + dbg(lvl_debug,"Attr requested: position_coord_geo"); attr->u.coord_geo = &priv->geo; break; case attr_position_time_iso8601: { struct tm tm; - dbg(lvl_debug,"Attr requested: position_time_iso8601\n"); + dbg(lvl_debug,"Attr requested: position_time_iso8601"); if (!priv->fix_time) return 0; if (gmtime_r(&priv->fix_time, &tm)) { @@ -276,7 +276,7 @@ vehicle_maemo_position_attr_get(struct vehicle_priv *priv, } break; case attr_active: - dbg(lvl_debug,"Attr requested: position_active\n"); + dbg(lvl_debug,"Attr requested: position_active"); active = attr_search(priv->attrs,NULL,attr_active); if(active != NULL) { attr->u.num=active->u.num; @@ -304,7 +304,7 @@ vehicle_maemo_new_maemo(struct vehicle_methods struct vehicle_priv *ret; struct attr *source, *retry_int; - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); source = attr_search(attrs, NULL, attr_source); ret = g_new0(struct vehicle_priv, 1); ret->source = g_strdup(source->u.str); @@ -312,13 +312,13 @@ vehicle_maemo_new_maemo(struct vehicle_methods if (retry_int) { ret->retry_interval = retry_int->u.num; if (ret->retry_interval !=1 && ret->retry_interval !=2 && ret->retry_interval !=5 && ret->retry_interval !=10 && ret->retry_interval !=20 && ret->retry_interval !=30 && ret->retry_interval !=60 && ret->retry_interval !=120 ) { - dbg(lvl_error, "Retry interval %d invalid, setting to 1\n", ret->retry_interval,1); + dbg(lvl_error, "Retry interval %d invalid, setting to 1", ret->retry_interval,1); ret->retry_interval = 1; } } else { ret->retry_interval = 1; } - dbg(lvl_debug,"source: %s, interval: %u\n",ret->source,ret->retry_interval); + dbg(lvl_debug,"source: %s, interval: %u",ret->source,ret->retry_interval); ret->cbl = cbl; *meth = vehicle_maemo_methods; ret->attrs = attrs; @@ -329,6 +329,6 @@ vehicle_maemo_new_maemo(struct vehicle_methods void plugin_init(void) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); plugin_register_category_vehicle("maemo", vehicle_maemo_new_maemo); } diff --git a/navit/vehicle/null/vehicle_null.c b/navit/vehicle/null/vehicle_null.c index 6b723f9ff..1005328f6 100644 --- a/navit/vehicle/null/vehicle_null.c +++ b/navit/vehicle/null/vehicle_null.c @@ -67,7 +67,7 @@ struct vehicle_priv { static void vehicle_null_destroy(struct vehicle_priv *priv) { - dbg(lvl_debug,"enter\n"); + dbg(lvl_debug,"enter"); g_free(priv); } @@ -83,7 +83,7 @@ static int vehicle_null_position_attr_get(struct vehicle_priv *priv, enum attr_type type, struct attr *attr) { - dbg(lvl_debug,"enter %s\n",attr_to_name(type)); + dbg(lvl_debug,"enter %s",attr_to_name(type)); switch (type) { #if 0 case attr_position_fix_type: @@ -122,7 +122,7 @@ vehicle_null_position_attr_get(struct vehicle_priv *priv, default: return 0; } - dbg(lvl_debug,"ok\n"); + dbg(lvl_debug,"ok"); attr->type = type; return 1; } @@ -170,11 +170,11 @@ vehicle_null_new_null(struct vehicle_methods *meth, { struct vehicle_priv *ret; - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); ret = g_new0(struct vehicle_priv, 1); ret->cbl = cbl; *meth = vehicle_null_methods; - dbg(lvl_debug, "return\n"); + dbg(lvl_debug, "return"); return ret; } @@ -186,6 +186,6 @@ vehicle_null_new_null(struct vehicle_methods *meth, void plugin_init(void) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); plugin_register_category_vehicle("null", vehicle_null_new_null); } diff --git a/navit/vehicle/qt5/vehicle_qt5.cpp b/navit/vehicle/qt5/vehicle_qt5.cpp index fc8a6635a..6d263a649 100644 --- a/navit/vehicle/qt5/vehicle_qt5.cpp +++ b/navit/vehicle/qt5/vehicle_qt5.cpp @@ -63,14 +63,14 @@ QNavitGeoReceiver::QNavitGeoReceiver(QObject* parent, struct vehicle_priv* c) } void QNavitGeoReceiver::satellitesInUseUpdated(const QList<QGeoSatelliteInfo>& sats) { - dbg(lvl_debug, "Sats in use: %d\n", sats.count()); + dbg(lvl_debug, "Sats in use: %d", sats.count()); priv->sats_used = sats.count(); callback_list_call_attr_0(priv->cbl, attr_position_sats_used); } void QNavitGeoReceiver::satellitesInViewUpdated(const QList<QGeoSatelliteInfo>& sats) { - dbg(lvl_debug, "Sats in view: %d\n", sats.count()); + dbg(lvl_debug, "Sats in view: %d", sats.count()); priv->sats = sats.count(); callback_list_call_attr_0(priv->cbl, attr_position_qual); } @@ -81,23 +81,23 @@ void QNavitGeoReceiver::positionUpdated(const QGeoPositionInfo& info) /* ignore stale view */ if (info.coordinate().isValid()) { if (info.timestamp().toUTC().secsTo(QDateTime::currentDateTimeUtc()) > 20) { - dbg(lvl_debug, "Ignoring old FIX\n"); + dbg(lvl_debug, "Ignoring old FIX"); return; } } if (info.hasAttribute(QGeoPositionInfo::HorizontalAccuracy)) { - dbg(lvl_debug, "Horizontal acc (%f)\n", info.attribute(QGeoPositionInfo::HorizontalAccuracy)); + dbg(lvl_debug, "Horizontal acc (%f)", info.attribute(QGeoPositionInfo::HorizontalAccuracy)); priv->radius = info.attribute(QGeoPositionInfo::HorizontalAccuracy); callback_list_call_attr_0(priv->cbl, attr_position_radius); } if (info.hasAttribute(QGeoPositionInfo::GroundSpeed)) { - dbg(lvl_debug, "Got ground speed (%f)\n", info.attribute(QGeoPositionInfo::GroundSpeed)); + dbg(lvl_debug, "Got ground speed (%f)", info.attribute(QGeoPositionInfo::GroundSpeed)); priv->speed = info.attribute(QGeoPositionInfo::GroundSpeed) * 3.6; callback_list_call_attr_0(priv->cbl, attr_position_speed); } if (info.hasAttribute(QGeoPositionInfo::Direction)) { - dbg(lvl_debug, "Direction (%f)\n", info.attribute(QGeoPositionInfo::Direction)); + dbg(lvl_debug, "Direction (%f)", info.attribute(QGeoPositionInfo::Direction)); priv->direction = info.attribute(QGeoPositionInfo::Direction); callback_list_call_attr_0(priv->cbl, attr_position_direction); } @@ -115,19 +115,19 @@ void QNavitGeoReceiver::positionUpdated(const QGeoPositionInfo& info) } if (info.coordinate().isValid()) { - dbg(lvl_debug, "Got valid coordinate (lat %f, lon %f)\n", info.coordinate().latitude(), info.coordinate().longitude()); + dbg(lvl_debug, "Got valid coordinate (lat %f, lon %f)", info.coordinate().latitude(), info.coordinate().longitude()); priv->geo.lat = info.coordinate().latitude(); priv->geo.lng = info.coordinate().longitude(); priv->have_coords = 1; if (info.coordinate().type() == QGeoCoordinate::Coordinate3D) { - dbg(lvl_debug, "Got valid altitude (alt %f)\n", info.coordinate().altitude()); + dbg(lvl_debug, "Got valid altitude (alt %f)", info.coordinate().altitude()); priv->height = info.coordinate().altitude(); } - //dbg(lvl_debug, "Time %s\n", info.timestamp().toUTC().toString().toLatin1().data()); + //dbg(lvl_debug, "Time %s", info.timestamp().toUTC().toString().toLatin1().data()); priv->fix_time = info.timestamp().toUTC().toTime_t(); callback_list_call_attr_0(priv->cbl, attr_position_coord_geo); } else { - dbg(lvl_debug, "Got invalid coordinate\n"); + dbg(lvl_debug, "Got invalid coordinate"); priv->have_coords = 0; callback_list_call_attr_0(priv->cbl, attr_position_coord_geo); } @@ -142,7 +142,7 @@ void QNavitGeoReceiver::positionUpdated(const QGeoPositionInfo& info) static void vehicle_qt5_destroy(struct vehicle_priv* priv) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); if (priv->receiver != NULL) delete priv->receiver; if (priv->source != NULL) @@ -163,7 +163,7 @@ vehicle_qt5_position_attr_get(struct vehicle_priv* priv, enum attr_type type, struct attr* attr) { struct attr* active = NULL; - dbg(lvl_debug, "enter %s\n", attr_to_name(type)); + dbg(lvl_debug, "enter %s", attr_to_name(type)); switch (type) { case attr_position_valid: attr->u.num = priv->have_coords; @@ -205,9 +205,9 @@ vehicle_qt5_position_attr_get(struct vehicle_priv* priv, priv->fix_time = 0; return 0; } - //dbg(lvl_debug,"Fix Time: %s\n", priv->fixiso8601); + //dbg(lvl_debug,"Fix Time: %s", priv->fixiso8601); } else { - //dbg(lvl_debug,"Fix Time: 0\n"); + //dbg(lvl_debug,"Fix Time: 0"); return 0; } break; @@ -224,7 +224,7 @@ vehicle_qt5_position_attr_get(struct vehicle_priv* priv, default: return 0; } - dbg(lvl_debug, "ok\n"); + dbg(lvl_debug, "ok"); attr->type = type; return 1; } @@ -271,7 +271,7 @@ vehicle_qt5_new_qt5(struct vehicle_methods* meth, { struct vehicle_priv* ret; - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); ret = g_new0(struct vehicle_priv, 1); ret->cbl = cbl; *meth = vehicle_null_methods; @@ -279,16 +279,16 @@ vehicle_qt5_new_qt5(struct vehicle_methods* meth, ret->source = QGeoPositionInfoSource::createDefaultSource(NULL); ret->satellites = QGeoSatelliteInfoSource::createDefaultSource(NULL); if (ret->source == NULL) { - dbg(lvl_error, "Got NO QGeoPositionInfoSource\n"); + dbg(lvl_error, "Got NO QGeoPositionInfoSource"); } else { - dbg(lvl_debug, "Using %s\n", ret->source->sourceName().toLatin1().data()); + dbg(lvl_debug, "Using %s", ret->source->sourceName().toLatin1().data()); ret->receiver = new QNavitGeoReceiver(NULL, ret); ret->satellites->setUpdateInterval(1000); ret->satellites->startUpdates(); ret->source->setUpdateInterval(500); ret->source->startUpdates(); } - dbg(lvl_debug, "return\n"); + dbg(lvl_debug, "return"); return ret; } @@ -299,6 +299,6 @@ vehicle_qt5_new_qt5(struct vehicle_methods* meth, */ void plugin_init(void) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); plugin_register_category_vehicle("qt5", vehicle_qt5_new_qt5); } diff --git a/navit/vehicle/webos/bluetooth.c b/navit/vehicle/webos/bluetooth.c index 343d2ec5c..31e3a575e 100644 --- a/navit/vehicle/webos/bluetooth.c +++ b/navit/vehicle/webos/bluetooth.c @@ -25,10 +25,10 @@ static void mlPDL_ServiceCall_callback(struct callback_list *cbl, char *service, char *parameters/*, struct callback *fail_cb*/) { PDL_Err err; - dbg(lvl_debug,"PDL_ServiceCall(%s) parameters(%s)\n",service,parameters); + dbg(lvl_debug,"PDL_ServiceCall(%s) parameters(%s)",service,parameters); err = PDL_ServiceCall(service, parameters); if (err != PDL_NOERROR) { - dbg(lvl_error,"PDL_ServiceCall to (%s) with (%s) failed with (%d): (%s)\n", service, parameters, err, PDL_GetError()); + dbg(lvl_error,"PDL_ServiceCall to (%s) with (%s) failed with (%d): (%s)", service, parameters, err, PDL_GetError()); } callback_list_destroy(cbl); @@ -50,7 +50,7 @@ mlPDL_ServiceCall(const char *service, const char *parameters/*, struct callback callback_list_add(cbl, cb); -dbg(lvl_debug,"event_call_callback(%p)\n",cbl); +dbg(lvl_debug,"event_call_callback(%p)",cbl); event_call_callback(cbl); } @@ -65,10 +65,10 @@ mlPDL_ServiceCallWithCallback_callback(struct callback_list *cbl, PDL_bool removeAfterResponse) { PDL_Err err; - dbg(lvl_debug,"PDL_ServiceCallWithCallback(%s) parameters(%s)\n",service,parameters); + dbg(lvl_debug,"PDL_ServiceCallWithCallback(%s) parameters(%s)",service,parameters); err = PDL_ServiceCallWithCallback(service, parameters, callback, user, removeAfterResponse); if (err != PDL_NOERROR) { - dbg(lvl_error,"PDL_ServiceCallWithCallback to (%s) with (%s) failed with (%d): (%s)\n", service, parameters, err, PDL_GetError()); + dbg(lvl_error,"PDL_ServiceCallWithCallback to (%s) with (%s) failed with (%d): (%s)", service, parameters, err, PDL_GetError()); } callback_list_destroy(cbl); @@ -94,7 +94,7 @@ mlPDL_ServiceCallWithCallback(const char *service, callback_list_add(cbl, cb); - dbg(lvl_debug,"event_call_callback(%p)\n",cbl); + dbg(lvl_debug,"event_call_callback(%p)",cbl); event_call_callback(cbl); } @@ -107,11 +107,11 @@ vehicle_webos_init_pdl_locationtracking_callback(struct vehicle_priv *priv, stru priv->gps_type = param ? GPS_TYPE_INT: GPS_TYPE_NONE; - dbg(lvl_debug,"Calling PDL_EnableLocationTracking(%i)\n",param); + dbg(lvl_debug,"Calling PDL_EnableLocationTracking(%i)",param); err = PDL_EnableLocationTracking(param); if (err != PDL_NOERROR) { - dbg(lvl_error,"PDL_EnableLocationTracking failed with (%d): (%s)\n", err, PDL_GetError()); + dbg(lvl_error,"PDL_EnableLocationTracking failed with (%d): (%s)", err, PDL_GetError()); // vehicle_webos_close(priv); // return 0; } @@ -146,10 +146,10 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer) int valid=0; int ret = 0; - dbg(lvl_info, "enter: buffer='%s'\n", buffer); + dbg(lvl_info, "enter: buffer='%s'", buffer); for (;;) { if (len < 4) { - dbg(lvl_error, "'%s' too short\n", buffer); + dbg(lvl_error, "'%s' too short", buffer); return ret; } if (buffer[len - 1] == '\r' || buffer[len - 1] == '\n') { @@ -160,22 +160,22 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer) break; } if (buffer[0] != '$') { - dbg(lvl_error, "no leading $ in '%s'\n", buffer); + dbg(lvl_error, "no leading $ in '%s'", buffer); return ret; } if (buffer[len - 3] != '*') { - dbg(lvl_error, "no *XX in '%s'\n", buffer); + dbg(lvl_error, "no *XX in '%s'", buffer); return ret; } for (i = 1; i < len - 3; i++) { csum ^= (unsigned char) (buffer[i]); } if (!sscanf(buffer + len - 2, "%x", &bcsum) /*&& priv->checksum_ignore != 2*/) { - dbg(lvl_error, "no checksum in '%s'\n", buffer); + dbg(lvl_error, "no checksum in '%s'", buffer); return ret; } if (bcsum != csum /*&& priv->checksum_ignore == 0*/) { - dbg(lvl_error, "wrong checksum in '%s was %x should be %x'\n", buffer,bcsum,csum); + dbg(lvl_error, "wrong checksum in '%s was %x should be %x'", buffer,bcsum,csum); return ret; } @@ -184,7 +184,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer) g_free(priv->nmea_data_buf); priv->nmea_data_buf=nmea_data_buf; } else { - dbg(lvl_error, "nmea buffer overflow, discarding '%s'\n", buffer); + dbg(lvl_error, "nmea buffer overflow, discarding '%s'", buffer); } i = 0; p = buffer; @@ -203,7 +203,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer) priv->delta = 0; // (unsigned int)difftime(tv.tv_sec, priv->fix_time); // priv->fix_time = tv.tv_sec; -// dbg(lvl_info,"delta(%i)\n",priv->delta); +// dbg(lvl_info,"delta(%i)",priv->delta); // } if (!strncmp(&buffer[3], "GGA", 3)) { @@ -230,7 +230,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer) if (!g_strcasecmp(item[5],"W")) priv->geo.lng=-priv->geo.lng; priv->valid=attr_position_valid_valid; - dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng); + dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng); } else priv->valid=attr_position_valid_invalid; @@ -275,7 +275,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer) if (valid) { priv->track = g_ascii_strtod( item[1], NULL ); priv->speed = g_ascii_strtod( item[7], NULL ); - dbg(lvl_info,"direction %lf, speed %2.1lf\n", priv->track, priv->speed); + dbg(lvl_info,"direction %lf, speed %2.1lf", priv->track, priv->speed); } } if (!strncmp(&buffer[3], "RMC", 3)) { @@ -380,7 +380,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer) */ if (item[1]) { priv->magnetic_direction = g_ascii_strtod( item[1], NULL ); - dbg(lvl_debug,"magnetic %d\n", priv->magnetic_direction); + dbg(lvl_debug,"magnetic %d", priv->magnetic_direction); } } return ret; @@ -396,14 +396,14 @@ vehicle_webos_spp_handle_read(PDL_ServiceParameters *params, void *user) //PDL_Err err; size = PDL_GetParamInt(params, "dataLength"); if (size > buffer_size) { - dbg(lvl_error, "read returned too much data\n"); + dbg(lvl_error, "read returned too much data"); return; } char buffer[buffer_size]; PDL_GetParamString(params,"data",buffer,buffer_size); - dbg(lvl_debug,"data(%s) dataLength(%i)\n",buffer,size); + dbg(lvl_debug,"data(%s) dataLength(%i)",buffer,size); memmove(priv->buffer + priv->buffer_pos, buffer, size); @@ -411,12 +411,12 @@ vehicle_webos_spp_handle_read(PDL_ServiceParameters *params, void *user) priv->buffer_pos += size; priv->buffer[priv->buffer_pos] = '\0'; - dbg(lvl_debug, "size=%d pos=%d buffer='%s'\n", size, + dbg(lvl_debug, "size=%d pos=%d buffer='%s'", size, priv->buffer_pos, priv->buffer); str = priv->buffer; while ((tok = strchr(str, '\n'))) { *tok++ = '\0'; - dbg(lvl_debug, "line='%s'\n", str); + dbg(lvl_debug, "line='%s'", str); rc += vehicle_webos_parse_nmea(priv, str); str = tok; // if (priv->file_type == file_type_file && rc) @@ -427,10 +427,10 @@ vehicle_webos_spp_handle_read(PDL_ServiceParameters *params, void *user) size = priv->buffer + priv->buffer_pos - str; memmove(priv->buffer, str, size + 1); priv->buffer_pos = size; - dbg(lvl_debug,"now pos=%d buffer='%s'\n", + dbg(lvl_debug,"now pos=%d buffer='%s'", priv->buffer_pos, priv->buffer); } else if (priv->buffer_pos == buffer_size - 1) { - dbg(lvl_error,"Overflow. Most likely wrong baud rate or no nmea protocol\n"); + dbg(lvl_error,"Overflow. Most likely wrong baud rate or no nmea protocol"); priv->buffer_pos = 0; } if (rc) { @@ -466,7 +466,7 @@ vehicle_webos_spp_init_read(struct vehicle_priv *priv, unsigned int length) ); #if 0 if (err != PDL_NOERROR) { - dbg(lvl_error,"PDL_ServiceCall failed with (%d): (%s)\n", err, PDL_GetError()); + dbg(lvl_error,"PDL_ServiceCall failed with (%d): (%s)", err, PDL_GetError()); vehicle_webos_close(priv); return; } @@ -481,7 +481,7 @@ vehicle_webos_spp_handle_open(PDL_ServiceParameters *params, void *user) if (!priv->buffer) priv->buffer = g_malloc(buffer_size); - dbg(lvl_debug,"instanceId(%i)\n",priv->spp_instance_id); + dbg(lvl_debug,"instanceId(%i)",priv->spp_instance_id); priv->gps_type = GPS_TYPE_BT; @@ -497,27 +497,27 @@ vehicle_webos_spp_notify(PDL_ServiceParameters *params, void *user) char parameters[128]; const char *params_json = PDL_GetParamJson(params); - dbg(lvl_info,"params_json(%s)\n", params_json); + dbg(lvl_info,"params_json(%s)", params_json); if (PDL_ParamExists(params, "errorText")) { PDL_GetParamString(params, "errorText", notification, sizeof(notification)); - dbg(lvl_error,"errorText(%s)\n",notification); + dbg(lvl_error,"errorText(%s)",notification); return; } PDL_GetParamString(params, "notification", notification, sizeof(notification)); notification[sizeof(notification)-1] = '\0'; - dbg(lvl_warning,"notification(%s) %i\n",notification,PDL_ParamExists(params, "notification")); + dbg(lvl_warning,"notification(%s) %i",notification,PDL_ParamExists(params, "notification")); if(strcmp(notification,"notifnservicenames") == 0) { int instance_id = PDL_GetParamInt(params, "instanceId"); - dbg(lvl_debug,"instanceId(%i)\n", instance_id); + dbg(lvl_debug,"instanceId(%i)", instance_id); cJSON *root = cJSON_Parse(params_json); if (!root) { - dbg(lvl_error,"parsing json failed\n"); + dbg(lvl_error,"parsing json failed"); return; } @@ -544,7 +544,7 @@ vehicle_webos_spp_notify(PDL_ServiceParameters *params, void *user) PDL_TRUE); } else { - dbg(lvl_error,"notifnconnected error(%i)\n",PDL_GetParamInt(params,"error")); + dbg(lvl_error,"notifnconnected error(%i)",PDL_GetParamInt(params,"error")); } } else if(strcmp(notification,"notifndisconnected") == 0) { @@ -563,7 +563,7 @@ vehicle_webos_init_bt_gps(struct vehicle_priv *priv, char *addr) { char parameters[128]; - dbg(lvl_debug,"subscribeNotifications\n"); + dbg(lvl_debug,"subscribeNotifications"); mlPDL_ServiceCallWithCallback("palm://com.palm.bluetooth/spp/subscribenotifications", "{\"subscribe\":true}", (PDL_ServiceCallbackFunc)vehicle_webos_spp_notify, @@ -571,7 +571,7 @@ vehicle_webos_init_bt_gps(struct vehicle_priv *priv, char *addr) PDL_FALSE); #if 0 if (err != PDL_NOERROR) { - dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)\n", err, PDL_GetError()); + dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)", err, PDL_GetError()); vehicle_webos_close(priv); return; } @@ -581,7 +581,7 @@ vehicle_webos_init_bt_gps(struct vehicle_priv *priv, char *addr) mlPDL_ServiceCall("palm://com.palm.bluetooth/spp/connect", parameters); #if 0 if (err != PDL_NOERROR) { - dbg(lvl_error,"PDL_ServiceCall failed with (%d): (%s)\n", err, PDL_GetError()); + dbg(lvl_error,"PDL_ServiceCall failed with (%d): (%s)", err, PDL_GetError()); vehicle_webos_close(priv); return; } @@ -598,38 +598,38 @@ vehicle_webos_bt_gap_callback(PDL_ServiceParameters *params, void *param) char *device_addr = NULL; cJSON *root; - dbg(lvl_debug,"enter\n"); + dbg(lvl_debug,"enter"); PDL_Err err; err = PDL_GetParamInt(params, "errorCode"); if (err != PDL_NOERROR) { - dbg(lvl_error,"BT GAP Callback errorCode %d\n", err); + dbg(lvl_error,"BT GAP Callback errorCode %d", err); return /*PDL_EOTHER*/; } params_json = PDL_GetParamJson(params); - dbg(lvl_info,"params_json(%s)\n",params_json); + dbg(lvl_info,"params_json(%s)",params_json); root = cJSON_Parse(params_json); if (!root) { - dbg(lvl_error,"parsing json failed\n"); + dbg(lvl_error,"parsing json failed"); return; } cJSON *trusted_devices = cJSON_GetObjectItem(root, "trusteddevices"); unsigned int i,c = cJSON_GetArraySize(trusted_devices); - dbg(lvl_debug, "trusted_devices(%i)\n",c); + dbg(lvl_debug, "trusted_devices(%i)",c); for(i=0; i < c && !device_addr; i++) { cJSON *device = cJSON_GetArrayItem(trusted_devices,i); char *name = cJSON_GetObjectItem(device, "name")->valuestring; char *address = cJSON_GetObjectItem(device, "address")->valuestring; char *status = cJSON_GetObjectItem(device, "status")->valuestring; - dbg(lvl_debug,"i(%i) name(%s) address(%s) status(%s)\n",i,name,address,status); + dbg(lvl_debug,"i(%i) name(%s) address(%s) status(%s)",i,name,address,status); if (/*strncmp(status, "connected",9) == 0 && */strstr(name, "GPS") != NULL) { - dbg(lvl_debug,"choose name(%s) address(%s)\n",name,address); + dbg(lvl_debug,"choose name(%s) address(%s)",name,address); device_addr = g_strdup(address); break; } @@ -649,7 +649,7 @@ vehicle_webos_bt_open(struct vehicle_priv *priv) { // Try to connect to BT GPS, or use PDL method - dbg(lvl_debug,"enter\n"); + dbg(lvl_debug,"enter"); PDL_Err err; err = PDL_ServiceCallWithCallback("palm://com.palm.bluetooth/gap/gettrusteddevices", @@ -658,7 +658,7 @@ vehicle_webos_bt_open(struct vehicle_priv *priv) priv, PDL_TRUE); if (err != PDL_NOERROR) { - dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)\n", err, PDL_GetError()); + dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)", err, PDL_GetError()); vehicle_webos_close(priv); return 0; } @@ -668,7 +668,7 @@ vehicle_webos_bt_open(struct vehicle_priv *priv) void vehicle_webos_bt_close(struct vehicle_priv *priv) { - dbg(lvl_debug,"XXX\n"); + dbg(lvl_debug,"XXX"); char parameters[128]; if (priv->spp_instance_id) { snprintf(parameters, sizeof(parameters), "{\"instanceId\":%i}", priv->spp_instance_id); diff --git a/navit/vehicle/webos/vehicle_webos.c b/navit/vehicle/webos/vehicle_webos.c index c4bdcbaf2..8ba477305 100644 --- a/navit/vehicle/webos/vehicle_webos.c +++ b/navit/vehicle/webos/vehicle_webos.c @@ -59,7 +59,7 @@ vehicle_webos_callback(PDL_ServiceParameters *params, void *priv) err = PDL_GetParamInt(params, "errorCode"); if (err != 0) { - dbg(lvl_error,"Location Callback errorCode %d\n", err); + dbg(lvl_error,"Location Callback errorCode %d", err); return /*PDL_EOTHER*/; } @@ -93,14 +93,14 @@ vehicle_webos_gps_update(struct vehicle_priv *priv, PDL_Location *location) gettimeofday(&tv,NULL); priv->delta = (int)difftime(tv.tv_sec, priv->fix_time); - dbg(lvl_info,"delta(%i)\n",priv->delta); + dbg(lvl_info,"delta(%i)",priv->delta); priv->fix_time = tv.tv_sec; priv->geo.lat = location->latitude; /* workaround for webOS GPS bug following */ priv->geo.lng = (priv->pdk_version >= 200 && location->longitude >= -1 && location->longitude <= 1) ? -location->longitude : location->longitude; - dbg(lvl_info,"Location: %f %f %f %.12g %.12g +-%fm\n", + dbg(lvl_info,"Location: %f %f %f %.12g %.12g +-%fm", location->altitude, location->velocity, location->heading, @@ -134,7 +134,7 @@ vehicle_webos_timeout_callback(struct vehicle_priv *priv) int delta = (int)difftime(tv.tv_sec, priv->fix_time); if (delta >= priv->delta*2) { - dbg(lvl_warning, "GPS timeout triggered cb(%p) delta(%d)\n", priv->timeout_cb, delta); + dbg(lvl_warning, "GPS timeout triggered cb(%p) delta(%d)", priv->timeout_cb, delta); priv->delta = -1; @@ -165,7 +165,7 @@ vehicle_webos_open(struct vehicle_priv *priv) PDL_Err err; priv->pdk_version = PDL_GetPDKVersion(); - dbg(lvl_debug,"pdk_version(%d)\n", priv->pdk_version); + dbg(lvl_debug,"pdk_version(%d)", priv->pdk_version); if (priv->pdk_version <= 100) { // Use Location Service via callback interface @@ -175,7 +175,7 @@ vehicle_webos_open(struct vehicle_priv *priv) priv, PDL_FALSE); if (err != PDL_NOERROR) { - dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)\n", err, PDL_GetError()); + dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)", err, PDL_GetError()); vehicle_webos_close(priv); return 0; } @@ -184,7 +184,7 @@ vehicle_webos_open(struct vehicle_priv *priv) PDL_Err err; err = PDL_EnableLocationTracking(PDL_TRUE); if (err != PDL_NOERROR) { - dbg(lvl_error,"PDL_EnableLocationTracking failed with (%d): (%s)\n", err, PDL_GetError()); + dbg(lvl_error,"PDL_EnableLocationTracking failed with (%d): (%s)", err, PDL_GetError()); // vehicle_webos_close(priv); // return 0; } @@ -214,15 +214,15 @@ vehicle_webos_position_attr_get(struct vehicle_priv *priv, { switch (type) { case attr_position_height: - dbg(lvl_info,"Altitude: %f\n", priv->altitude); + dbg(lvl_info,"Altitude: %f", priv->altitude); attr->u.numd = &priv->altitude; break; case attr_position_speed: - dbg(lvl_info,"Speed: %f\n", priv->speed); + dbg(lvl_info,"Speed: %f", priv->speed); attr->u.numd = &priv->speed; break; case attr_position_direction: - dbg(lvl_info,"Direction: %f\n", priv->track); + dbg(lvl_info,"Direction: %f", priv->track); attr->u.numd = &priv->track; break; case attr_position_magnetic_direction: @@ -246,11 +246,11 @@ vehicle_webos_position_attr_get(struct vehicle_priv *priv, } break; case attr_position_coord_geo: - dbg(lvl_info,"Coord: %.12g %.12g\n", priv->geo.lat, priv->geo.lng); + dbg(lvl_info,"Coord: %.12g %.12g", priv->geo.lat, priv->geo.lng); attr->u.coord_geo = &priv->geo; break; case attr_position_radius: - dbg(lvl_info,"Radius: %f\n", priv->radius); + dbg(lvl_info,"Radius: %f", priv->radius); attr->u.numd = &priv->radius; break; case attr_position_time_iso8601: @@ -265,10 +265,10 @@ vehicle_webos_position_attr_get(struct vehicle_priv *priv, priv->fix_time = 0; return 0; } - dbg(lvl_info,"Fix Time: %d %s\n", priv->fix_time, priv->fixiso8601); + dbg(lvl_info,"Fix Time: %d %s", priv->fix_time, priv->fixiso8601); } else { - dbg(lvl_info,"Fix Time: %d\n", priv->fix_time); + dbg(lvl_info,"Fix Time: %d", priv->fix_time); return 0; } @@ -326,7 +326,7 @@ vehicle_webos_set_attr_do(struct vehicle_priv *priv, struct attr *attr, int init switch (attr->type) { case attr_source: if (strncmp(vehicle_webos_prefix,attr->u.str,strlen(vehicle_webos_prefix))) { - dbg(lvl_warning,"source must start with '%s'\n", vehicle_webos_prefix); + dbg(lvl_warning,"source must start with '%s'", vehicle_webos_prefix); return 0; } g_free(priv->source); @@ -388,7 +388,7 @@ vehicle_webos_new(struct vehicle_methods void plugin_init(void) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); plugin_register_category_vehicle("webos", vehicle_webos_new); } diff --git a/navit/vehicle/wince/vehicle_wince.c b/navit/vehicle/wince/vehicle_wince.c index 49f90b1f5..8ab59fdce 100644 --- a/navit/vehicle/wince/vehicle_wince.c +++ b/navit/vehicle/wince/vehicle_wince.c @@ -156,7 +156,7 @@ static void initBth(struct vehicle_priv *priv) priv->BthSetMode = (PFN_BthSetMode)GetProcAddress(priv->hBthDll, TEXT("BthSetMode") ); if( priv->BthSetMode && priv->BthSetMode(1) == ERROR_SUCCESS ) { - dbg(lvl_debug, "bluetooth activated\n"); + dbg(lvl_debug, "bluetooth activated"); succeeded = TRUE; } } @@ -164,13 +164,13 @@ static void initBth(struct vehicle_priv *priv) } else { - dbg(lvl_error, "Bluetooth library notfound\n"); + dbg(lvl_error, "Bluetooth library notfound"); } if ( !succeeded ) { - dbg(lvl_warning, "Bluetooth already enabled or failed to enable it.\n"); + dbg(lvl_warning, "Bluetooth already enabled or failed to enable it."); priv->BthSetMode = NULL; if ( priv->hBthDll ) { @@ -188,7 +188,7 @@ static int initDevice(struct vehicle_priv *priv) if ( priv->file_type == file_type_device ) { - dbg(lvl_debug, "Init Device\n"); + dbg(lvl_debug, "Init Device"); /* GPD0 is the control port for the GPS driver */ hGPS = CreateFile(L"GPD0:", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (hGPS != INVALID_HANDLE_VALUE) { @@ -209,7 +209,7 @@ static int initDevice(struct vehicle_priv *priv) NULL, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE) { Sleep(1000); - dbg(lvl_debug, "Waiting to connect to %s\n", priv->source); + dbg(lvl_debug, "Waiting to connect to %s", priv->source); } GetCommTimeouts (priv->m_hGPSDevice, &commTiming); commTiming.ReadIntervalTimeout = 20; @@ -240,11 +240,11 @@ static int initDevice(struct vehicle_priv *priv) } else { - dbg(lvl_debug, "Open File\n"); + dbg(lvl_debug, "Open File"); priv->m_hGPSDevice = CreateFileW( A2W(priv->source), GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); if ( priv->m_hGPSDevice == INVALID_HANDLE_VALUE) { - dbg(lvl_error, "Could not open %s\n", priv->source); + dbg(lvl_error, "Could not open %s", priv->source); return 0; } } @@ -274,7 +274,7 @@ static DWORD WINAPI wince_reader_thread (LPVOID lParam) DWORD bytes_read; int waitcounter; - dbg(lvl_debug, "GPS Port:[%s]\n", priv->source); + dbg(lvl_debug, "GPS Port:[%s]", priv->source); priv->thread_up = 1; if ( !initDevice(priv) ) { @@ -282,7 +282,7 @@ static DWORD WINAPI wince_reader_thread (LPVOID lParam) } while (priv->is_running) { - dbg(lvl_debug,"readfile\n"); + dbg(lvl_debug,"readfile"); waitcounter = 0; status = ReadFile(priv->m_hGPSDevice, chunk_buffer, sizeof(chunk_buffer), @@ -290,7 +290,7 @@ static DWORD WINAPI wince_reader_thread (LPVOID lParam) if ( !status ) { - dbg(lvl_error,"Error reading file/device. Try again.\n"); + dbg(lvl_error,"Error reading file/device. Try again."); initDevice(priv); continue; } @@ -300,24 +300,24 @@ static DWORD WINAPI wince_reader_thread (LPVOID lParam) /* TODO (rikky#1#): should use blocking */ if ( priv->file_type != file_type_file ) { - dbg(lvl_debug, "GPS data comes too fast. Have to wait here\n"); + dbg(lvl_debug, "GPS data comes too fast. Have to wait here"); } Sleep(50); waitcounter++; if ( waitcounter % 8 == 0 ) { - dbg(lvl_debug, "Remind them of the data\n"); + dbg(lvl_debug, "Remind them of the data"); event_call_callback(priv->priv_cbl); } if(waitcounter % 200 == 0) { - dbg(lvl_error,"Will main thread ever be ready for the GPS data? Already %d intervals gone.\n",waitcounter); + dbg(lvl_error,"Will main thread ever be ready for the GPS data? Already %d intervals gone.",waitcounter); } } if(waitcounter>2) - dbg(lvl_debug,"Sent GPS data to the main thread after %d intervals delay.\n",waitcounter); + dbg(lvl_debug,"Sent GPS data to the main thread after %d intervals delay.",waitcounter); g_mutex_lock(&priv->lock); memcpy(priv->read_buffer + priv->read_buffer_pos , chunk_buffer, bytes_read ); @@ -358,11 +358,11 @@ vehicle_wince_available_ports(void) regdevtype_length = sizeof(devicetype); if ( RegQueryValueEx( hkSubResult, L"Key", NULL, NULL, (LPBYTE)devicetype, ®devtype_length) == ERROR_SUCCESS ) { - dbg(lvl_debug, "Found device '%s' (%s)\n", W2A(devicename), W2A(devicetype)); + dbg(lvl_debug, "Found device '%s' (%s)", W2A(devicename), W2A(devicetype)); } else { - dbg(lvl_debug, "Found device '%s'\n", W2A(devicename)); + dbg(lvl_debug, "Found device '%s'", W2A(devicename)); } } RegCloseKey(hkSubResult); @@ -412,7 +412,7 @@ vehicle_wince_open(struct vehicle_priv *priv) char* strport; char* strsettings; - dbg(lvl_debug, "enter vehicle_wince_open, priv->source='%s'\n", priv->source); + dbg(lvl_debug, "enter vehicle_wince_open, priv->source='%s'", priv->source); if (priv->source ) { @@ -431,7 +431,7 @@ vehicle_wince_open(struct vehicle_priv *priv) *strsettings = '\0'; strsettings++; - dbg(lvl_debug, "serial('%s', '%s')\n", strport, strsettings ); + dbg(lvl_debug, "serial('%s', '%s')", strport, strsettings ); } if (raw_setting_str) g_free( raw_setting_str ); @@ -456,10 +456,10 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer) int valid=0; int ret = 0; - dbg(lvl_info, "enter: buffer='%s'\n", buffer); + dbg(lvl_info, "enter: buffer='%s'", buffer); for (;;) { if (len < 4) { - dbg(lvl_error, "'%s' too short\n", buffer); + dbg(lvl_error, "'%s' too short", buffer); return ret; } if (buffer[len - 1] == '\r' || buffer[len - 1] == '\n') { @@ -470,22 +470,22 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer) break; } if (buffer[0] != '$') { - dbg(lvl_error, "no leading $ in '%s'\n", buffer); + dbg(lvl_error, "no leading $ in '%s'", buffer); return ret; } if (buffer[len - 3] != '*') { - dbg(lvl_error, "no *XX in '%s'\n", buffer); + dbg(lvl_error, "no *XX in '%s'", buffer); return ret; } for (i = 1; i < len - 3; i++) { csum ^= (unsigned char) (buffer[i]); } if (!sscanf(buffer + len - 2, "%x", &bcsum) && priv->checksum_ignore != 2) { - dbg(lvl_error, "no checksum in '%s'\n", buffer); + dbg(lvl_error, "no checksum in '%s'", buffer); return ret; } if (bcsum != csum && priv->checksum_ignore == 0) { - dbg(lvl_error, "wrong checksum in '%s'\n", buffer); + dbg(lvl_error, "wrong checksum in '%s'", buffer); return ret; } @@ -494,7 +494,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer) g_free(priv->nmea_data_buf); priv->nmea_data_buf=nmea_data_buf; } else { - dbg(lvl_error, "nmea buffer overflow, discarding '%s'\n", buffer); + dbg(lvl_error, "nmea buffer overflow, discarding '%s'", buffer); } i = 0; p = buffer; @@ -541,7 +541,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer) strncpy(priv->fixtime, item[1], sizeof(priv->fixtime)); } - dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng); + dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng); } else { if (priv->valid == attr_position_valid_valid) @@ -575,7 +575,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer) if (valid) { priv->direction = g_ascii_strtod( item[1], NULL ); priv->speed = g_ascii_strtod( item[7], NULL ); - dbg(lvl_info,"direction %lf, speed %2.1lf\n", priv->direction, priv->speed); + dbg(lvl_info,"direction %lf, speed %2.1lf", priv->direction, priv->speed); } } if (!strncmp(&buffer[3], "RMC", 3)) { @@ -625,7 +625,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer) strncpy(priv->fixtime, item[1], sizeof(priv->fixtime)); } - dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng); + dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng); } else { if (priv->valid == attr_position_valid_valid) @@ -697,7 +697,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer) */ if (item[1]) { priv->magnetic_direction = g_ascii_strtod( item[1], NULL ); - dbg(lvl_debug,"magnetic %d\n", priv->magnetic_direction); + dbg(lvl_debug,"magnetic %d", priv->magnetic_direction); } } return ret; @@ -709,7 +709,7 @@ vehicle_wince_io(struct vehicle_priv *priv) int size, rc = 0; char *str, *tok; - dbg(lvl_debug, "vehicle_file_io : enter\n"); + dbg(lvl_debug, "vehicle_file_io : enter"); size = read_win32(priv, priv->buffer + priv->buffer_pos, buffer_size - priv->buffer_pos - 1); @@ -730,12 +730,12 @@ vehicle_wince_io(struct vehicle_priv *priv) } priv->buffer_pos += size; priv->buffer[priv->buffer_pos] = '\0'; - dbg(lvl_debug, "size=%d pos=%d buffer='%s'\n", size, + dbg(lvl_debug, "size=%d pos=%d buffer='%s'", size, priv->buffer_pos, priv->buffer); str = priv->buffer; while ((tok = strchr(str, '\n'))) { *tok++ = '\0'; - dbg(lvl_debug, "line='%s'\n", str); + dbg(lvl_debug, "line='%s'", str); rc +=vehicle_wince_parse(priv, str); str = tok; if (priv->file_type == file_type_file && rc) @@ -746,7 +746,7 @@ vehicle_wince_io(struct vehicle_priv *priv) size = priv->buffer + priv->buffer_pos - str; memmove(priv->buffer, str, size + 1); priv->buffer_pos = size; - dbg(lvl_info, "now pos=%d buffer='%s'\n", + dbg(lvl_info, "now pos=%d buffer='%s'", priv->buffer_pos, priv->buffer); } else if (priv->buffer_pos == buffer_size - 1) { dbg(lvl_error, @@ -876,7 +876,7 @@ vehicle_wince_position_attr_get(struct vehicle_priv *priv, attr->u.str=priv->fixiso8601; break; case attr_position_sat_item: - dbg(lvl_debug,"at here\n"); + dbg(lvl_debug,"at here"); priv->sat_item.id_lo++; if (priv->sat_item.id_lo > priv->current_count) { priv->sat_item.id_lo=0; @@ -967,7 +967,7 @@ vehicle_wince_new(struct vehicle_methods struct attr *handle_bluetooth; char *cp; - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); source = attr_search(attrs, NULL, attr_source); ret = g_new0(struct vehicle_priv, 1); ret->fd = -1; @@ -1006,7 +1006,7 @@ vehicle_wince_new(struct vehicle_methods ret->on_eof=1; if (on_eof && !g_strcasecmp(on_eof->u.str, "exit")) ret->on_eof=2; - dbg(lvl_debug,"on_eof=%d\n", ret->on_eof); + dbg(lvl_debug,"on_eof=%d", ret->on_eof); *meth = vehicle_wince_methods; ret->priv_cbl = callback_list_new(); callback_list_add(ret->priv_cbl, callback_new_1(callback_cast(vehicle_wince_io), ret)); @@ -1026,7 +1026,7 @@ vehicle_wince_new(struct vehicle_methods vehicle_wince_enable_watch(ret); return ret; } - dbg(lvl_error, "Failed to open '%s'\n", ret->source); + dbg(lvl_error, "Failed to open '%s'", ret->source); vehicle_wince_destroy(ret); return NULL; } @@ -1037,7 +1037,7 @@ vehicle_wince_new(struct vehicle_methods void plugin_init(void) { - dbg(lvl_debug, "enter\n"); + dbg(lvl_debug, "enter"); plugin_register_category_vehicle("wince", vehicle_wince_new); plugin_register_category_vehicle("file", vehicle_wince_new); } |