Ticket #610: navit_3471_ticket_610.patch

File navit_3471_ticket_610.patch, 4.9 KB (added by mvglasow (2), 11 years ago)

Restore broken GPS logging

  • navit/vehicle.c

     
    388388        }
    389389}
    390390
     391/**
     392 * Writes to an NMEA log.
     393 *
     394 * @param this_ Pointer to the vehicle structure of the data source
     395 * @param log Pointer to a log structure for the log file
     396 */
    391397static void
    392398vehicle_log_nmea(struct vehicle *this_, struct log *log)
    393399{
     
    432438        g_free(end);
    433439}
    434440
     441/**
     442 * Writes to a GPX log.
     443 *
     444 * @param this_ Pointer to the vehicle structure of the data source
     445 * @param log Pointer to a log structure for the log file
     446 */
    435447static void
    436448vehicle_log_gpx(struct vehicle *this_, struct log *log)
    437449{
     
    447459        else
    448460                attr_types=NULL;
    449461        if (this_->meth.position_attr_get(this_->priv, attr_position_fix_type, &fix_attr)) {
    450                 if (fix_attr.u.num != 2 && fix_attr.u.num != 3)
     462                if (!fix_attr.u.num)
    451463                        return;
    452464        }
    453465        if (!this_->meth.position_attr_get(this_->priv, attr_position_coord_geo, &attr))
     
    488500        g_free(logstr);
    489501}
    490502
     503/**
     504 * Writes to a text log.
     505 *
     506 * @param this_ Pointer to the vehicle structure of the data source
     507 * @param log Pointer to a log structure for the log file
     508 */
    491509static void
    492510vehicle_log_textfile(struct vehicle *this_, struct log *log)
    493511{
     
    496514        if (!this_->meth.position_attr_get)
    497515                return;
    498516        if (this_->meth.position_attr_get(this_->priv, attr_position_fix_type, &fix_attr)) {
    499                 if (fix_attr.u.num != 2 && fix_attr.u.num != 3)
     517                if (!fix_attr.u.num)
    500518                        return;
    501519        }
    502520        if (!this_->meth.position_attr_get(this_->priv, attr_position_coord_geo, &pos_attr))
     
    506524        log_write(log, logstr, strlen(logstr), 0);
    507525}
    508526
     527/**
     528 * Writes to a binary log.
     529 *
     530 * @param this_ Pointer to the vehicle structure of the data source
     531 * @param log Pointer to a log structure for the log file
     532 */
    509533static void
    510534vehicle_log_binfile(struct vehicle *this_, struct log *log)
    511535{
     
    519543        if (!this_->meth.position_attr_get)
    520544                return;
    521545        if (this_->meth.position_attr_get(this_->priv, attr_position_fix_type, &fix_attr)) {
    522                 if (fix_attr.u.num != 2 && fix_attr.u.num != 3)
     546                if (!fix_attr.u.num)
    523547                        return;
    524548        }
    525549        if (!this_->meth.position_attr_get(this_->priv, attr_position_coord_geo, &pos_attr))
     
    560584        }
    561585}
    562586
     587/**
     588 * Register a new log to receive data.
     589 *
     590 * @param this_ Pointer to the vehicle structure of the data source
     591 * @param log Pointer to a log structure for the log file
     592 */
    563593static int
    564594vehicle_add_log(struct vehicle *this_, struct log *log)
    565595{
  • navit/vehicle/android/vehicle_android.c

     
    5959/**
    6060 * @brief Free the android_vehicle
    6161 *
    62  * @param priv
     62 * @param priv pointer to a vehicle_priv structure for the vehicle
    6363 * @returns nothing
    6464 */
    6565static void
     
    7070}
    7171
    7272/**
    73  * @brief Provide the outside with information
    74  * 
    75  * @param priv
    76  * @param type TODO: What can this be?
    77  * @param attr
    78  * @returns true/false
     73 * @brief Retrieves a vehicle attribute.
     74 *
     75 * @param priv pointer to a vehicle_priv structure for the vehicle
     76 * @param type an attr_type specifying the attribute to retrieve
     77 * @param attr pointer to an attr structure that will receive the attribute data
     78 * @returns true for success, false for failure
    7979 */
    8080static int
    8181vehicle_android_position_attr_get(struct vehicle_priv *priv,
  • navit/vehicle/wince/vehicle_wince.c

     
    578578}
    579579
    580580
     581/**
     582 * @brief Free the wince_vehicle
     583 *
     584 * @param priv pointer to a vehicle_priv structure for the vehicle
     585 * @returns nothing
     586 */
    581587static void
    582588vehicle_wince_destroy(struct vehicle_priv *priv)
    583589{
     
    589595        g_free(priv);
    590596}
    591597
     598/**
     599 * @brief Retrieves a vehicle attribute.
     600 *
     601 * @param priv pointer to a vehicle_priv structure for the vehicle
     602 * @param type an attr_type specifying the attribute to retrieve
     603 * @param attr pointer to an attr structure that will receive the attribute data
     604 * @returns true for success, false for failure
     605 */
    592606static int
    593607vehicle_wince_position_attr_get(struct vehicle_priv *priv,
    594608                               enum attr_type type, struct attr *attr)
     
    658672        vehicle_wince_position_attr_get,
    659673};
    660674
     675/**
     676 * @brief Create wince_vehicle
     677 *
     678 * @param meth
     679 * @param cbl
     680 * @param attrs
     681 * @returns vehicle_priv
     682 */
    661683static struct vehicle_priv *
    662684vehicle_wince_new(struct vehicle_methods
    663685                      *meth, struct callback_list
     
    720742        return NULL;
    721743}
    722744
     745/**
     746 * @brief register vehicle_wince
     747 *
     748 * @returns nothing
     749 */
    723750void
    724751plugin_init(void)
    725752{