You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor CLI to use crate library functions (eliminate code duplication) (#9) (#10)
* refactor: import GPS conversion functions from crate library
- Add import for convert_gps_coordinate, convert_gps_altitude,
convert_gps_speed, convert_gps_course from bbl_parser::conversion
- Remove duplicate conversion function definitions from CLI main.rs
- Eliminates ~40 lines of duplicated code
- Addresses Issue #9: Refactor CLI to use crate library functions
* refactor: import flag formatting functions from crate library
- Add imports for format_flight_mode_flags, format_state_flags,
format_failsafe_phase from bbl_parser::conversion
- Remove ~90 lines of duplicate formatting function definitions
- Addresses Issue #9: Refactor CLI to use crate library functions
* refactor: migrate crate library to use anyhow::Result
This enables CLI and crate to share the same error handling pattern,
which is a prerequisite for deduplicating stream and parser code.
- parser/stream.rs: use anyhow::Result instead of BBLError
- parser/decoder.rs: use anyhow::anyhow! for error messages
- parser/event.rs: use anyhow::Result
- parser/frame.rs: use anyhow::Result
- parser/gps.rs: use anyhow::Result
- parser/header.rs: use anyhow::Result and anyhow::anyhow!
- parser/main.rs: use anyhow::Result
- export.rs: use anyhow::Result
Addresses Issue #9: Refactor CLI to use crate library functions
* fix: align crate parse_h_frame and 14-bit encoding with CLI behavior
- parser/gps.rs: parse_h_frame now uses graceful fallback for unknown
encodings (read_signed_vb with unwrap_or(0)) matching CLI behavior
- parser/stream.rs: read_neg_14bit now uses sign-magnitude encoding
matching CLI's bbl_format::sign_extend_14bit + negation
- Updated tests for sign-magnitude encoding
- Removed unused two's complement sign extension function
This ensures crate's H-frame parsing matches the working CLI logic.
Addresses Issue #9: CLI logic takes precedence
0 commit comments