https://github.com/reddec/go-eiscp
eISCP protocol for Onkyo
https://github.com/reddec/go-eiscp
Last synced: over 1 year ago
JSON representation
eISCP protocol for Onkyo
- Host: GitHub
- URL: https://github.com/reddec/go-eiscp
- Owner: reddec
- License: mpl-2.0
- Created: 2015-07-22T16:23:42.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-22T20:05:31.000Z (almost 11 years ago)
- Last Synced: 2025-03-09T00:06:39.045Z (over 1 year ago)
- Language: Go
- Homepage: https://godoc.org/github.com/reddec/go-eiscp
- Size: 137 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-eiscp
eISCP protocol for Onkyo
Provides minimal eISCP protocol
# Example
### Create connection
```go
dev, err := eiscp.NewReceiver(*host)
if err != nil {
panic(err)
}
defer dev.Close()
// Do something else.....
```
### Set volume level to 50%
```go
err := dev.SetVolume(uint8(50))
// Process error....
```
### Get power state
```go
enabled, err := dev.GetPower()
// Process error and state...
```
### Write Onkyo command
```go
err := dev.WriteCommand("PWR", "01")
// Process error...
// Usually requires wait response
```
### Write raw eISCP message
```go
msg := Message{}
msg.Destination = 0x31 // Destination object
msg.Version = 0x01 // ISCP version
msg.ISCP = []byte("SOME-Command")
err := dev.WriteMessage(msg)
// Process error....
```
### Read raw eISCP message
```go
msg, err := dev.ReadMessage()
// Process error and message...
```