summaryrefslogtreecommitdiff
path: root/navit/traffic
diff options
context:
space:
mode:
authormvglasow <michael -at- vonglasow.com>2017-11-25 16:20:40 +0100
committermvglasow <michael -at- vonglasow.com>2017-11-25 16:20:40 +0100
commit07c131ca8ae4753b80a21fdd3652eb4803e4e380 (patch)
tree47f5304bfeace7a400548c7c69b5d60c2d98f15c /navit/traffic
parent69f93b4afcdb00439d3d498977ad22eb41b971bd (diff)
downloadnavit-07c131ca8ae4753b80a21fdd3652eb4803e4e380.tar.gz
Add:traffic/dummy:Function to add dummy report
Signed-off-by: mvglasow <michael -at- vonglasow.com>
Diffstat (limited to 'navit/traffic')
-rw-r--r--navit/traffic/dummy/traffic_dummy.c22
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.