send a configuration message to the android tv device this message must be sent before each command
()
| 57 | // send a configuration message to the android tv device |
| 58 | // this message must be sent before each command |
| 59 | func (c *Command) sendConfiguration() error { |
| 60 | data := []byte{1, 0, 0, 21, 0, 0, 0, 1, 0, 0, 0, 1, 32, 3, 0, 0, 0, 0, 0, 0, 4, 116, 101, 115, 116} |
| 61 | c.Connection.Write(data) |
| 62 | |
| 63 | data, err := c.read() |
| 64 | if err != nil { |
| 65 | return err |
| 66 | } |
| 67 | if data[0] != 1 || data[1] != 7 || data[2] != 0 { |
| 68 | return errors.New("command - send: invalid ack") |
| 69 | } |
| 70 | _, err = c.read() |
| 71 | if err != nil { |
| 72 | return err |
| 73 | } |
| 74 | _, err = c.read() |
| 75 | if err != nil { |
| 76 | return err |
| 77 | } |
| 78 | return nil |
| 79 | } |
| 80 | |
| 81 | // emulate a key press on the android tv device |
| 82 | func (c *Command) SendKey(keycode common.RemoteKeyCode) error { |
no test coverage detected