1

As a total noob in this territory, I am trying to decipher a serial protocol between two devices A and B. It looks like the frames that are sent from B to A are somehow protected with a CRC or checksum. The funny thing is that equal dataframes sent in different power-up cycles, carry different CRC/checksum data. This lead me to believe that there is a mechanism to negotiate a seed(-like) value as part of the startup procedure. I have found a dataframe, sent from A to B, that seems to contain this data. In the data I collected, frames starting with "A0 07" represent these seed-frames (from device A to B). All frames following a seed-frame are data-frames (starting with "A0 82", sent from B to A) and are, presumably, CRC'ed/Checksummed using the values from the preceeding seed-frame.

I tried analysing the data bij myself and using reveng.exe to no avail. I clearly see patterns but am having a hard time defining them.

// Note 1 As can be seen at the records marked "// Note 1", re=ordering databytes leads to the same CRC/checksum. Maybe some lineair algorithm?

// Note 2 The frames marked "// Note 2" show an equal CRC/checksum for different databytes.

I would like to be able to add a valid CRC/checksum to self-generated data-frames, probably using the data from the seed-frame.

Your help is much appreciated.

 1     1    A0 07 03 2C 06
 1     2    A0 82 00 01 02 40 00 CF E4
 1     3    A0 82 00 02 02 00 00 CF 62  // Note 2
 1     4    A0 82 00 03 02 00 01 CF 62  // Note 2
 1     5    A0 82 00 04 02 00 01 CF 6C
 1     6    A0 82 00 05 02 00 81 CE 6E
 1     7    A0 82 00 06 02 00 81 CE 68
 1     8    A0 82 00 07 02 02 00 CF 6C
 1     9    A0 82 00 08 02 00 00 CF 76
 1    10    A0 82 00 09 02 40 00 CF F4
 1    11    A0 82 00 0A 02 00 00 CF 72
 1    12    A0 82 00 0B 02 00 01 CF 72
 1    13    A0 82 00 0C 02 01 00 CF 7C
 1    14    A0 82 00 0D 02 00 00 CF 7C
 1    15    A0 82 00 0E 02 00 01 CF 78
 1    16    A0 82 00 0F 02 01 00 CF 7A
 1    17    A0 82 00 10 02 00 00 CF 46
 1    18    A0 82 00 11 02 00 01 CF 46
 1    19    A0 82 00 12 02 01 00 CF 40
 1    20    A0 82 00 13 02 00 00 CF 40
 1    21    A0 82 00 14 02 00 01 CF 4C
 1    22    A0 82 00 15 02 01 00 CF 4E
 1    23    A0 82 00 16 02 00 00 CF 4A
 1    24    A0 82 00 17 02 01 00 CF 4A
 1    25    A0 82 00 18 02 00 00 CF 56
 1    26    A0 82 00 19 02 00 01 CF 56
 1    27    A0 82 00 1A 02 01 00 CF 50
 1    28    A0 82 00 1B 02 00 00 CF 50
 1    29    A0 82 00 1C 02 00 01 CF 5C
 1    30    A0 82 00 1D 02 00 01 CF 5E
 1    31    A0 82 00 1E 02 02 00 CF 5E
 1    32    A0 82 00 1F 02 00 00 CF 58
 1    33    A0 82 00 20 02 00 01 CF 24
 1    34    A0 82 00 21 02 00 01 CF 26
 1    35    A0 82 00 22 02 01 00 CF 20
 1    36    A0 82 00 23 02 00 00 CF 20
 1    37    A0 82 00 24 02 00 01 CF 2C
 1    38    A0 82 00 25 02 00 01 CF 2E
 1    39    A0 82 00 26 02 00 01 CF 28
 1    40    A0 82 00 27 02 00 81 CE 2A
 1    41    A0 82 00 28 02 00 01 CF 34
 1    42    A0 82 00 29 02 01 00 CF 36
 1    43    A0 82 00 2A 02 00 00 CF 32
 1    44    A0 82 00 2B 02 00 01 CF 32
 1    45    A0 82 00 2C 02 00 01 CF 3C
 1    46    A0 82 00 2D 02 00 01 CF 3E
 1    47    A0 82 00 2E 02 00 81 CE 38
 1    48    A0 82 00 2F 02 00 81 CE 3A
 1    49    A0 82 00 30 02 00 81 CE 04
 1    50    A0 82 00 31 02 00 81 CE 06
 1    51    A0 82 00 32 02 00 81 CE 00
 1    52    A0 82 00 33 02 00 81 CE 02
 1    53    A0 82 00 34 02 00 81 CE 0C
 1    54    A0 82 00 35 02 02 00 CF 08
 1    55    A0 82 00 36 02 00 00 CF 0A
 1    56    A0 82 00 37 02 02 00 CF 0C
 1    57    A0 82 00 38 02 00 00 CF 16
 1    58    A0 82 00 39 02 02 00 CF 10
 1    59    A0 82 00 3A 02 00 00 CF 12

 2     1    A0 07 00 15 3A
 2     2    A0 82 00 01 02 40 00 4B E4
 2     3    A0 82 00 02 02 00 00 4A E8
 2     4    A0 82 00 03 02 00 01 4A E8
 2     5    A0 82 00 04 02 00 01 4A F4
 2     6    A0 82 00 05 02 00 81 48 F0
 2     7    A0 82 00 06 02 00 81 48 FC
 2     8    A0 82 00 07 02 00 81 48 F8
 2     9    A0 82 00 08 02 01 00 4A C4
 2    10    A0 82 00 09 02 00 00 4A C4
 2    11    A0 82 00 0A 02 01 00 4A CC
 2    12    A0 82 00 0B 02 00 00 4A CC
 2    13    A0 82 00 0C 02 01 00 4A D4
 2    14    A0 82 00 0D 02 00 00 4A D4
 2    15    A0 82 00 0E 02 00 01 4A DC
 2    16    A0 82 00 0F 02 00 01 4A D8
 2    17    A0 82 00 10 02 00 01 4A A4
 2    18    A0 82 00 11 02 00 01 4A A0
 2    19    A0 82 00 12 02 00 01 4A AC
 2    20    A0 82 00 13 02 01 00 4A A8
 2    21    A0 82 00 14 02 00 00 4A B0
 2    22    A0 82 00 15 02 00 01 4A B0
 2    23    A0 82 00 16 02 01 00 4A BC
 2    24    A0 82 00 17 02 00 00 4A BC
 2    25    A0 82 00 18 02 00 81 48 84
 2    26    A0 82 00 19 02 00 81 48 80
 2    27    A0 82 00 1A 02 00 81 48 8C
 2    28    A0 82 00 1B 02 02 00 4A 84
 2    29    A0 82 00 1C 02 00 00 4A 90
 2    30    A0 82 00 1D 02 00 01 4A 90
 2    31    A0 82 00 1E 02 00 01 4A 9C
 2    32    A0 82 00 1F 02 01 00 4A 98
 2    33    A0 82 00 20 02 00 00 4A 60
 2    34    A0 82 00 21 02 00 01 4A 60
 2    35    A0 82 00 22 02 00 01 4A 6C
 2    36    A0 82 00 23 02 00 01 4A 68
 2    37    A0 82 00 24 02 01 00 4A 74
 2    38    A0 82 00 25 02 00 00 4A 74
 2    39    A0 82 00 26 02 02 00 4A 70
 2    40    A0 82 00 27 02 00 00 4A 7C
 2    41    A0 82 00 28 02 02 00 4A 48
 2    42    A0 82 00 29 02 00 00 4A 44
 2    43    A0 82 00 2A 02 00 01 4A 4C
 2    44    A0 82 00 2B 02 01 00 4A 48
 2    45    A0 82 00 2C 02 00 00 4A 50
 2    46    A0 82 00 2D 02 01 00 4A 50
 2    47    A0 82 00 2E 02 00 00 4A 58
 2    48    A0 82 00 2F 02 00 01 4A 58
 2    49    A0 82 00 30 02 01 00 4A 24
 2    50    A0 82 00 31 02 00 00 4A 24
 2    51    A0 82 00 32 02 01 00 4A 2C
 2    52    A0 82 00 33 02 00 00 4A 2C
 2    53    A0 82 00 34 02 00 01 4A 34
 2    54    A0 82 00 35 02 00 01 4A 30
 2    55    A0 82 00 36 02 00 01 4A 3C
 2    56    A0 82 00 37 02 01 00 4A 38
 2    57    A0 82 00 38 02 00 00 4A 00
 2    58    A0 82 00 39 02 01 00 4A 00
 2    59    A0 82 00 3A 02 00 00 4A 08
 2    60    A0 82 00 3B 02 02 00 4A 04
 2    61    A0 82 00 3C 02 00 00 4A 10
 2    62    A0 82 00 3D 02 02 00 4A 1C
 2    63    A0 82 00 3E 02 00 00 4A 18
 2    64    A0 82 00 3F 02 00 81 48 18
 2    65    A0 82 00 40 02 00 81 49 E4
 2    66    A0 82 00 41 02 00 81 49 E0
 2    67    A0 82 00 42 02 00 81 49 EC
 2    68    A0 82 00 43 02 00 81 49 E8
 2    69    A0 82 00 44 02 00 81 49 F4
 2    70    A0 82 00 45 02 00 81 49 F0
 2    71    A0 82 00 46 02 02 00 4B F0
 2    72    A0 82 00 47 02 00 00 4B FC

 3     1    A0 07 01 06 5B
 3     2    A0 82 00 01 02 40 00 DD 42  // Note 1
 3     3    A0 82 00 02 02 00 00 CD 82
 3     4    A0 82 00 03 02 00 81 ED 82
 3     5    A0 82 00 04 02 00 81 EC 42
 3     6    A0 82 00 05 02 00 81 EC 02
 3     7    A0 82 00 06 02 00 81 EC C2
 3     8    A0 82 00 07 02 00 01 CC 82
 3     9    A0 82 00 08 02 00 01 CF 42
 3    10    A0 82 00 09 02 00 01 CF 02
 3    11    A0 82 00 0A 02 00 01 CF C2
 3    12    A0 82 00 0B 02 00 01 CF 82
 3    13    A0 82 00 0C 02 01 00 CE 42
 3    14    A0 82 00 0D 02 00 00 CE 42
 3    15    A0 82 00 0E 02 01 00 CE C2
 3    16    A0 82 00 0F 02 00 00 CE C2
 3    17    A0 82 00 10 02 00 01 C9 42
 3    18    A0 82 00 11 02 00 01 C9 02
 3    19    A0 82 00 12 02 00 01 C9 C2
 3    20    A0 82 00 13 02 01 00 C9 82
 3    21    A0 82 00 14 02 00 00 C8 02
 3    22    A0 82 00 15 02 01 00 C8 02
 3    23    A0 82 00 16 02 00 00 C8 82
 3    24    A0 82 00 17 02 02 00 C8 42
 3    25    A0 82 00 18 02 00 00 CB 02
 3    26    A0 82 00 19 02 02 00 CB C2
 3    27    A0 82 00 1A 02 00 00 CB 82
 3    28    A0 82 00 1B 02 02 00 CB 42
 3    29    A0 82 00 1C 02 00 00 CA 02
 3    30    A0 82 00 1D 02 40 00 DA 42
 3    31    A0 82 00 1E 02 00 00 CA 82
 3    32    A0 82 00 1F 02 00 01 CA 82
 3    33    A0 82 00 20 02 00 01 C5 42
 3    34    A0 82 00 21 02 00 01 C5 02
 3    35    A0 82 00 22 02 00 01 C5 C2
 3    36    A0 82 00 23 02 01 00 C5 82
 3    37    A0 82 00 24 02 00 00 C4 02
 3    38    A0 82 00 25 02 00 01 C4 02
 3    39    A0 82 00 26 02 00 01 C4 C2
 3    40    A0 82 00 27 02 01 00 C4 82
 3    41    A0 82 00 28 02 00 00 C7 02
 3    42    A0 82 00 29 02 02 00 C7 C2
 3    43    A0 82 00 2A 02 00 00 C7 82
 3    44    A0 82 00 2B 02 02 00 C7 42
 3    45    A0 82 00 2C 02 00 00 C6 02
 3    46    A0 82 00 2D 02 04 00 C7 42
 3    47    A0 82 00 2E 02 00 00 C6 82
 3    48    A0 82 00 2F 02 40 00 D6 C2
 3    49    A0 82 00 30 02 00 00 C1 02
 3    50    A0 82 00 31 02 00 01 C1 02
 3    51    A0 82 00 32 02 00 01 C1 C2
 3    52    A0 82 00 33 02 00 01 C1 82
 3    53    A0 82 00 34 02 00 01 C0 42
 3    54    A0 82 00 35 02 00 01 C0 02
 3    55    A0 82 00 36 02 00 01 C0 C2
 3    56    A0 82 00 37 02 01 00 C0 82
 3    57    A0 82 00 38 02 00 00 C3 02
 3    58    A0 82 00 39 02 40 00 D3 42
 3    59    A0 82 00 3A 02 00 00 C3 82
 3    60    A0 82 00 3B 02 00 01 C3 82
 3    61    A0 82 00 3C 02 00 01 C2 42
 3    62    A0 82 00 3D 02 00 01 C2 02
 3    63    A0 82 00 3E 02 00 01 C2 C2
 3    64    A0 82 00 3F 02 00 01 C2 82
 3    65    A0 82 00 40 02 00 01 DD 42  // Note 1
 3    66    A0 82 00 41 02 00 01 DD 02
 3    67    A0 82 00 42 02 01 00 DD C2
 3    68    A0 82 00 43 02 00 00 DD C2
 3    69    A0 82 00 44 02 00 81 FC 42
 3    70    A0 82 00 45 02 00 81 FC 02
 3    71    A0 82 00 46 02 00 01 DC C2
 3    72    A0 82 00 47 02 00 01 DC 82
 3    73    A0 82 00 48 02 00 01 DF 42
 3    74    A0 82 00 49 02 01 00 DF 02
 3    75    A0 82 00 4A 02 00 00 DF 82
 3    76    A0 82 00 4B 02 00 01 DF 82
 3    77    A0 82 00 4C 02 00 01 DE 42
 3    78    A0 82 00 4D 02 00 01 DE 02
 3    79    A0 82 00 4E 02 00 01 DE C2
 3    80    A0 82 00 4F 02 00 01 DE 82
 3    81    A0 82 00 50 02 00 01 D9 42
 3    82    A0 82 00 51 02 00 01 D9 02
 3    83    A0 82 00 52 02 00 81 F9 C2
 3    84    A0 82 00 53 02 00 81 F9 82
 3    85    A0 82 00 54 02 00 81 F8 42
 3    86    A0 82 00 55 02 02 00 D8 C2
 3    87    A0 82 00 56 02 00 00 D8 82
 3    88    A0 82 00 57 02 02 00 D8 42
 3    89    A0 82 00 58 02 00 00 DB 02
 3    90    A0 82 00 59 02 02 00 DB C2
 3    91    A0 82 00 5A 02 00 00 DB 82

 4     1    A0 07 02 27 58
 4     2    A0 82 00 01 02 40 00 9A A3
 4     3    A0 82 00 02 02 00 00 9A E0
 4     4    A0 82 00 03 02 00 81 9A 60
 4     5    A0 82 00 04 02 00 01 9A E7
 4     6    A0 82 00 05 02 00 81 9A 66
 4     7    A0 82 00 06 02 00 01 9A E5
 4     8    A0 82 00 07 02 00 81 9A 64
 4     9    A0 82 00 08 02 00 01 9A EB
 4    10    A0 82 00 09 02 00 01 9A EA
 4    11    A0 82 00 0A 02 00 01 9A E9
 4    12    A0 82 00 0B 02 00 01 9A E8
 4    13    A0 82 00 0C 02 00 01 9A EF
 4    14    A0 82 00 0D 02 00 01 9A EE
 4    15    A0 82 00 0E 02 00 01 9A ED
 4    16    A0 82 00 0F 02 01 00 9A EC
 4    17    A0 82 00 10 02 00 00 9A F2
 4    18    A0 82 00 11 02 00 01 9A F2
 4    19    A0 82 00 12 02 00 01 9A F1
 4    20    A0 82 00 13 02 00 01 9A F0
 4    21    A0 82 00 14 02 01 00 9A F7
 4    22    A0 82 00 15 02 00 00 9A F7
 4    23    A0 82 00 16 02 00 01 9A F5
 4    24    A0 82 00 17 02 00 01 9A F4
 4    25    A0 82 00 18 02 01 00 9A FB
 4    26    A0 82 00 19 02 00 00 9A FB
 4    27    A0 82 00 1A 02 02 00 9A FA
 4    28    A0 82 00 1B 02 00 00 9A F9
 4    29    A0 82 00 1C 02 02 00 9A FC
 4    30    A0 82 00 1D 02 00 00 9A FF
 4    31    A0 82 00 1E 02 00 81 9A 7D
 4    32    A0 82 00 1F 02 00 81 9A 7C
 4    33    A0 82 00 20 02 00 81 9A 43
 4    34    A0 82 00 21 02 00 81 9A 42
 4    35    A0 82 00 22 02 00 01 9A C1
 4    36    A0 82 00 23 02 00 01 9A C0
 4    37    A0 82 00 24 02 00 01 9A C7
 4    38    A0 82 00 25 02 00 01 9A C6
 4    39    A0 82 00 26 02 02 00 9A C6
 4    40    A0 82 00 27 02 00 00 9A C5
 4    41    A0 82 00 28 02 02 00 9A C8
 4    42    A0 82 00 29 02 00 00 9A CB
 4    43    A0 82 00 2A 02 40 00 9A 88
 4    44    A0 82 00 2B 02 00 00 9A C9
 4    45    A0 82 00 2C 02 00 01 9A CF
 4    46    A0 82 00 2D 02 00 01 9A CE
 4    47    A0 82 00 2E 02 00 01 9A CD
 4    48    A0 82 00 2F 02 00 01 9A CC
 4    49    A0 82 00 30 02 00 01 9A D3
 4    50    A0 82 00 31 02 00 01 9A D2
 4    51    A0 82 00 32 02 00 01 9A D1
 4    52    A0 82 00 33 02 00 01 9A D0
 4    53    A0 82 00 34 02 00 01 9A D7
 4    54    A0 82 00 35 02 00 81 9A 56
 4    55    A0 82 00 36 02 00 81 9A 55
 4    56    A0 82 00 37 02 00 81 9A 54
 4    57    A0 82 00 38 02 00 81 9A 5B
 4    58    A0 82 00 39 02 00 81 9A 5A
 4    59    A0 82 00 3A 02 00 81 9A 59
 4    60    A0 82 00 3B 02 00 81 9A 58
 4    61    A0 82 00 3C 02 00 81 9A 5F
 4    62    A0 82 00 3D 02 00 81 9A 5E
 4    63    A0 82 00 3E 02 00 81 9A 5D
 4    64    A0 82 00 3F 02 02 00 9A DF
 4    65    A0 82 00 40 02 00 00 9A A2

 5     1    A0 07 00 27 1A
 5     2    A0 82 00 01 02 40 00 83 64
 5     3    A0 82 00 02 02 00 00 82 68
 5     4    A0 82 00 03 02 00 01 82 68
 5     5    A0 82 00 04 02 00 01 82 74
 5     6    A0 82 00 05 02 00 01 82 70
 5     7    A0 82 00 06 02 00 01 82 7C
 5     8    A0 82 00 07 02 00 01 82 78
 5     9    A0 82 00 08 02 00 01 82 44
 5    10    A0 82 00 09 02 00 01 82 40
 5    11    A0 82 00 0A 02 00 01 82 4C
 5    12    A0 82 00 0B 02 00 01 82 48
 5    13    A0 82 00 0C 02 00 81 80 54
 5    14    A0 82 00 0D 02 00 81 80 50
 5    15    A0 82 00 0E 02 00 81 80 5C
 5    16    A0 82 00 0F 02 00 81 80 58
 5    17    A0 82 00 10 02 00 81 80 24
 5    18    A0 82 00 11 02 00 81 80 20
 5    19    A0 82 00 12 02 00 81 80 2C
 5    20    A0 82 00 13 02 00 81 80 28
 5    21    A0 82 00 14 02 00 81 80 34
 5    22    A0 82 00 15 02 00 01 82 30
 5    23    A0 82 00 16 02 00 01 82 3C
 5    24    A0 82 00 17 02 00 01 82 38
 5    25    A0 82 00 18 02 00 01 82 04
 5    26    A0 82 00 19 02 00 01 82 00
 5    27    A0 82 00 1A 02 00 01 82 0C
 5    28    A0 82 00 1B 02 00 01 82 08
 5    29    A0 82 00 1C 02 01 00 82 14
 5    30    A0 82 00 1D 02 00 00 82 14
 5    31    A0 82 00 1E 02 01 00 82 1C
 5    32    A0 82 00 1F 02 00 00 82 1C
 5    33    A0 82 00 20 02 01 00 82 E4
 5    34    A0 82 00 21 02 00 00 82 E4
 5    35    A0 82 00 22 02 00 01 82 EC
 5    36    A0 82 00 23 02 00 01 82 E8
 5    37    A0 82 00 24 02 00 01 82 F4
 5    38    A0 82 00 25 02 01 00 82 F0
 5    39    A0 82 00 26 02 00 00 82 F8
 5    40    A0 82 00 27 02 00 01 82 F8
 5    41    A0 82 00 28 02 00 01 82 C4
 5    42    A0 82 00 29 02 00 01 82 C0
 5    43    A0 82 00 2A 02 00 01 82 CC
 5    44    A0 82 00 2B 02 02 00 82 C4
 5    45    A0 82 00 2C 02 00 00 82 D0
 5    46    A0 82 00 2D 02 02 00 82 DC
 5    47    A0 82 00 2E 02 00 00 82 D8
 5    48    A0 82 00 2F 02 00 81 80 D8
 5    49    A0 82 00 30 02 00 01 82 A4
 5    50    A0 82 00 31 02 00 81 80 A0
 5    51    A0 82 00 32 02 00 81 80 AC
 5    52    A0 82 00 33 02 00 81 80 A8
 5    53    A0 82 00 34 02 00 81 80 B4
 5    54    A0 82 00 35 02 00 81 80 B0
 5    55    A0 82 00 36 02 00 81 80 BC
 5    56    A0 82 00 37 02 00 81 80 B8
 5    57    A0 82 00 38 02 00 81 80 84
 5    58    A0 82 00 39 02 02 00 82 8C
 5    59    A0 82 00 3A 02 00 00 82 88

 6     1    A0 07 00 1A 2F
 6     2    A0 82 00 01 02 40 00 F6 0E
 6     3    A0 82 00 02 02 00 00 D7 8E
 6     4    A0 82 00 03 02 00 01 D7 8E
 6     5    A0 82 00 04 02 00 01 D4 0E
 6     6    A0 82 00 05 02 00 01 D4 8E
 6     7    A0 82 00 06 02 00 01 D5 0E
 6     8    A0 82 00 07 02 00 01 D5 8E
 6     9    A0 82 00 08 02 00 01 D2 0E
 6    10    A0 82 00 09 02 00 01 D2 8E
 6    11    A0 82 00 0A 02 00 01 D3 0E
 6    12    A0 82 00 0B 02 00 01 D3 8E
 6    13    A0 82 00 0C 02 00 81 90 0E
 6    14    A0 82 00 0D 02 01 00 D0 8E
 6    15    A0 82 00 0E 02 00 00 D1 8E
 6    16    A0 82 00 0F 02 00 01 D1 8E
 6    17    A0 82 00 10 02 00 01 DE 0E
 6    18    A0 82 00 11 02 00 01 DE 8E
 6    19    A0 82 00 12 02 01 00 DF 0E
 6    20    A0 82 00 13 02 00 00 DF 0E
 6    21    A0 82 00 14 02 00 01 DC 0E
 6    22    A0 82 00 15 02 00 01 DC 8E
 6    23    A0 82 00 16 02 00 01 DD 0E
 6    24    A0 82 00 17 02 00 01 DD 8E
 6    25    A0 82 00 18 02 00 01 DA 0E
 6    26    A0 82 00 19 02 00 01 DA 8E
 6    27    A0 82 00 1A 02 00 01 DB 0E
 6    28    A0 82 00 1B 02 00 01 DB 8E
 6    29    A0 82 00 1C 02 00 81 98 0E
 6    30    A0 82 00 1D 02 00 81 98 8E
 6    31    A0 82 00 1E 02 00 81 99 0E
 6    32    A0 82 00 1F 02 00 81 99 8E
 6    33    A0 82 00 20 02 00 81 86 0E
 6    34    A0 82 00 21 02 00 81 86 8E
 6    35    A0 82 00 22 02 00 81 87 0E
 6    36    A0 82 00 23 02 00 81 87 8E
 6    37    A0 82 00 24 02 02 00 C5 8E
 6    38    A0 82 00 25 02 00 00 C4 0E
 6    39    A0 82 00 26 02 02 00 C4 8E
 6    40    A0 82 00 27 02 00 00 C5 0E
 6    41    A0 82 00 28 02 02 00 C3 8E
 6    42    A0 82 00 29 02 00 00 C2 0E
 6    43    A0 82 00 2A 02 40 00 E3 8E
 6    44    A0 82 00 2B 02 00 00 C3 0E
 6    45    A0 82 00 2C 02 00 01 C0 0E
 6    46    A0 82 00 2D 02 00 01 C0 8E
 6    47    A0 82 00 2E 02 00 01 C1 0E
 6    48    A0 82 00 2F 02 02 00 C0 0E
 6    49    A0 82 00 30 02 00 00 CE 8E

 7     1    A0 07 05 22 40
 7     2    A0 82 00 01 02 40 00 43 43
 7     3    A0 82 00 02 02 00 00 43 00
 7     4    A0 82 00 03 02 00 01 43 00
 7     5    A0 82 00 04 02 00 01 43 07
 7     6    A0 82 00 05 02 00 01 43 06
 7     7    A0 82 00 06 02 00 01 43 05
 7     8    A0 82 00 07 02 00 01 43 04
 7     9    A0 82 00 08 02 00 01 43 0B
 7    10    A0 82 00 09 02 00 01 43 0A
 7    11    A0 82 00 0A 02 01 00 43 09
 7    12    A0 82 00 0B 02 00 00 43 09
 7    13    A0 82 00 0C 02 01 00 43 0F
 7    14    A0 82 00 0D 02 00 00 43 0F
 7    15    A0 82 00 0E 02 01 00 43 0D
 7    16    A0 82 00 0F 02 00 00 43 0D
 7    17    A0 82 00 10 02 00 01 43 13
 7    18    A0 82 00 11 02 00 01 43 12
 7    19    A0 82 00 12 02 00 01 43 11
 7    20    A0 82 00 13 02 01 00 43 10
 7    21    A0 82 00 14 02 00 00 43 16
 7    22    A0 82 00 15 02 00 01 43 16
 7    23    A0 82 00 16 02 00 01 43 15
 7    24    A0 82 00 17 02 00 01 43 14
 7    25    A0 82 00 18 02 00 01 43 1B
 7    26    A0 82 00 19 02 00 01 43 1A
 7    27    A0 82 00 1A 02 00 01 43 19
 7    28    A0 82 00 1B 02 00 81 43 98
 7    29    A0 82 00 1C 02 00 81 43 9F
 7    30    A0 82 00 1D 02 00 81 43 9E
 7    31    A0 82 00 1E 02 00 81 43 9D
 7    32    A0 82 00 1F 02 00 81 43 9C
 7    33    A0 82 00 20 02 01 00 43 23
 7    34    A0 82 00 21 02 00 00 43 23
 7    35    A0 82 00 22 02 00 81 43 A1
 7    36    A0 82 00 23 02 00 01 43 20
 7    37    A0 82 00 24 02 00 01 43 27
 7    38    A0 82 00 25 02 01 00 43 26
 7    39    A0 82 00 26 02 00 00 43 24
 7    40    A0 82 00 27 02 00 81 43 A4
 7    41    A0 82 00 28 02 02 00 43 28
 7    42    A0 82 00 29 02 00 00 43 2B
 7    43    A0 82 00 2A 02 02 00 43 2A
 7    44    A0 82 00 2B 02 00 00 43 29
 7    45    A0 82 00 2C 02 00 81 43 AF
 7    46    A0 82 00 2D 02 00 81 43 AE
 7    47    A0 82 00 2E 02 00 81 43 AD
 7    48    A0 82 00 2F 02 00 81 43 AC
 7    49    A0 82 00 30 02 00 81 43 B3
 7    50    A0 82 00 31 02 00 81 43 B2
 7    51    A0 82 00 32 02 00 81 43 B1
 7    52    A0 82 00 33 02 02 00 43 33
 7    53    A0 82 00 34 02 00 00 43 36

 8     1    A0 07 02 50 34
 8     2    A0 82 00 01 02 40 00 8E 24
 8     3    A0 82 00 02 02 00 00 8E A2
 8     4    A0 82 00 03 02 00 01 8E A2
 8     5    A0 82 00 04 02 00 01 8E AC
 8     6    A0 82 00 05 02 00 01 8E AE
 8     7    A0 82 00 06 02 00 01 8E A8
 8     8    A0 82 00 07 02 00 01 8E AA
 8     9    A0 82 00 08 02 00 01 8E B4
 8    10    A0 82 00 09 02 00 01 8E B6
 8    11    A0 82 00 0A 02 00 01 8E B0
 8    12    A0 82 00 0B 02 00 01 8E B2
 8    13    A0 82 00 0C 02 00 81 8F BC
 8    14    A0 82 00 0D 02 00 81 8F BE
 8    15    A0 82 00 0E 02 00 81 8F B8
 8    16    A0 82 00 0F 02 00 81 8F BA
 8    17    A0 82 00 10 02 00 81 8F 84
 8    18    A0 82 00 11 02 00 81 8F 86
 8    19    A0 82 00 12 02 00 81 8F 80
 8    20    A0 82 00 13 02 00 81 8F 82
 8    21    A0 82 00 14 02 00 81 8F 8C
 8    22    A0 82 00 15 02 00 81 8F 8E
 8    23    A0 82 00 16 02 00 01 8E 88
 8    24    A0 82 00 17 02 00 01 8E 8A
 8    25    A0 82 00 18 02 00 01 8E 94
 8    26    A0 82 00 19 02 00 01 8E 96
 8    27    A0 82 00 1A 02 00 01 8E 90
 8    28    A0 82 00 1B 02 00 01 8E 92
 8    29    A0 82 00 1C 02 00 01 8E 9C
 8    30    A0 82 00 1D 02 01 00 8E 9E
 8    31    A0 82 00 1E 02 00 00 8E 9A
 8    32    A0 82 00 1F 02 00 01 8E 9A
 8    33    A0 82 00 20 02 00 01 8E E4
 8    34    A0 82 00 21 02 00 01 8E E6
 8    35    A0 82 00 22 02 00 01 8E E0
 8    36    A0 82 00 23 02 00 81 8F E2
 8    37    A0 82 00 24 02 00 01 8E EC
 8    38    A0 82 00 25 02 01 00 8E EE
 8    39    A0 82 00 26 02 00 00 8E EA
 8    40    A0 82 00 27 02 02 00 8E EC
 8    41    A0 82 00 28 02 00 00 8E F6
 8    42    A0 82 00 29 02 00 81 8F F6
 8    43    A0 82 00 2A 02 00 81 8F F0
 8    44    A0 82 00 2B 02 00 81 8F F2
 8    45    A0 82 00 2C 02 00 81 8F FC
 8    46    A0 82 00 2D 02 02 00 8E F8
 8    47    A0 82 00 2E 02 00 00 8E FA
 8    48    A0 82 00 2F 02 00 81 8F FA
 8    49    A0 82 00 30 02 00 81 8F C4
 8    50    A0 82 00 31 02 00 81 8F C6
 8    51    A0 82 00 32 02 00 81 8F C0
 8    52    A0 82 00 33 02 00 81 8F C2
 8    53    A0 82 00 34 02 00 81 8F CC
 8    54    A0 82 00 35 02 00 81 8F CE
 8    55    A0 82 00 36 02 00 81 8F C8
 8    56    A0 82 00 37 02 00 81 8F CA
 8    57    A0 82 00 38 02 02 00 8E D2
 8    58    A0 82 00 39 02 00 00 8E D4

 9     1    A0 07 04 3F 0B
 9     2    A0 82 00 01 02 40 00 C6 41
 9     3    A0 82 00 02 02 00 00 C4 59
 9     4    A0 82 00 03 02 00 01 C4 59
 9     5    A0 82 00 04 02 00 01 C4 61
 9     6    A0 82 00 05 02 00 01 C4 69
 9     7    A0 82 00 06 02 00 01 C4 71
 9     8    A0 82 00 07 02 00 01 C4 79
 9     9    A0 82 00 08 02 00 01 C4 01
 9    10    A0 82 00 09 02 00 01 C4 09
 9    11    A0 82 00 0A 02 00 01 C4 11
 9    12    A0 82 00 0B 02 00 01 C4 19
 9    13    A0 82 00 0C 02 00 01 C4 21
 9    14    A0 82 00 0D 02 00 01 C4 29
 9    15    A0 82 00 0E 02 00 01 C4 31
 9    16    A0 82 00 0F 02 00 01 C4 39
 9    17    A0 82 00 10 02 00 01 C4 C1
 9    18    A0 82 00 11 02 00 01 C4 C9
 9    19    A0 82 00 12 02 00 01 C4 D1
 9    20    A0 82 00 13 02 00 01 C4 D9
 9    21    A0 82 00 14 02 00 01 C4 E1
 9    22    A0 82 00 15 02 00 01 C4 E9
 9    23    A0 82 00 16 02 00 01 C4 F1
 9    24    A0 82 00 17 02 00 01 C4 F9
 9    25    A0 82 00 18 02 00 01 C4 81
 9    26    A0 82 00 19 02 00 01 C4 89
 9    27    A0 82 00 1A 02 00 01 C4 91
 9    28    A0 82 00 1B 02 00 01 C4 99
 9    29    A0 82 00 1C 02 00 01 C4 A1
 9    30    A0 82 00 1D 02 00 01 C4 A9
 9    31    A0 82 00 1E 02 00 01 C4 B1
 9    32    A0 82 00 1F 02 00 01 C4 B9
 9    33    A0 82 00 20 02 00 01 C5 41
 9    34    A0 82 00 21 02 00 01 C5 49
 9    35    A0 82 00 22 02 00 01 C5 51
 9    36    A0 82 00 23 02 00 01 C5 59
 9    37    A0 82 00 24 02 00 01 C5 61
 9    38    A0 82 00 25 02 00 01 C5 69
 9    39    A0 82 00 26 02 00 01 C5 71
 9    40    A0 82 00 27 02 00 01 C5 79
 9    41    A0 82 00 28 02 00 01 C5 01
 9    42    A0 82 00 29 02 00 01 C5 09
 9    43    A0 82 00 2A 02 00 01 C5 11
 9    44    A0 82 00 2B 02 00 01 C5 19
 9    45    A0 82 00 2C 02 00 01 C5 21
 9    46    A0 82 00 2D 02 00 01 C5 29
 9    47    A0 82 00 2E 02 00 01 C5 31
 9    48    A0 82 00 2F 02 00 01 C5 39
 9    49    A0 82 00 30 02 00 01 C5 C1
 9    50    A0 82 00 31 02 00 01 C5 C9
 9    51    A0 82 00 32 02 00 01 C5 D1
 9    52    A0 82 00 33 02 00 01 C5 D9
 9    53    A0 82 00 34 02 00 01 C5 E1
 9    54    A0 82 00 35 02 00 01 C5 E9
 9    55    A0 82 00 36 02 00 01 C5 F1
 9    56    A0 82 00 37 02 00 01 C5 F9
 9    57    A0 82 00 38 02 00 01 C5 81
 9    58    A0 82 00 39 02 00 01 C5 89
 9    59    A0 82 00 3A 02 00 01 C5 91
 9    60    A0 82 00 3B 02 00 01 C5 99
 9    61    A0 82 00 3C 02 00 01 C5 A1
 9    62    A0 82 00 3D 02 00 01 C5 A9
 9    63    A0 82 00 3E 02 00 01 C5 B1
 9    64    A0 82 00 3F 02 00 01 C5 B9
 9    65    A0 82 00 40 02 00 01 C6 41
 9    66    A0 82 00 41 02 00 01 C6 49
 9    67    A0 82 00 42 02 00 01 C6 51
 9    68    A0 82 00 43 02 00 01 C6 59
 9    69    A0 82 00 44 02 00 01 C6 61
 9    70    A0 82 00 45 02 00 01 C6 69
 9    71    A0 82 00 46 02 00 01 C6 71
 9    72    A0 82 00 47 02 00 01 C6 79
 9    73    A0 82 00 48 02 00 01 C6 01
 9    74    A0 82 00 49 02 00 01 C6 09
 9    75    A0 82 00 4A 02 00 01 C6 11
 9    76    A0 82 00 4B 02 00 01 C6 19
 9    77    A0 82 00 4C 02 00 01 C6 21
 9    78    A0 82 00 4D 02 00 01 C6 29
 9    79    A0 82 00 4E 02 00 01 C6 31
 9    80    A0 82 00 4F 02 00 01 C6 39
 9    81    A0 82 00 50 02 00 01 C6 C1
 9    82    A0 82 00 51 02 00 01 C6 C9
 9    83    A0 82 00 52 02 00 01 C6 D1
 9    84    A0 82 00 53 02 00 01 C6 D9
 9    85    A0 82 00 54 02 00 01 C6 E1
 9    86    A0 82 00 55 02 00 01 C6 E9
 9    87    A0 82 00 56 02 00 01 C6 F1
 9    88    A0 82 00 57 02 00 01 C6 F9
 9    89    A0 82 00 58 02 00 01 C6 81
 9    90    A0 82 00 59 02 00 01 C6 89
 9    91    A0 82 00 5A 02 00 01 C6 91
 9    92    A0 82 00 5B 02 00 01 C6 99
 9    93    A0 82 00 5C 02 00 01 C6 A1
 9    94    A0 82 00 5D 02 00 01 C6 A9
 9    95    A0 82 00 5E 02 00 01 C6 B1
 9    96    A0 82 00 5F 02 00 01 C6 B9
 9    97    A0 82 00 60 02 00 01 C7 41
 9    98    A0 82 00 61 02 00 01 C7 49
 9    99    A0 82 00 62 02 00 01 C7 51
 9   100    A0 82 00 63 02 00 01 C7 59
 9   101    A0 82 00 64 02 00 01 C7 61
 9   102    A0 82 00 65 02 00 01 C7 69
 9   103    A0 82 00 66 02 00 01 C7 71
 9   104    A0 82 00 67 02 00 01 C7 79
 9   105    A0 82 00 68 02 00 01 C7 01
 9   106    A0 82 00 69 02 00 01 C7 09
 9   107    A0 82 00 6A 02 00 01 C7 11
 9   108    A0 82 00 6B 02 00 01 C7 19
 9   109    A0 82 00 6C 02 00 01 C7 21
 9   110    A0 82 00 6D 02 00 01 C7 29
 9   111    A0 82 00 6E 02 00 01 C7 31
 9   112    A0 82 00 6F 02 00 01 C7 39
 9   113    A0 82 00 70 02 00 01 C7 C1
 9   114    A0 82 00 71 02 00 01 C7 C9
 9   115    A0 82 00 72 02 00 01 C7 D1
 9   116    A0 82 00 73 02 00 01 C7 D9
 9   117    A0 82 00 74 02 00 01 C7 E1
 9   118    A0 82 00 75 02 00 01 C7 E9
 9   119    A0 82 00 76 02 00 01 C7 F1
 9   120    A0 82 00 77 02 00 01 C7 F9
 9   121    A0 82 00 78 02 00 01 C7 81
 9   122    A0 82 00 79 02 00 01 C7 89
 9   123    A0 82 00 7A 02 00 01 C7 91
 9   124    A0 82 00 7B 02 00 01 C7 99
 9   125    A0 82 00 7C 02 00 01 C7 A1
 9   126    A0 82 00 7D 02 00 01 C7 A9
 9   127    A0 82 00 7E 02 00 01 C7 B1
 9   128    A0 82 00 7F 02 00 01 C7 B9
 9   129    A0 82 00 80 02 00 01 C0 41
 9   130    A0 82 00 81 02 00 01 C0 49
 9   131    A0 82 00 82 02 00 01 C0 51
 9   132    A0 82 00 83 02 00 01 C0 59
 9   133    A0 82 00 84 02 00 01 C0 61
 9   134    A0 82 00 85 02 00 01 C0 69
 9   135    A0 82 00 86 02 02 00 C0 69
 9   136    A0 82 00 87 02 00 00 C0 71

