From 5e6460ecd7ae28e9a09c3f5134111b49bca83d76 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 8 May 2015 08:50:10 +0200 Subject: hafas: Both 0x10 and 0x20 flags seem to indicate cancelled trips While 0x30 seems to indicate "trip cancelled", 0x20 seems to be "just" "stop skipped". --- libplanfahr/providers/hafas-bin6-format.h | 5 ++++- libplanfahr/providers/hafas-bin6.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libplanfahr/providers/hafas-bin6-format.h b/libplanfahr/providers/hafas-bin6-format.h index 7b4fd68..e4b3813 100644 --- a/libplanfahr/providers/hafas-bin6-format.h +++ b/libplanfahr/providers/hafas-bin6-format.h @@ -231,7 +231,10 @@ typedef struct _HafasBin6TripPartDetail { guint16 stops_cnt; /* number of stops */ /* 0x0e */ } HafasBin6TripPartDetail; -#define HAFAS_BIN6_PART_DETAIL_FLAGS_CANCELED 0x10 /* trip was cancelled */ +#define HAFAS_BIN6_PART_DETAIL_FLAGS_STOP_CANCELED 0x20 /* stop was cancelled */ +#define HAFAS_BIN6_PART_DETAIL_FLAGS_TRIP_CANCELED 0x30 /* trip was cancelled */ + +#define HAFAS_BIN6_PART_DETAIL_FLAGS_CANCELED_MASK 0x30 /* trip was cancelled */ /** * HafasBin6Stop: diff --git a/libplanfahr/providers/hafas-bin6.c b/libplanfahr/providers/hafas-bin6.c index 35b071c..2b2ac1b 100644 --- a/libplanfahr/providers/hafas-bin6.c +++ b/libplanfahr/providers/hafas-bin6.c @@ -358,7 +358,7 @@ hafas_bin6_parse_each_trip (const gchar *data, gsize num, guint base, const char pd = HAFAS_BIN6_TRIP_PART_DETAIL(data, i, j); LPF_DEBUG("Trip-Part #%d, Flags: %4d", j, pd->flags); - if (pd->flags & HAFAS_BIN6_PART_DETAIL_FLAGS_CANCELED) { + if (pd->flags & HAFAS_BIN6_PART_DETAIL_FLAGS_CANCELED_MASK) { status = LPF_TRIP_STATUS_FLAGS_CANCELED; } -- cgit v1.2.3