Skip to content

Commit

Permalink
Add comment explaining odd lircd behaviour
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Young <[email protected]>
  • Loading branch information
seanyoung committed Mar 10, 2024
1 parent 1438f87 commit ba61803
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions liblircd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,16 @@ impl<'a> Code<'a> {
}
}

// toggle_bit_mask_state is set by the parser to a strange value: the
// code of the first entry is anded and then xored with toggle_bit_mask.

// toggle_bit_mask_state is also set by the decoder, which simply ands the
// bits from the receive code, it is not xored. None of this behaviour
// matches what actually happens in match_ir_code(): either the code
// received is correct, or the code ^ toggle_bit_mask is correct.

// I don't think toggle_bit_mask_state should be used in lircd transmit
// at all, so just set it to 0 for now.
if unsafe { (*self.1 .0).toggle_bit_mask } != 0 {
unsafe {
(*self.1 .0).toggle_bit_mask_state = 0;
Expand Down

0 comments on commit ba61803

Please sign in to comment.