10     1    A0 07 00 3F 02
10     2    A0 82 00 40 02 00 01 E3 04 /////
10     3    A0 82 00 01 02 40 00 E3 04 /////


New data with more variation added:
A0 07 01 26 43
A0 82 00 01 02 40 00 D1 52
A0 82 00 02 02 00 00 C1 92
A0 82 00 03 02 00 01 C1 92
A0 82 00 04 02 00 01 C0 52
A0 82 00 05 02 00 81 E0 12
A0 82 00 06 02 00 81 E0 D2
A0 82 00 07 02 00 01 C0 92
A0 82 00 08 02 00 01 C3 52
A0 82 00 09 02 00 01 C3 12
A0 82 00 0A 02 00 01 C3 D2
A0 82 00 0B 02 00 01 C3 92
A0 82 00 0C 02 00 01 C2 52
A0 82 00 0D 02 00 01 C2 12
A0 82 00 0E 02 01 00 C2 D2
A0 82 00 0F 02 00 00 C2 D2
A0 82 00 10 02 00 01 C5 52
A0 82 00 11 02 00 01 C5 12
A0 82 00 12 02 02 00 C5 12
A0 82 00 13 02 00 00 C5 D2
A0 82 00 14 02 01 00 C4 52
A0 82 00 15 02 00 00 C4 52
A0 82 00 16 02 00 81 E4 D2
A0 82 00 17 02 00 01 C4 92
A0 82 00 18 02 01 00 C7 52
A0 82 00 19 02 00 00 C7 52
A0 82 00 1A 02 01 00 C7 D2
A0 82 00 1B 02 00 00 C7 D2
A0 82 00 1C 02 00 01 C6 52
A0 82 00 1D 02 01 00 C6 12
A0 82 00 1E 02 00 00 C6 92
A0 82 00 1F 02 01 00 C6 92
A0 82 00 20 02 00 00 C9 12
A0 82 00 21 02 00 01 C9 12
A0 82 00 22 02 01 00 C9 D2
A0 82 00 23 02 00 00 C9 D2
A0 82 00 24 02 00 01 C8 52
A0 82 00 25 02 00 01 C8 12
A0 82 00 26 02 00 01 C8 D2
A0 82 00 27 02 00 01 C8 92
A0 82 00 28 02 00 01 CB 52
A0 82 00 29 02 00 01 CB 12
A0 82 00 2A 02 00 01 CB D2
A0 82 00 2B 02 00 81 EB 92
A0 82 00 2C 02 00 81 EA 52
A0 82 00 2D 02 00 81 EA 12
A0 82 00 2E 02 01 00 CA D2
A0 82 00 2F 02 00 00 CA D2
A0 82 00 30 02 00 81 ED 52
A0 82 00 31 02 00 81 ED 12
A0 82 00 32 02 01 00 CD D2
A0 82 00 33 02 00 00 CD D2
A0 82 00 34 02 01 00 CC 52
A0 82 00 35 02 00 00 CC 52
A0 82 00 36 02 01 00 CC D2
A0 82 00 37 02 00 00 CC D2
A0 82 00 38 02 00 81 EF 52
A0 82 00 39 02 00 81 EF 12
A0 82 00 3A 02 02 00 CF 12
A0 82 00 3B 02 00 00 CF D2
A0 82 00 3C 02 02 00 CE 92
A0 82 00 3D 02 00 00 CE 52
A0 82 00 3E 02 02 00 CE 12
A0 82 00 3F 02 00 00 CE D2
2

