sdr/decode: improve decoding thanks to aaronsp777
This commit is contained in:
parent
157a8ee41f
commit
6ca62453ee
|
@ -137,8 +137,10 @@ puts "# values: #{values.size}"
|
||||||
unless values.empty? then
|
unless values.empty? then
|
||||||
puts "values: "
|
puts "values: "
|
||||||
values.each do |value|
|
values.each do |value|
|
||||||
data_bits = (value & 0x07)
|
button = value & 7
|
||||||
system_code = ((value & 0x7fffff) >> 3)
|
code = (value >> 3) & 65535
|
||||||
puts "- value: #{value} (0x#{value.to_s(16).rjust(6,'0')}), system code: #{system_code} (0x#{system_code.to_s(16)}), databits: #{data_bits} (0x#{data_bits.to_s(16)})"
|
facility = (value >> 19) & 15
|
||||||
|
printf("- value: 0X%06x, code: %05d, facility: %d, button: %d\n", value, code, facility, button)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue