This commit is contained in:
cxh 2025-06-05 10:47:18 +08:00
parent 27a1c72446
commit d472ee5536
2 changed files with 3 additions and 3 deletions

View File

@ -33,4 +33,4 @@ set_target_properties(led_app PROPERTIES
BUILD_RPATH ${CMAKE_SOURCE_DIR}/lib
)
# toml11
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)

View File

@ -90,7 +90,7 @@ int main()
std::string port = "/dev/ttyS0";
int baudrate = 115200;
std::ifstream ifs("config.toml");
std::ifstream ifs("../config/config.toml");
if (ifs)
{
try
@ -117,7 +117,7 @@ int main()
std::cout << "串口号: " << port << "\n波特率: " << baudrate << std::endl;
MqttClient mqtt("config.toml");
MqttClient mqtt("../config/config.toml");
if (!mqtt.start())
{
std::cerr << "MQTT 启动失败" << std::endl;