* @brief Maps a bitrate in bits/s to the analyzer's configuration code, or 0 when unsupported. */
| 56 | * @brief Maps a bitrate in bits/s to the analyzer's configuration code, or 0 when unsupported. |
| 57 | */ |
| 58 | [[nodiscard]] static std::uint8_t seeedBitrateCode(std::uint32_t bitrate) |
| 59 | { |
| 60 | switch (bitrate) { |
| 61 | case 1000000: |
| 62 | return 0x01; |
| 63 | case 800000: |
| 64 | return 0x02; |
| 65 | case 500000: |
| 66 | return 0x03; |
| 67 | case 250000: |
| 68 | return 0x05; |
| 69 | case 125000: |
| 70 | return 0x07; |
| 71 | case 100000: |
| 72 | return 0x08; |
| 73 | case 50000: |
| 74 | return 0x09; |
| 75 | case 20000: |
| 76 | return 0x0a; |
| 77 | case 10000: |
| 78 | return 0x0b; |
| 79 | default: |
| 80 | return 0x00; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * @brief Decodes one variable-length packet at the front of @p buf (which must start with 0xAA). |
no outgoing calls
no test coverage detected