Files
flutterApp/lib/core/protocol/protocol_constants.dart
2026-01-27 18:44:49 +08:00

19 lines
740 B
Dart

class ProtocolConstants {
// 固定字节
static const int header1 = 0xAB;
static const int header2 = 0xAA;
static const int endFlag1 = 0xAA;
static const int endFlag2 = 0xAB;
// 指令类型 (根据你的 CSV 文件)
static const int cmdRemoteControl = 0x00; // 远程遥控
static const int cmdPathPlanning = 0x01; // 路径规划
static const int cmdStatusInfo = 0x02; // 状态信息
static const int cmdGetId = 0x03; // 连接请求/查询ID
static const int cmdGetAuth = 0x04; // 获取授权
static const int cmdReadConfig = 0x05; // 读配置
static const int cmdWriteConfig = 0x06; // 写配置
static const int cmdObstacleAvoid = 0x07; // 避障
static const int cmdHeartbeat = 0xFF; // 心跳包
}