Skip to content

Commit

Permalink
fix isTimestampValid never true
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert108 committed Nov 18, 2024
1 parent 27d7aa4 commit 1b6c206
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions iso22133.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,10 +782,10 @@ enum ISOMessageReturnValue convertSTRTToHostRepresentation(
const struct timeval* currentTime,
StartMessageType * startData) {
uint16_t gpsWeek = 0;
startData->isTimestampValid = 1;
if (currentTime) {
gpsWeek = (uint16_t)getAsGPSWeek(currentTime);
}

if (!STRTData || !startData) {
errno = EINVAL;
fprintf(stderr, "STRT input pointer error");
Expand All @@ -805,7 +805,6 @@ enum ISOMessageReturnValue convertSTRTToHostRepresentation(
}
else {
if (currentTime && STRTData->GPSWeek != gpsWeek) {
fprintf(stderr, "Parsed STRT message with non-matching GPS week");
startData->isTimestampValid = 0;
return MESSAGE_OK;
}
Expand Down

0 comments on commit 1b6c206

Please sign in to comment.