Skip to content

Instantly share code, notes, and snippets.

@barbeau
Created July 7, 2021 20:38
Show Gist options
  • Save barbeau/560201dfdc294ad0755fa6e6a381fe5e to your computer and use it in GitHub Desktop.
Save barbeau/560201dfdc294ad0755fa6e6a381fe5e to your computer and use it in GitHub Desktop.
/**
* Parses a string array containing an updates to the navigation message and return the most
* recent {@link GpsNavMessageProto}.
*/
public void parseHwNavigationMessageUpdates(GnssNavigationMessage navigationMessage) {
byte messagePrn = (byte) navigationMessage.getSvid();
byte messageType = (byte) (navigationMessage.getType() >> 8);
int subMessageId = navigationMessage.getSubmessageId();
byte[] messageRawData = navigationMessage.getData();
// parse only GPS navigation messages for now
if (messageType == 1) {
mGpsNavigationMessageStore.onNavMessageReported(
messagePrn, messageType, (short) subMessageId, messageRawData);
mHardwareGpsNavMessageProto = mGpsNavigationMessageStore.createDecodedNavMessage();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment