I am writing a dissector for my blinds protocol, but I don't fully understand how RF encoding works and how to process the raw radio data to get the raw blind protocol.
I want to read the raw radio signal and then ensure that the preamble matches (0xAA....), then Manchester decode the data so I can confirm the checksum is valid and print the details of the raw blind protcol.
Using the CLI, I can exact
what I call the raw radio data, using OOK_PCM and the raw blinds protocol data using OOK_MC_ZEROBIT
<raw radio signaL>
rtl_433 -R 0 -X 'n=name,m=OOK_PCM,s=800,l=800,g=2000,r=6000' -r r04/g001_433.92M_250k.cu8len : 65data : aaaaaaaaaaaaaaaa0, <- preamblelen : 81data : aa5555556aaa996a56a60<raw blinds protocol>rtl_433 -R 0 -X 'n=name,m=OOK_MC_ZEROBIT,s=800,l=800,g=2000,r=6000' -r r04/g001_433.92M_250k.cu8Len : 72data : 0000000000007fa71dIn code, when I use .modulation = OOK_PULSE_PCM - I get the raw radio signal, and when I use .modulation = OOK_PULSE_MANCHESTER_ZEROBIT, I get the raw blinds protocol.
If I read the raw radio protocol data (.modulation = OOK_PULSE_PCM) - how do I process the data from that to get the Manchester decoded raw blind data?
What is the correct way to process the raw radio data and then Manchester decode it to get the raw blind protocol?
Here is what I am trying, but I am not getting the expected results - the raw blind data.
bitbuffer_t raw_radio = {0};
bitbuffer_t raw_blind = {0};
raw_radio.bb[0][0] = 0xAA;
raw_radio.bb[0][1] = 0xAA;
raw_radio.bb[0][2] = 0xAA;
raw_radio.bb[0][3] = 0xAA;
raw_radio.bb[0][4] = 0xAA;
raw_radio.bb[0][5] = 0xAA;
raw_radio.bb[0][6] = 0xAA;
raw_radio.bb[0][7] = 0xAA;
raw_radio.bits_per_row[raw_radio.num_rows] = 65;
raw_radio.num_rows++;
raw_radio.bb[1][0] = 0xAA;
raw_radio.bb[1][1] = 0x55;
raw_radio.bb[1][2] = 0x55;
raw_radio.bb[1][3] = 0x55;
raw_radio.bb[1][4] = 0x6A;
raw_radio.bb[1][5] = 0xAA;
raw_radio.bb[1][6] = 0x99;
raw_radio.bb[1][7] = 0x6A;
raw_radio.bb[1][8] = 0x56;
raw_radio.bb[1][9] = 0xA6;
raw_radio.bits_per_row[raw_radio.num_rows] = 81;
raw_radio.num_rows++;
bitbuffer_print(&raw_radio);
int ret = bitbuffer_manchester_decode (&raw_radio, 1, 0, raw_blind, 81);
bitbuffer_print(&raw_blind);
Output
bitbuffer:: Number of rows: 2
[00] {65} aa aa aa aa aa aa aa aa 00
[01] {81} aa 55 55 55 6a aa 99 6a 56 a6 00
bitbuffer:: Number of rows: 1
[00] {40} 0f ff 80 58 e2 :