diff options
Diffstat (limited to 'navit/traffic/dummy/traffic_dummy.c')
-rw-r--r-- | navit/traffic/dummy/traffic_dummy.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/navit/traffic/dummy/traffic_dummy.c b/navit/traffic/dummy/traffic_dummy.c index fac0c75bc..c0f74199b 100644 --- a/navit/traffic/dummy/traffic_dummy.c +++ b/navit/traffic/dummy/traffic_dummy.c @@ -62,6 +62,28 @@ void traffic_idle(struct traffic * this_) { } /** + * @brief Inserts a dummy traffic report. + * + * This will report one single message, indicating queuing traffic on the A9 Munich–Nuremberg between + * Neufahrn and Allershausen. This mimics a TMC message in that coordinates are approximate, TMC + * identifiers are supplied for the location and extra data fields which can be inferred from the TMC + * location table are filled. The message purports to just have been received for the first time, and + * expire in 24 hours. + */ +void traffic_dummy_report(void) { + struct traffic_message ** messages = g_new0(struct traffic_message *, 1); + struct traffic_point * from = traffic_point_new(11.6208, 48.3164, "Neufahrn", "68", "12732-4"); + struct traffic_point * to = traffic_point_new(11.5893, 48.429, "Allershausen", "67", "12732"); + struct trafic_location * location = traffic_location_new(NULL, from, to, "Nürnberg", NULL, + location_dir_one, location_fuzziness_low_res, location_ramps_none, type_highway_land, + NULL, "A9", "58:1", -1); + + messages[0] = traffic_message_new_single_event("dummy:A9-68-67", time(NULL), time(NULL), + time(NULL) + 86400, 0, 0, location, event_class_congestion, event_congestion_queue); + traffic_report_messages(1, messages); +} + +/** * @brief Initializes the traffic plugin. * * This function is called once on startup. |