Skip to content

Migrate GPS/Event frame parsing from CLI to crate library #7

@coderabbitai

Description

@coderabbitai

Background

PR #6 implemented the export infrastructure (CSV, GPX, Event) for the BBL parser crate. However, GPS and Event frame parsing logic currently exists only in the CLI binary and needs to be migrated to the crate library for full functionality.

Current State

In the crate (src/parser/frame.rs):

  • GPS/Event vectors are initialized as empty
  • G/H/E frames are skipped rather than parsed (lines 223-232)
  • Export functions exist but receive empty data

In the CLI (src/main.rs):

  • Full G-frame parsing with GPS coordinate construction (line 2147+)
  • Dedicated parse_e_frame() function for Event frames (line 2491+)
  • Complete Event frame construction with event descriptions (line 2649+)

Impact

Crate users calling parse_bbl_file() receive empty vectors for GPS/Event data, even when logs contain G/H/E frames:

  • ✅ CSV export works (uses I/P/S frames)
  • ❌ GPX export produces no data (empty gps_coordinates)
  • ❌ Event export produces no data (empty event_frames)

Only the CLI binary currently provides full export functionality.

Required Work

  1. Migrate GPS parsing from src/main.rs to src/parser/frame.rs:

    • Implement G-frame parsing in the 'G' match arm
    • Implement H-frame parsing in the 'H' match arm
    • Populate gps_coordinates and home_coordinates vectors
  2. Migrate Event parsing from src/main.rs to src/parser/frame.rs:

    • Move parse_e_frame() logic or equivalent
    • Implement E-frame parsing in the 'E' match arm
    • Populate event_frames vector with proper event descriptions
  3. Testing:

    • Verify GPX export produces correct output from crate
    • Verify Event export produces correct output from crate
    • Ensure CLI maintains compatibility

References

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions