-
Notifications
You must be signed in to change notification settings - Fork 86
I123 glo decoder error detector #337
I123 glo decoder error detector #337
Conversation
@adel-mamin, please review. |
|
||
return 0; /* The string is good */ | ||
|
||
else if ((bit_set > 0 && !c_sum) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove 'else' here and below, since otherwise we always return?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I'd prefer the else's removed, but it's not a big deal.
Looks good to me. |
{ | ||
assert(n_bits <= 32 && n_bits > 0); | ||
assert(bit_index <= 85 && bit_index > 0); | ||
assert(bit_index <= GLO_STR_LEN && bit_index > 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return error if parameters are invalid. Do not assert here.
#include <libswiftnav/logging.h> | ||
#include <libswiftnav/bits.h> | ||
|
||
#ifdef UNIT_TEST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to move this to check_glo_decoder.c which includes this file.
#include <libswiftnav/logging.h>
#undef log_error
#define log_error(...)
#include "nav_msg_glo.c"
See my inline comments, but otherwise looks good. I haven't checked the algorithm, I'll take that on faith. |
Corrected. Thanks @gsmcmullin, @adel-mamin and @valeri-atamaniouk |
The commit adds error detection algorithm for GLO nav messages + unit tests.
Requires: https://github.com/swift-nav/libswiftnav/pull/329