Return informations on the current android tv device
()
| 205 | |
| 206 | // Return informations on the current android tv device |
| 207 | func (c *Command) GetData() (RemoteData, error) { |
| 208 | start := time.Now() |
| 209 | c.sendConfiguration() |
| 210 | // wait until data is available |
| 211 | for start.After(c.RemoteData.Powered.UpdateDate) || start.After(c.RemoteData.Device.UpdateDate) || start.After(c.RemoteData.App.UpdateDate) { |
| 212 | // timeout after 3 seconds |
| 213 | if time.Since(start) > time.Second*3 { |
| 214 | return c.RemoteData, errors.New("unable to fully retreive data") |
| 215 | } |
| 216 | } |
| 217 | return c.RemoteData, nil |
| 218 | } |
| 219 | |
| 220 | // send a configuration message to the android tv device |
| 221 | func (c *Command) sendConfiguration() error { |
no test coverage detected