BxCmdCancelTimingSwitch.go 651 B

123456789101112131415161718192021222324252627
  1. package bx
  2. import (
  3. "bytes"
  4. "encoding/binary"
  5. )
  6. type CmdCancelTimingSwitch struct {
  7. baseBxCmd
  8. }
  9. func NewCmdCancelTimingSwitch() CmdCancelTimingSwitch {
  10. return CmdCancelTimingSwitch{
  11. baseBxCmd: newBaseCmd(CMD_CANCEL_TIMING_SWITCH.group, CMD_CANCEL_TIMING_SWITCH.code),
  12. }
  13. }
  14. func (cmd CmdCancelTimingSwitch) Build() []byte {
  15. w := bytes.NewBuffer(make([]byte, 0, 8))
  16. binary.Write(w, binary.LittleEndian, cmd.Group())
  17. binary.Write(w, binary.LittleEndian, cmd.Cmd())
  18. binary.Write(w, binary.LittleEndian, cmd.ReqResp())
  19. //r0 r1
  20. binary.Write(w, binary.LittleEndian, byte(0x00))
  21. binary.Write(w, binary.LittleEndian, byte(0x00))
  22. return nil
  23. }