From 848fd66e2c77bd8905ea7217242376d2eceb87f7 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 29 Apr 2013 10:06:48 +0200 Subject: [PATCH] Fix incorrect extraction of vert_rate_sign. See issue #26. Thanks to @vk1et for reporting and fixing. --- dump1090.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dump1090.c b/dump1090.c index 04ed42e..3837c57 100644 --- a/dump1090.c +++ b/dump1090.c @@ -1078,7 +1078,7 @@ void decodeModesMessage(struct modesMessage *mm, unsigned char *msg) { mm->ns_dir = (msg[7]&0x80) >> 7; mm->ns_velocity = ((msg[7]&0x7f) << 3) | ((msg[8]&0xe0) >> 5); mm->vert_rate_source = (msg[8]&0x10) >> 4; - mm->vert_rate_sign = (msg[8]&0x8) >> 5; + mm->vert_rate_sign = (msg[8]&0x8) >> 3; mm->vert_rate = ((msg[8]&7) << 6) | ((msg[9]&0xfc) >> 2); /* Compute velocity and angle from the two speed * components. */