Bootstrap OpenBitdo clean-room SDK and reliability milestone

This commit is contained in:
2026-02-27 20:43:34 -05:00
commit d5afadf560
46 changed files with 3652 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
use bitdo_proto::{command_registry, CommandFrame, CommandId, Report64};
#[test]
fn frame_encode_decode_roundtrip_for_all_commands() {
assert_eq!(command_registry().len(), CommandId::all().len());
for row in command_registry() {
let frame = CommandFrame {
id: row.id,
payload: row.request.to_vec(),
report_id: row.report_id,
expected_response: row.expected_response,
};
let encoded = frame.encode();
if encoded.len() == 64 {
let parsed = Report64::try_from(encoded.as_slice()).expect("64-byte frame parses");
assert_eq!(parsed.as_slice(), encoded.as_slice());
} else {
assert!(!encoded.is_empty());
}
}
}