Python library for parsing and generating NMEA 0183 protocol messages used in GPS and marine navigation systems
77
A utility for validating marine navigation data messages to ensure data integrity.
Validates navigation data messages by verifying their integrity checksums. Messages follow the format: $<data>*<checksum> where the checksum is a two-digit hexadecimal value computed from the message data.
Computes integrity checksums for navigation data messages using standard XOR algorithm.
@generates
def validate_message(message: str) -> bool:
"""
Validates a navigation data message by checking its integrity checksum.
Args:
message: A navigation data message string in the format "$<data>*<checksum>"
Returns:
True if the message has a valid checksum, False otherwise
Raises:
ValueError: If the message format is invalid
"""
pass
def compute_checksum(data: str) -> str:
"""
Computes the integrity checksum for navigation data.
Args:
data: The message data (without $ prefix or * and checksum suffix)
Returns:
A two-digit hexadecimal string representing the checksum
"""
passProvides NMEA 0183 protocol parsing and validation support.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-pynmea2docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10