send a configuration message to the android tv device
()
| 219 | |
| 220 | // send a configuration message to the android tv device |
| 221 | func (c *Command) sendConfiguration() error { |
| 222 | err := c.write(pb.RemoteMessage{ |
| 223 | RemoteConfigure: &pb.RemoteConfigure{ |
| 224 | Code1: 622, |
| 225 | DeviceInfo: &pb.RemoteDeviceInfo{ |
| 226 | Model: "androidtvremote", |
| 227 | Vendor: "drosocode", |
| 228 | Unknown1: 1, |
| 229 | Unknown2: "1", |
| 230 | PackageName: "androitv-remote", |
| 231 | AppVersion: "1.0.0", |
| 232 | }, |
| 233 | }, |
| 234 | }) |
| 235 | if err != nil { |
| 236 | return err |
| 237 | } |
| 238 | err = c.write(pb.RemoteMessage{ |
| 239 | RemoteSetActive: &pb.RemoteSetActive{ |
| 240 | Active: 622, |
| 241 | }, |
| 242 | }) |
| 243 | if err != nil { |
| 244 | return err |
| 245 | } |
| 246 | |
| 247 | return nil |
| 248 | } |
| 249 | |
| 250 | // emulate a key press on the android tv device |
| 251 | func (c *Command) SendKey(keycode common.RemoteKeyCode) error { |