command

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Buffer       []byte
	BufferSize   int
	Connection   *tls.Conn
	Certificates *tls.Certificate
	Address      string
	Port         int
	Read         bool
	RemoteData   RemoteData
	Error        error
}

func New

func New(addr string, port int, certs *tls.Certificate) Command

Create a new command object with the ip and port of the android tv device and a certificate

func (*Command) Connect

func (c *Command) Connect() error

Connect to the android tv device

func (*Command) GetData

func (c *Command) GetData() (RemoteData, error)

Return informations on the current android tv device

func (c *Command) OpenLink(link string) error

open a link on the android tv device if the links matches the one defined in an app's manifest, the app will be launched else, the link will open in a browser

func (*Command) SendKey

func (c *Command) SendKey(keycode common.RemoteKeyCode) error

emulate a key press on the android tv device

type RemoteData

type RemoteData struct {
	Powered struct {
		Powered    bool      `json:"powered"`
		UpdateDate time.Time `json:"updateDate"`
	} `json:"powered"`
	App struct {
		CurrentApp string    `json:"currentApp"`
		UpdateDate time.Time `json:"updateDate"`
	} `json:"app"`
	Volume struct {
		Level       uint32    `json:"level"`
		Maximum     uint32    `json:"maximum"`
		Muted       bool      `json:"muted"`
		PlayerModel string    `json:"playerModel"`
		UpdateDate  time.Time `json:"updateDate"`
	} `json:"volume"`
	Device struct {
		Model      string    `json:"model"`
		Vendor     string    `json:"vendor"`
		Version    string    `json:"version"`
		UpdateDate time.Time `json:"updateDate"`
	} `json:"device"`
}

struct of available infos for the android tv device

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL