Documentation ¶
Overview ¶
Package integra provides a client to communicate with an Integra (or Onkyo) A/V receiver device using the Integra Serial Control Protocol over Ethernet (eISCP).
Example usage:
device, _ := integra.Connect(":60128") client := device.NewClient() message := integra.Message{"PWR", "01"} client.Send(&message) message, _ = client.Receive() fmt.Println("Got message from Integra A/V receiver:", message) client.Close()
See server/server.go for a working example.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client is an Integra device network client.
func (*Client) Close ¶
func (c *Client) Close()
Close removes client from device. Client can no longer receive messages.
func (*Client) Receive ¶
Receive blocks until a new message is received from the Integra device and returns the message.
func (*Client) State ¶
State returns a map representing the known state of the Integra device. Keys are ISCP message commands that map to ISCP parameter values. Each pair reflects the most recently received value for the key. Example key:value pair: PWR:01.
To populate the state with a desired command:paremeter pair, send the corresponding QSTN message (e.g., PWRQSTN) prior to calling this method. Note that it may be necessary to sleep for ~50ms in between.
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device represents the Integra device, e.g. an A/V receiver.
func Connect ¶
Connect establishes a connection to the Integra device and returns a new Device. Only one network peer (i.e., Device) may be used to communicate with the Integra device at a time.
func (*Device) NewClient ¶
NewClient returns a new Integra device client, ready to send and receive messages.
func (*Device) NewSendOnlyClient ¶
NewSendOnlyClient returns a new Integra device client, ready to send messages. Client cannot receive messages.
type Message ¶
A Message is an ISCP message.
func NewMessage ¶
NewMessage returns a new Message from the given byte slice making up the message's command and parameter.
Directories ¶
Path | Synopsis |
---|---|
Mock Integra device server that echoes received messages back to client for testing.
|
Mock Integra device server that echoes received messages back to client for testing. |
Server provides a basic mobile-friendly web app to control and monitor an Integra device such as an A/V receiver.
|
Server provides a basic mobile-friendly web app to control and monitor an Integra device such as an A/V receiver. |