MCPcopy Create free account
hub / github.com/drosoCode/atvremote / sendConfiguration

Method sendConfiguration

pkg/v1/command/command.go:59–79  ·  view source on GitHub ↗

send a configuration message to the android tv device this message must be sent before each command

()

Source from the content-addressed store, hash-verified

57// send a configuration message to the android tv device
58// this message must be sent before each command
59func (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
82func (c *Command) SendKey(keycode common.RemoteKeyCode) error {

Callers 2

SendKeyMethod · 0.95
SendIntentMethod · 0.95

Calls 1

readMethod · 0.95

Tested by

no test coverage detected