update ErrorCode, status, lifecycle

This commit is contained in:
2026-07-06 15:55:14 +07:00
parent 323715eab0
commit 397b9ab3c5
12 changed files with 253 additions and 69 deletions

View File

@@ -15,9 +15,11 @@ void on_signal(int) { g_running = false; }
void run_lidar(lidarlib::LidarConfig cfg) {
std::unique_ptr<lidarlib::Lidar> lidar = lidarlib::make_lidar(cfg);
if (!lidar->open()) {
fprintf(stderr, "[%s] khong mo duoc %s %s:%u\n",
cfg.name.c_str(), cfg.brand.c_str(), cfg.ip.c_str(), cfg.port);
lidarlib::ErrorCode err = lidar->open();
if (err != lidarlib::ErrorCode::Ok) {
fprintf(stderr, "[%s] khong mo duoc %s %s:%u (%s)\n",
cfg.name.c_str(), cfg.brand.c_str(), cfg.ip.c_str(), cfg.port,
lidarlib::to_string(err));
return;
}
printf("[%s] da mo %s %s:%u (model=%s, inverted=%d)\n",