Documentation ¶
Index ¶
- func GetKeyCodeByName(name string) int
- func GetLogicalAddressByName(name string) int
- func GetLogicalNameByAddress(addr int) string
- func GetVendorByID(id uint64) string
- type Connection
- func (c *Connection) Destroy()
- func (c *Connection) GetActiveDevices() [16]bool
- func (c *Connection) GetDeviceCecVersion(address int) string
- func (c *Connection) GetDeviceMenuLanguage(address int) string
- func (c *Connection) GetDeviceOSDName(address int) string
- func (c *Connection) GetDevicePhysicalAddress(address int) string
- func (c *Connection) GetDevicePowerStatus(address int) string
- func (c *Connection) GetDeviceVendorID(address int) uint64
- func (c *Connection) GetLibInfo() string
- func (c *Connection) IsActiveSource(address int) bool
- func (c *Connection) Key(address int, key interface{})
- func (c *Connection) KeyPress(address int, key int) error
- func (c *Connection) KeyRelease(address int) error
- func (c *Connection) List() map[string]Device
- func (c *Connection) Mute() error
- func (c *Connection) PowerOn(address int) error
- func (c *Connection) Standby(address int) error
- func (c *Connection) ToggleMute()
- func (c *Connection) Transmit(command string)
- func (c *Connection) VolumeDown() error
- func (c *Connection) VolumeUp() error
- type Device
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKeyCodeByName ¶
GetKeyCodeByName - get the keycode by its name
func GetLogicalAddressByName ¶
GetLogicalAddressByName - get logical address by its name
func GetLogicalNameByAddress ¶
GetLogicalNameByAddress - get logical name by address
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection class
func Open ¶
func Open(name string, deviceName string, printLogs bool) (*Connection, error)
Open - open a new connection to the CEC device with the given name
func (*Connection) GetActiveDevices ¶
func (c *Connection) GetActiveDevices() [16]bool
GetActiveDevices - returns an array of active devices
func (*Connection) GetDeviceCecVersion ¶
func (c *Connection) GetDeviceCecVersion(address int) string
func (*Connection) GetDeviceMenuLanguage ¶
func (c *Connection) GetDeviceMenuLanguage(address int) string
func (*Connection) GetDeviceOSDName ¶
func (c *Connection) GetDeviceOSDName(address int) string
GetDeviceOSDName - get the OSD name of the specified device
func (*Connection) GetDevicePhysicalAddress ¶
func (c *Connection) GetDevicePhysicalAddress(address int) string
GetDevicePhysicalAddress - Get the physical address of the device at the given logical address
func (*Connection) GetDevicePowerStatus ¶
func (c *Connection) GetDevicePowerStatus(address int) string
GetDevicePowerStatus - Get the power status of the device at the given address
func (*Connection) GetDeviceVendorID ¶
func (c *Connection) GetDeviceVendorID(address int) uint64
GetDeviceVendorID - Get the Vendor-ID of the device at the given address
func (*Connection) GetLibInfo ¶
func (c *Connection) GetLibInfo() string
func (*Connection) IsActiveSource ¶
func (c *Connection) IsActiveSource(address int) bool
IsActiveSource - check if the device at the given address is the active source
func (*Connection) Key ¶
func (c *Connection) Key(address int, key interface{})
Key - send key press and release commands (hold key for 10ms) to the device at the given address, the key code can be specified as a hex-code or by its name
func (*Connection) KeyPress ¶
func (c *Connection) KeyPress(address int, key int) error
KeyPress - send a key press (down) command code to the given address
func (*Connection) KeyRelease ¶
func (c *Connection) KeyRelease(address int) error
KeyRelease - send a key releas command to the given address
func (*Connection) List ¶
func (c *Connection) List() map[string]Device
List - list active devices (returns a map of Devices)
func (*Connection) Mute ¶
func (c *Connection) Mute() error
Mute - send a mute/unmute command to the amp if present
func (*Connection) PowerOn ¶
func (c *Connection) PowerOn(address int) error
PowerOn - power on the device with the given logical address
func (*Connection) Standby ¶
func (c *Connection) Standby(address int) error
Standby - put the device with the given address in standby mode
func (*Connection) ToggleMute ¶
func (c *Connection) ToggleMute()
func (*Connection) Transmit ¶
func (c *Connection) Transmit(command string)
Transmit CEC command - command is encoded as a hex string with colons (e.g. "40:04")
func (*Connection) VolumeDown ¶
func (c *Connection) VolumeDown() error
VolumeDown - send a volume down command to the amp if present
func (*Connection) VolumeUp ¶
func (c *Connection) VolumeUp() error
VolumeUp - send a volume up command to the amp if present