Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request performs a major refactoring of the codebase, extracting device capabilities, core operations, session configuration, session control, DL-TDoA, and data transfer logic into dedicated submodules, while replacing Python-based integration tests with native Rust integration tests. A review comment correctly identifies the use of the unstable let_chains feature in src/ranging.rs, which would prevent compilation on stable Rust, and provides an actionable suggestion to rewrite it using standard nested if let or combinators.
I am having trouble creating individual review comments. Click here to see my feedback.
src/ranging.rs (357-372)
The use of the unstable let_chains feature (&& let) will prevent compilation on stable Rust compilers. To maintain compatibility with stable Rust, it is recommended to rewrite this logic using standard if let nesting or Option::and_then combinators.
let peer_handle = if session.can_start_data_transfer() {
session.data_transfer.as_ref().and_then(|data_transfer| {
let dst_mac_address = data_transfer.dst_mac_address;
self.devices
.values()
.find(|peer_entry| {
peer_entry.device.handle != device_handle
&& peer_entry
.device
.can_receive_data_transfer(session_id, dst_mac_address)
})
.map(|peer_entry| peer_entry.device.handle)
})
} else {
None
};Remove internal Instant::now calls from the Pica state machine by taking now in handle_packet and tick, exposing next_deadline, and initializing boot_time lazily on CoreDeviceResetCmd while keeping OS clock reads at the binary and FFI edges.
b833c9f to
262c5ca
Compare
Replace pytest coverage with deterministic unit tests across device, session, app_config, ranging, dl_tdoa, and data_transfer, plus sans-I/O integration tests in tests/.
Drop the legacy Python pytest suite, GitHub Actions pytest steps, and README pytest instructions now that equivalent Rust tests are in place.
262c5ca to
c3fa56b
Compare
Remove map-storage, hardcoded version, and duplicate integration tests while retaining CUSTOM_CAPS codec coverage and adding FiRa 2.0 capability contract checks plus unit tests for reset timestamp clearing, non-command packet filtering, missing mandatory app config rejection, resume after suspend, and combined proximity-AoA edge triggers.
Previously, Pica relied on a PyTest suite to test functionality that really should have been checked directly in unit and integration tests.