Skip to content

feat: high level ModemManager API #419

Merged
cachebag merged 3 commits into
masterfrom
mmrs-api
May 19, 2026
Merged

feat: high level ModemManager API #419
cachebag merged 3 commits into
masterfrom
mmrs-api

Conversation

@cachebag
Copy link
Copy Markdown
Collaborator

Closes #402

@cachebag cachebag self-assigned this May 15, 2026
@cachebag cachebag added api-surface Public API design, re-exports, and semver-relevant changes dbus D-Bus types, signatures, or NM D-Bus API zbus zbus API surface mmrs modemmanager bindings crate labels May 15, 2026
@cachebag cachebag requested a review from Copilot May 15, 2026 22:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces the high-level ModemManager entry point and per-modem ModemScope over the existing low-level zbus proxies, fulfilling the API surface described in issue #402. Adds a new ConnectionStatus model, wires zbus::fdo::Error into ModemError, re-exports the new types from the crate root, and updates the crate-level docs and changelog.

Changes:

  • New api::modem_manager module implementing enumeration via ObjectManager.GetManagedObjects, primary/by-IMEI selection, simple connect/disconnect/status, SIM PIN flows, signal/access-tech queries, and property-decoding helpers.
  • New api::modem_scope::ModemScope<'a> that forwards every operation to crate-private *_for_path helpers on ModemManager.
  • Adds ConnectionStatus model, ModemError::DbusFdo variant, re-exports, and refreshed crate-level docs/example plus a changelog entry.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
mmrs/src/api/modem_manager.rs Core implementation of the high-level API and D-Bus property decoders.
mmrs/src/api/modem_scope.rs Per-modem scoped wrapper that delegates to ModemManager helpers.
mmrs/src/api/mod.rs Wires the two new modules into the API surface and re-exports the types.
mmrs/src/api/models/modem.rs Adds the ConnectionStatus snapshot struct returned by status helpers.
mmrs/src/api/models/mod.rs Re-exports the new ConnectionStatus type.
mmrs/src/api/models/error.rs Adds ModemError::DbusFdo so zbus::fdo::Error propagates via ?.
mmrs/src/lib.rs Updates crate-level docs, doctest example, and re-exports.
mmrs/CHANGELOG.md Documents the new high-level API and ConnectionStatus under Unreleased.

Comment thread mmrs/src/api/modem_manager.rs Outdated
Comment thread mmrs/src/api/modem_manager.rs Outdated
Comment thread mmrs/src/api/modem_manager.rs Outdated
Comment thread mmrs/src/api/modem_manager.rs Outdated
Comment thread mmrs/src/api/modem_manager.rs
Comment thread mmrs/src/api/modem_manager.rs
Comment thread mmrs/src/api/modem_manager.rs Outdated
Comment thread mmrs/src/api/modem_manager.rs
Comment thread mmrs/src/api/modem_manager.rs
Comment thread mmrs/src/api/modem_manager.rs Outdated
cachebag added 3 commits May 18, 2026 21:02
…oding

- Replace fragile string-matching PIN/PUK error detection with
  structured D-Bus error name inspection (classify_pin_error)
- Validate ModemManager reachability in with_connection via version()
- Add InvalidObjectPath error variant instead of misleading ModemNotFound
- Make signal_quality Option meaningful (drop always-Some fallback)
- Use try_join_all for concurrent modem enumeration in list_modems
- Sort modem paths numerically by trailing index, not lexicographically
- Return None from decode_ip4_config when no usable IP info present
- Short-circuit modem_by_imei on EquipmentIdentifier match
- Respect the "recent" flag from signal_quality in modem_info_for_path
- Add unit tests for pure helper functions
@cachebag cachebag merged commit d9e95ea into master May 19, 2026
6 checks passed
@cachebag cachebag deleted the mmrs-api branch May 19, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-surface Public API design, re-exports, and semver-relevant changes dbus D-Bus types, signatures, or NM D-Bus API mmrs modemmanager bindings crate zbus zbus API surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mmrs: high-level api (ModemManager struct)

2 participants