#include #include #include #include #include #include #include #include "camera_log.h" class CommandExecutor { private: static std::string executeCommand(const std::string &command) { // 使用 popen 执行命令并捕获其输出 std::unique_ptr pipe(popen(command.c_str(), "r"), pclose); if (!pipe) { IT3256_LOGI("it3256 Failed to execute command %{public}s", command.c_str()); std::cerr << ": Failed to execute command: " << command << std::endl; return "-1"; } // 读取命令的输出 char buffer[128]; std::string result; while (fgets(buffer, sizeof(buffer), pipe.get()) != nullptr) { result += buffer; } IT3256_LOGI("it3256 success to execute command %{public}s", result.c_str()); return result; } public: static int getAIRange(unsigned char startChannel, unsigned char stopChannel, unsigned char *poutbuf); };