send an intent to the android tv device can be used to start an app with a specific activity ex: com.netflix.ninja/.MainActivity
(intent string)
| 117 | // can be used to start an app with a specific activity |
| 118 | // ex: com.netflix.ninja/.MainActivity |
| 119 | func (c *Command) SendIntent(intent string) error { |
| 120 | err := c.sendConfiguration() |
| 121 | if err != nil { |
| 122 | return err |
| 123 | } |
| 124 | |
| 125 | //intent:#Intent;component= |
| 126 | iStart := []byte{105, 110, 116, 101, 110, 116, 58, 35, 73, 110, 116, 101, 110, 116, 59, 99, 111, 109, 112, 111, 110, 101, 110, 116, 61} |
| 127 | // ex: com.netflix.ninja/.MainActivity |
| 128 | intentMsg := append(iStart, text2byte(intent)...) |
| 129 | // append ;end |
| 130 | intentMsg = append(intentMsg, []byte{59, 101, 110, 100}...) |
| 131 | |
| 132 | message := append([]byte{1, 16, 0, byte(len(intentMsg))}, intentMsg...) |
| 133 | |
| 134 | _, err = c.Connection.Write(message) |
| 135 | if err != nil { |
| 136 | return err |
| 137 | } |
| 138 | |
| 139 | return nil |
| 140 | } |
no test coverage detected