Skip to content

Commit

Permalink
Linux rc6_0 protocol have 43 edges
Browse files Browse the repository at this point in the history
A similar patch has been submitted for ir-ctl in v4l-utils.

Signed-off-by: Sean Young <[email protected]>
  • Loading branch information
seanyoung committed Apr 22, 2024
1 parent b23ddc2 commit 98ea11e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion liblircd/src/ir-encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ static const struct {
[RC_PROTO_NECX] = { "necx", 0xffffff, 67, 38000, nec_encode },
[RC_PROTO_NEC32] = { "nec32", 0xffffffff, 67, 38000, nec_encode },
[RC_PROTO_SANYO] = { "sanyo", 0x1fffff, 87, 38000, sanyo_encode },
[RC_PROTO_RC6_0] = { "rc6_0", 0xffff, 41, 36000, rc6_encode },
[RC_PROTO_RC6_0] = { "rc6_0", 0xffff, 43, 36000, rc6_encode },
[RC_PROTO_RC6_6A_20] = { "rc6_6a_20", 0xfffff, 52, 36000, rc6_encode },
[RC_PROTO_RC6_6A_24] = { "rc6_6a_24", 0xffffff, 60, 36000, rc6_encode },
[RC_PROTO_RC6_6A_32] = { "rc6_6a_32", 0xffffffff, 76, 36000, rc6_encode },
Expand Down
7 changes: 5 additions & 2 deletions src/linux_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,16 @@ mod test {
for _ in 0..1000 {
let scancode = rng.next_u32() & linux.scancode_mask;

println!("proto: {proto:?} scancode:{scancode:#x}");

irctl.resize(max_size as usize, 0);

let len =
unsafe { liblircd::protocol_encode(proto, scancode, irctl.as_mut_ptr()) };

assert!(
len as usize <= max_size,
"{len} {max_size} proto:{proto:?} scancode:{scancode:#x}"
);

irctl.resize(len as usize, 0);

let mut vars = Vartable::new();
Expand Down

0 comments on commit 98ea11e

Please sign in to comment.