新增 Hc05 类,支持 HC-05 蓝牙模块的串口通信,增加串口设置波特率函数
All checks were successful
Build and Upload Artifact / build and upload-artifact (push) Successful in 19m59s

This commit is contained in:
chauyin
2025-05-12 21:57:21 +08:00
parent c3e0edd72d
commit 17d298c782
9 changed files with 119 additions and 18 deletions

View File

@@ -7,12 +7,14 @@
class CanMv {
public:
explicit CanMv(UART_HandleTypeDef* uart) : serialPort(std::make_unique<SerialPort>(uart, kLength, kTimeout)) {}
explicit CanMv(UART_HandleTypeDef* uart)
: serialPort(std::make_unique<SerialPort>(uart, kBaudRate, kLength, kTimeout)) {}
~CanMv() = default;
private:
static constexpr uint32_t kLength = 128;
static constexpr uint32_t kTimeout = 10;
static constexpr uint32_t kBaudRate = 115200;
static constexpr uint32_t kLength = 128;
static constexpr uint32_t kTimeout = 10;
std::unique_ptr<SerialPort> serialPort;
};