I edited your example data to include block- and line numbers to make referencing them easier. Unfortunately, this increased the size of the question to more than 32K, so i had to throw away some stuff at the end. Here is the rest of your data:

11     1    A0 82 00 01 02 40 00 E3 04 ////
11     2    A0 82 00 02 02 00 00 E2 08
11     3    A0 82 00 03 02 00 01 E2 08
11     4    A0 82 00 04 02 00 01 E2 14
11     5    A0 82 00 05 02 00 01 E2 10
11     6    A0 82 00 06 02 00 01 E2 1C
11     7    A0 82 00 07 02 00 01 E2 18
11     8    A0 82 00 08 02 00 01 E2 24
11     9    A0 82 00 09 02 00 01 E2 20
11    10    A0 82 00 0A 02 00 01 E2 2C
11    11    A0 82 00 0B 02 00 01 E2 28
11    12    A0 82 00 0C 02 00 01 E2 34
11    13    A0 82 00 0D 02 00 01 E2 30
11    14    A0 82 00 0E 02 00 01 E2 3C
11    15    A0 82 00 0F 02 00 01 E2 38
11    16    A0 82 00 10 02 00 01 E2 44
11    17    A0 82 00 11 02 00 01 E2 40
11    18    A0 82 00 12 02 00 01 E2 4C
11    19    A0 82 00 13 02 00 01 E2 48
11    20    A0 82 00 14 02 00 01 E2 54
11    21    A0 82 00 15 02 00 01 E2 50
11    22    A0 82 00 16 02 00 01 E2 5C
11    23    A0 82 00 17 02 00 01 E2 58
11    24    A0 82 00 18 02 00 01 E2 64
11    25    A0 82 00 19 02 00 01 E2 60
11    26    A0 82 00 1A 02 00 01 E2 6C
11    27    A0 82 00 1B 02 00 01 E2 68
11    28    A0 82 00 1C 02 00 01 E2 74
11    29    A0 82 00 1D 02 00 01 E2 70
11    30    A0 82 00 1E 02 00 01 E2 7C
11    31    A0 82 00 1F 02 00 01 E2 78
11    32    A0 82 00 20 02 00 01 E2 84
11    33    A0 82 00 21 02 00 01 E2 80
11    34    A0 82 00 22 02 00 01 E2 8C
11    35    A0 82 00 23 02 00 01 E2 88
11    36    A0 82 00 24 02 00 01 E2 94
11    37    A0 82 00 25 02 00 01 E2 90
11    38    A0 82 00 26 02 00 01 E2 9C
11    39    A0 82 00 27 02 00 01 E2 98
11    40    A0 82 00 28 02 00 01 E2 A4
11    41    A0 82 00 29 02 00 01 E2 A0
11    42    A0 82 00 2A 02 00 01 E2 AC
11    43    A0 82 00 2B 02 00 01 E2 A8
11    44    A0 82 00 2C 02 00 01 E2 B4
11    45    A0 82 00 2D 02 00 01 E2 B0
11    46    A0 82 00 2E 02 00 01 E2 BC
11    47    A0 82 00 2F 02 00 01 E2 B8
11    48    A0 82 00 30 02 00 01 E2 C4
11    49    A0 82 00 31 02 00 01 E2 C0
11    50    A0 82 00 32 02 00 01 E2 CC
11    51    A0 82 00 33 02 00 01 E2 C8
11    52    A0 82 00 34 02 00 01 E2 D4
11    53    A0 82 00 35 02 00 01 E2 D0
11    54    A0 82 00 36 02 00 01 E2 DC
11    55    A0 82 00 37 02 00 01 E2 D8
11    56    A0 82 00 38 02 00 01 E2 E4
11    57    A0 82 00 39 02 00 01 E2 E0
11    58    A0 82 00 3A 02 00 01 E2 EC
11    59    A0 82 00 3B 02 00 01 E2 E8
11    60    A0 82 00 3C 02 00 01 E2 F4
11    61    A0 82 00 3D 02 00 01 E2 F0
11    62    A0 82 00 3E 02 00 01 E2 FC
11    63    A0 82 00 3F 02 00 01 E2 F8
11    64    A0 82 00 40 02 00 01 E3 04  /////
11    65    A0 82 00 41 02 00 01 E3 00
11    66    A0 82 00 42 02 00 01 E3 0C
11    67    A0 82 00 43 02 00 01 E3 08
11    68    A0 82 00 44 02 00 01 E3 14
11    69    A0 82 00 45 02 00 01 E3 10
11    70    A0 82 00 46 02 00 01 E3 1C
11    71    A0 82 00 47 02 00 01 E3 18
11    72    A0 82 00 48 02 00 01 E3 24
11    73    A0 82 00 49 02 00 01 E3 20
11    74    A0 82 00 4A 02 00 01 E3 2C
11    75    A0 82 00 4B 02 00 01 E3 28
11    76    A0 82 00 4C 02 00 01 E3 34
11    77    A0 82 00 4D 02 00 01 E3 30
11    78    A0 82 00 4E 02 00 01 E3 3C
11    79    A0 82 00 4F 02 00 01 E3 38
11    80    A0 82 00 50 02 00 01 E3 44
11    81    A0 82 00 51 02 00 01 E3 40
11    82    A0 82 00 52 02 00 01 E3 4C
11    83    A0 82 00 53 02 00 01 E3 48
11    84    A0 82 00 54 02 00 01 E3 54
11    85    A0 82 00 55 02 00 01 E3 50
11    86    A0 82 00 56 02 00 01 E3 5C
11    87    A0 82 00 57 02 00 01 E3 58
11    88    A0 82 00 58 02 00 01 E3 64
11    89    A0 82 00 59 02 00 01 E3 60
11    90    A0 82 00 5A 02 00 01 E3 6C
11    91    A0 82 00 5B 02 02 00 E3 64
11    92    A0 82 00 5C 02 00 00 E3 70

12     1    A0 07 05 21 41
12     2    A0 82 00 01 02 40 00 15 05
12     3    A0 82 00 02 02 00 00 14 09
12     4    A0 82 00 03 02 00 01 14 09
12     5    A0 82 00 04 02 00 01 14 15
12     6    A0 82 00 05 02 00 01 14 11
12     7    A0 82 00 06 02 00 01 14 1D
12     8    A0 82 00 07 02 00 01 14 19
12     9    A0 82 00 08 02 00 01 14 25
12    10    A0 82 00 09 02 00 01 14 21
12    11    A0 82 00 0A 02 00 01 14 2D
12    12    A0 82 00 0B 02 00 01 14 29
12    13    A0 82 00 0C 02 00 01 14 35
12    14    A0 82 00 0D 02 00 01 14 31
12    15    A0 82 00 0E 02 00 01 14 3D
12    16    A0 82 00 0F 02 00 01 14 39
12    17    A0 82 00 10 02 00 01 14 45
12    18    A0 82 00 11 02 00 01 14 41
12    19    A0 82 00 12 02 00 01 14 4D
12    20    A0 82 00 13 02 00 01 14 49
12    21    A0 82 00 14 02 00 01 14 55
12    22    A0 82 00 15 02 00 01 14 51
12    23    A0 82 00 16 02 00 01 14 5D
12    24    A0 82 00 17 02 00 01 14 59
12    25    A0 82 00 18 02 00 01 14 65
12    26    A0 82 00 19 02 00 01 14 61
12    27    A0 82 00 1A 02 00 01 14 6D
12    28    A0 82 00 1B 02 00 01 14 69
12    29    A0 82 00 1C 02 00 01 14 75
12    30    A0 82 00 1D 02 00 01 14 71
12    31    A0 82 00 1E 02 00 01 14 7D
12    32    A0 82 00 1F 02 00 01 14 79
12    33    A0 82 00 20 02 00 01 14 85
12    34    A0 82 00 21 02 00 01 14 81
12    35    A0 82 00 22 02 00 01 14 8D
12    36    A0 82 00 23 02 00 01 14 89
12    37    A0 82 00 24 02 00 01 14 95
12    38    A0 82 00 25 02 00 01 14 91
12    39    A0 82 00 26 02 00 01 14 9D
12    40    A0 82 00 27 02 00 01 14 99
12    41    A0 82 00 28 02 00 01 14 A5
12    42    A0 82 00 29 02 00 01 14 A1
12    43    A0 82 00 2A 02 00 01 14 AD
12    44    A0 82 00 2B 02 00 01 14 A9
12    45    A0 82 00 2C 02 00 01 14 B5
12    46    A0 82 00 2D 02 00 01 14 B1
12    47    A0 82 00 2E 02 00 01 14 BD
12    48    A0 82 00 2F 02 00 01 14 B9
12    49    A0 82 00 30 02 00 01 14 C5
12    50    A0 82 00 31 02 00 01 14 C1
12    51    A0 82 00 32 02 00 01 14 CD
12    52    A0 82 00 33 02 00 01 14 C9
12    53    A0 82 00 34 02 00 01 14 D5
12    54    A0 82 00 35 02 00 01 14 D1
12    55    A0 82 00 36 02 00 01 14 DD
12    56    A0 82 00 37 02 00 01 14 D9
12    57    A0 82 00 38 02 00 01 14 E5
12    58    A0 82 00 39 02 00 01 14 E1
12    59    A0 82 00 3A 02 00 01 14 ED
12    60    A0 82 00 3B 02 00 01 14 E9
12    61    A0 82 00 3C 02 00 01 14 F5
12    62    A0 82 00 3D 02 00 01 14 F1
12    63    A0 82 00 3E 02 00 01 14 FD
12    64    A0 82 00 3F 02 00 01 14 F9
12    65    A0 82 00 40 02 00 01 15 05
12    66    A0 82 00 41 02 00 01 15 01
12    67    A0 82 00 42 02 00 01 15 0D
12    68    A0 82 00 43 02 00 01 15 09
12    69    A0 82 00 44 02 00 01 15 15
12    70    A0 82 00 45 02 00 01 15 11
12    71    A0 82 00 46 02 02 00 15 11
12    72    A0 82 00 47 02 00 00 15 1D

Answer section

Let's look at some packets that are almost the same, except for a few bits. As you've probably noted already, the 4th byte of each A0 82 message increases by one every time, so it's probably a counter, and as the 3rd byte is always zero, I assume that is the high byte of the counter, as none of your examples exceed 256 lines. Which means this 3rd byte changes every time, so let's look for examples that have everything but the 3rd byte identical.

If you check block 8, rows 5-9, and translate the 4th and last byte to binary

8  5    04  AC  0000 0100   1010 1100
8  6    05  AE  0000 0101   1010 1110
8  7    06  A8  0000 0110   1010 1000
8  8    07  AA  0000 0111   1010 1010
8  9    08  B4  0000 1000   1011 0100

now, as you see, in each of these cases

  • flipping bit 8 in the input flips bit 7 in the output (Lines 5,6 and 7,8)
  • flipping bit 7 and 8 in the input flips bits 6 and 7 in output (6,7)
  • flipping bit 5,6,7,8 flips bits 4,5,6,7

so this looks a lot like an XOR with the input rotated left by one bit.

Let's verify this with another block of similar data, 7-4 to 7-10

7  4    03  00  0000 0011   0000 0000
7  5    04  07  0000 0100   0000 0111
7  6    05  06  0000 0101   0000 0110
7  7    06  05  0000 0110   0000 0101
7  8    07  04  0000 0111   0000 0100
7  9    08  0B  0000 1000   0000 1011
7 10    09  0A  0000 1001   0000 1010

This time, there isn't a shift, but again, the same bits that flip in the input flip in the output as well. So, it seems like the A0 07 message seems to include information about how many bits to shift.

Next, let's check some of your cases that have identical 'checksums':

1     3    A0 82 00 02 02 00 00 CF 62  // Note 2
1     4    A0 82 00 03 02 00 01 CF 62  // Note 2

1    13    A0 82 00 0C 02 01 00 CF 7C
1    14    A0 82 00 0D 02 00 00 CF 7C

1    19    A0 82 00 12 02 01 00 CF 40
1    20    A0 82 00 13 02 00 00 CF 40

4    21    A0 82 00 14 02 01 00 9A F7
4    22    A0 82 00 15 02 00 00 9A F7

7    21    A0 82 00 14 02 00 00 43 16
7    22    A0 82 00 15 02 00 01 43 16

As you see, in all of these cases, flipping one bit in the counter is undone by flipping the same bit in byte 7 or 8, which means those bytes have the same amount of shift. And, as in all of your examples, byte 5 is 02, we can't gather any information about this byte.

Now, let's find out if we can find the amount of shift bits in the A0 07 message. Looking at it, we see the third byte is 03, 00, 01, 02, 00, 00, 05, 02, 04, 00, (missing), and 05. As the bit shift amount should be 0-7, this seems likely to have to do with it. Let's make a table comparing byte 3, and number of shifted bits; to make this easier, i've been looking for rows where only the last bit changes (increase from an even number to and odd one), and noted the XOR value of the checksum:

