read data from the android tv device
()
| 43 | |
| 44 | // read data from the android tv device |
| 45 | func (c *Command) read() ([]byte, error) { |
| 46 | len, err := c.Connection.Read(c.Buffer) |
| 47 | if err != nil { |
| 48 | return nil, err |
| 49 | } |
| 50 | if len < 5 { |
| 51 | return c.read() |
| 52 | } |
| 53 | |
| 54 | return c.Buffer[0:len], nil |
| 55 | } |
| 56 | |
| 57 | // send a configuration message to the android tv device |
| 58 | // this message must be sent before each command |