BxCmdClearScreen.go 579 B

12345678910111213141516171819202122232425
  1. package bx
  2. import (
  3. "bytes"
  4. "encoding/binary"
  5. )
  6. type BxCmdClearScreen struct {
  7. baseBxCmd
  8. }
  9. func NewBxCmdClearScreen(group, cmd byte) BxCmd {
  10. return BxCmdClearScreen{
  11. newBaseCmd(CMD_CLEAR_SCREEN.group, CMD_CLEAR_SCREEN.code)}
  12. }
  13. func (cs BxCmdClearScreen) Build() []byte {
  14. w := bytes.NewBuffer(make([]byte, 1024))
  15. binary.Write(w, binary.LittleEndian, cs.group)
  16. binary.Write(w, binary.LittleEndian, cs.cmd)
  17. binary.Write(w, binary.LittleEndian, cs.ReqResp())
  18. binary.Write(w, binary.LittleEndian, cs.r0)
  19. binary.Write(w, binary.LittleEndian, cs.r1)
  20. return w.Bytes()
  21. }