* @brief Maps a bitrate in bits/s to its LAWICEL "Sn" index, or -1 when unsupported. */
| 42 | * @brief Maps a bitrate in bits/s to its LAWICEL "Sn" index, or -1 when unsupported. |
| 43 | */ |
| 44 | [[nodiscard]] static int slcanBitrateIndex(std::uint32_t bitrate) |
| 45 | { |
| 46 | for (std::size_t i = 0; i < std::size(kSlcanBitrates); ++i) |
| 47 | if (kSlcanBitrates[i] == bitrate) |
| 48 | return static_cast<int>(i); |
| 49 | |
| 50 | return -1; |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * @brief Decodes a single LAWICEL frame token (t/T/r/R) into a QCanBusFrame. |