Skip to content

Instantly share code, notes, and snippets.

@barbeau
Created July 7, 2021 20:41
Show Gist options
  • Save barbeau/674c6afcbca2cddee3eb64a1c2952505 to your computer and use it in GitHub Desktop.
Save barbeau/674c6afcbca2cddee3eb64a1c2952505 to your computer and use it in GitHub Desktop.
/**
* Handles a fresh Navigation Message. The message is in its raw format.
*/
public void onNavMessageReported(byte prn, byte type, short id, byte[] rawData) {
Preconditions.checkArgument(type == 1, "Unsupported NavigationMessage Type: " + type);
Preconditions.checkArgument(
rawData != null && rawData.length == L1_CA_MESSAGE_LENGTH_BYTES,
"Invalid length of rawData for L1 C/A");
synchronized (fullyDecodedIntermediateEphemerides) {
switch (id) {
case 1:
handleFirstSubframe(prn, rawData);
break;
case 2:
handleSecondSubframe(prn, rawData);
break;
case 3:
handleThirdSubframe(prn, rawData);
break;
case 4:
handleFourthSubframe(rawData);
break;
case 5:
break;
default:
// invalid message id
throw new IllegalArgumentException("Invalid Subframe ID: " + id);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment