Skip to content

Conversation

Topper69
Copy link
Contributor

@Topper69 Topper69 commented Feb 8, 2022

No description provided.

@zuckschwerdt
Copy link
Collaborator

Note that

  • crc8(&b[0], 10, 0x31, 0xdd) != PacketCRC) is identical to crc8(b, 11, 0x31, 0xdd) != 0 which is preferred.
  • temp_c = (int) b[8] - 40; does not need the cast, it's already int (C integer promotion)
  • the doc comment needs to be well-formed markdown, indent code blocks by 4 spaces, put dashes in lists.

@Topper69
Copy link
Contributor Author

Topper69 commented Feb 8, 2022

crc8 code + temp_c has been changed.
About the docs, not sure i have fixed all what you ask for :/ (not sure i have fully understood).

@zuckschwerdt
Copy link
Collaborator

Sorry for being unclear, the markdown should not be indented, just the code blocks:

/**
TPMS TyreGuard 400 from Davies Craig.

...
- Length          : 22 bytes long

Packet layout:

     1    2    3    4    5    6    7    8   9   10  11  12  13  14  15  16  17   18   19   20   21  22
     S/P  S/P  S/P  S/P  S/P  S/P  S/P  ID  ID  ID  ID  ID  ID  ID  Pr  Pr  Temp Temp Flg  Flg  CRC CRC
    
- S/P   : preamble/sync "0xfd5fd5f" << always fixed
...

@zuckschwerdt
Copy link
Collaborator

Oh and, pressure_kpa = b[7] | ((flags & 0x10)<<4) | ((flags & 0x20)<<4) | ((flags & 0x40)<<4) ; is pressure_kpa = b[7] | ((flags & 0x70) << 4); (1+2+4=7)

@Topper69
Copy link
Contributor Author

Topper69 commented Feb 8, 2022

Oh and, pressure_kpa = b[7] | ((flags & 0x10)<<4) | ((flags & 0x20)<<4) | ((flags & 0x40)<<4) ; is pressure_kpa = b[7] | ((flags & 0x70) << 4); (1+2+4=7)

Many thanks. Updated.

@zuckschwerdt zuckschwerdt merged commit 8c5e38f into merbanan:master Jan 21, 2023
obones pushed a commit to obones/rtl_433 that referenced this pull request Jan 30, 2023
andrewjw pushed a commit to andrewjw/rtl_433 that referenced this pull request Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants