model.go 434 B

123456789101112
  1. package lampControl
  2. type DataPack struct {
  3. Start byte //帧起始符,恒为0x68,1字节
  4. Addr string //地址域,6字节,整数,大端传输
  5. Start2 byte //帧起始符,恒为0x68,1字节
  6. Ctl uint8 //控制码,1字节
  7. DataLen uint8 //数据域长度,1字节
  8. Data []byte //数据域
  9. Cs uint8 //Start到Cs之前的所有字节模256
  10. End byte //结束符号,恒为0x16,1字节
  11. }