block   byte 3-5    example (inc 1) xor last byte   bit shift
1       03 2c 06    29,30       02      1
2       00 15 3A    7,8     04      2
3       01 06 5B    5,6     40      6
4       02 27 58    9,10        01      0
5       00 27 1A    5,6     04      2
6       00 1A 2F    7,8     80      7
7       05 22 40    5,6     01      0
8       02 50 34    4,5     02      1
9       04 3F 0B    5,6     08      3
10      00 3F 02    (none)
11      ?? ?? ??    (none)
12      05 21 41    5,6     04      2

Ok, seems it's not the first byte; the same first byte (block 5, 6) yields different shift values.

Writing bytes 3-5 in binary, and the bit shift in binary as well,

1   00000011 00101100 00000110  0001    1
2   00000000 00010101 00111010  0010    2
3   00000001 00000110 01011011  0110    6
4   00000010 00100111 01011000  0000    0
5   00000000 00100111 00011010  0010    2
6   00000000 00011010 00101111  0111    7
7   00000101 00100010 01000000  0000    0
8   00000010 01010000 00110100  0001    1
9   00000100 00111111 00001011  0011    3
12  00000101 00100001 01000001  0010    2

doesn't show an obvious pattern either.

To make sure my assumptions about shifting the bytes by some constant amount are correct, I wrote a small perl program to read the checksum bytes, xor them with the shifted data values, remember the result of the first line, and compare it to all other lines. Result: Within each of your examples, if you do this, the result is the same, but they are different if you do this with different examples. Which means it's probable that the initial three bytes contain a shift value and an initial checksum value, the data bytes are shifted and xored with that initial checksum, and the result is what's returned in the last two bytes. Example: In block 1, the A0 07 bytes are 03 2C 06, and the possible initial checksums are 4AE8, 48E0 and 4A60. In binary, these are the first row of the follwoing table.

