#include #include #include #include "command.h" #define DO_CH_NUM 14 int main(int argc, char *argv[]) { unsigned char startChannel = 0; unsigned char stopChannel = 1; unsigned char *poutbuf = new unsigned char[2]{0, 0}; int result = CommandExecutor::getAIRange(startChannel, stopChannel, poutbuf); // 检查返回值 if (result != 0) { printf("Error: getAIRange failed with code %d\n", result); return result; } // 检查 poutbuf 是否为空 if (poutbuf == nullptr) { printf("Error: poutbuf is null\n"); return -1; } // 打印 poutbuf 的值 printf("poutbuf[0] = %u, poutbuf[1] = %u\n", poutbuf[0], poutbuf[1]); // 释放 poutbuf 的内存(假设 CommandExecutor::getAIRange 分配了内存) delete[] poutbuf; return 0; }