00000011  00101100  00000110    1100111101100010  1100111001100110  1100111100100110  
00000000  00010101  00111010    0100101011101000  0100100011100000  0100101001100000  
00000001  00000110  01011011    1100110110000010  1110110100000010  1100010100000010  
00000010  00100111  01011000    1001101011100000  1001101001100010  1001101011000010  
00000000  00100111  00011010    1000001001101000  1000000001100000  1000001011100000  
00000000  00011010  00101111    1101011110001110  1001011010001110  1100011010001110  
00000101  00100010  01000000    0100001100000000  0100001110000010  0100001100100010  
00000010  01010000  00110100    1000111010100010  1000111110100110  1000111011100110  
00000100  00111111  00001011    1100010001011001  1100000001001001  1100010101001001  
00000101  00100001  01000001    0001010000001001  0001011000000001  0001010010000001  

As I didn't see any obvious patterns in this, I wrote another program to check if there are any input bits that always - or never - match the same output bit, which would mean the output bit is equal to or the inverse of the input bit. Result: Nothing, except that bits 0-3, 8 and 16 of the input, and bits 3, 27, 34 and 43 of the output are always zero, and bit 21 of the input matches bits 36 and 45 of the output.

I tried this with some variations on the input as well; rotating the last two bytes to the left/right by the number of bits given in the byte after A0 07, to no avail.

So, right now, I'm at a loss. I'm still quite sure the three bytes after A0 07 determine the shift and initial checksum of the algorithm for the A0 82 bytes, but I have no idea how. In case you're interested in my programs to experiment some more, here they are:

https://mega.nz/#!hYwhTIqT!jBhSDnNBRCGhBfhStVmZwXBDo6GrDB5hO3XEfJescR8

Update Dec 18

I wrote a new program to analyze your new data, calculate the shift from each section automatically, then try and find init sequences that have 2 of the 3 bytes identical, and output the shift value, checksum value, and the binary values of the different byte, the shift, and the checksum again. Here's the result:

 ==== comparing bytes 1 and 2 ==== 
01,26,1A: shift=4 chksum=b964 00011010 100 1011100101100100
01,26,24: shift=0 chksum=4bea 00100100 000 0100101111101010
01,3F,21: shift=2 chksum=e781 00100001 010 1110011110000001
01,3F,4E: shift=4 chksum=93e7 01001110 100 1001001111100111
02,17,1F: shift=4 chksum=bde5 00011111 100 1011110111100101
02,17,34: shift=0 chksum=5b72 00110100 000 0101101101110010
02,38,17: shift=4 chksum=7fee 00010111 100 0111111111101110
02,38,3A: shift=0 chksum=e74a 00111010 000 1110011101001010
02,38,3A: shift=0 chksum=e74a 00111010 000 1110011101001010
02,38,5E: shift=0 chksum=e6da 01011110 000 1110011011011010
03,36,0F: shift=1 chksum=6fb7 00001111 001 0110111110110111
03,36,25: shift=1 chksum=6d17 00100101 001 0110110100010111
03,41,19: shift=2 chksum=3da0 00011001 010 0011110110100000
03,41,1E: shift=2 chksum=3d40 00011110 010 0011110101000000
05,26,2B: shift=6 chksum=fd12 00101011 110 1111110100010010
05,26,30: shift=0 chksum=4bc2 00110000 000 0100101111000010
 ==== comparing bytes 1 and 3 ==== 
00,22,53: shift=3 chksum=2f89 00100010 011 0010111110001001
00,28,53: shift=3 chksum=7f89 00101000 011 0111111110001001
00,28,53: shift=3 chksum=7f89 00101000 011 0111111110001001
00,13,53: shift=3 chksum=a788 00010011 011 1010011110001000
01,50,4E: shift=4 chksum=73ea 01010000 100 0111001111101010
01,3F,4E: shift=4 chksum=93e7 00111111 100 1001001111100111
01,48,4F: shift=6 chksum=cf25 01001000 110 1100111100100101
01,5C,4F: shift=6 chksum=cf2f 01011100 110 1100111100101111
01,3A,54: shift=0 chksum=730a 00111010 000 0111001100001010
01,39,54: shift=0 chksum=750a 00111001 000 0111010100001010
02,27,0B: shift=4 chksum=b8e9 00100111 100 1011100011101001
02,12,0B: shift=4 chksum=f8e4 00010010 100 1111100011100100
04,4B,24: shift=4 chksum=c864 01001011 100 1100100001100100
04,49,24: shift=4 chksum=e864 01001001 100 1110100001100100
04,37,31: shift=1 chksum=6126 00110111 001 0110000100100110
04,4C,31: shift=1 chksum=9726 01001100 001 1001011100100110
05,39,11: shift=2 chksum=d601 00111001 010 1101011000000001
05,1D,11: shift=2 chksum=f600 00011101 010 1111011000000000
05,5A,1E: shift=4 chksum=39eb 01011010 100 0011100111101011
05,0C,1E: shift=4 chksum=f9e1 00001100 100 1111100111100001
05,26,30: shift=0 chksum=4bc2 00100110 000 0100101111000010
05,51,30: shift=0 chksum=a5c2 01010001 000 1010010111000010
 ==== comparing bytes 2 and 3 ==== 

There's no two init sequences that differ only in byte 1, but that was to be expected as the others have a lot more possible values.

There is a LibreOffice version of this that has relevant bytes colored at https://mega.nz/#!oAwSSITQ!xWcfLMB5_46iYSlOhm_Uh6g1cz_LRmxhXohZnw3uTQc

From this, we see that when bytes 1 and 3 are identical:

  • the shift value is identical as well
  • the number of bits that are different in the second byte equals the number of bits that are different in the third byte, marked yellow in the .odt document
  • in the case where we have 3 times the same bytes (00 xx 53), i marked the version that differs from the two others in red, and the patterns match between byte 2 and the checksum as well
  • the bits in the input byte 2 are not equal to the corresponding bits in the output, but the bits flip in the same way in all cases where byte 1 is the same, so byte 1 seems to be an index into an xor table
  • the bit difference patterns are shifted to the left/right by a different amount every time.

From this, it seems like byte 2 gets shifted and xored with some value determined by bytes 1 and 3, and it seems like the xor value is determined by the following table:

Byte 1   xor value
00       07
01       03
02       81
03       F8 (see below)
04       07
05       03
06       unknown
07       does not occur

Now, if we check the table where bytes 1 and 2 are the same, xor byte 2 with the value determined from byte 1, and search for this in the checksum bit pattern, we find that pattern every time, albeit shifted by different amounts. These patterns are marked in pink. However, there's some difference to the table; byte 0 = [ 01 or 05 ] seems to mean xor 03 in every case of the bottom table; it seems to mean xor 00 here in some cases.

So, no real result yet, but some progress, and it keeps being interesting.

  • Wow, I'm already impressed. :) I did some longer sessions and can confirm that you are spot on about the counter. It indeed is a 16 bit counter, rolling over from 00 FF to 01 00. Maybe the 82 07 frames contain information about different algorithms to use? Or is that a little far fetched? – user7202163 Dec 3 '16 at 22:10
  • I just noticed I messed up the data a little: Blocks 10 and 11 are in reality a single block. So the "A0 07 00 3F 02" is valid for all frames up to the next "A0 07". – user7202163 Dec 3 '16 at 23:22
  • Added new snif session with more variation to the start post. Maybe it helps... :) – user7202163 Dec 4 '16 at 22:16
  • I'm really stumped how the parameters to A0 07 correspond to the initial checksum and the shift in the A0 82 checksum algorithm though. Having as may communication start captures (the A0 07 and 5-10 A0 82 frames) as possible could help, especially if there are some that have 2 of the A0 07 bytes identical and only the third one different. – Guntram Blohm Dec 5 '16 at 15:54
  • Sorry, only just saw your response. I will gather some more sessions as per your request. – user7202163 Dec 10 '16 at 0:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.