Documentation ¶
Index ¶
- Constants
- Variables
- func Discover() (string, error)
- func SetLogger(l onkyologger)
- type Command
- type Device
- func (d *Device) Close() error
- func (d *Device) Connect() error
- func (d *Device) GetAudioInformation() (string, error)
- func (d *Device) GetDetails() (*NRI, error)
- func (d *Device) GetDimmer() (string, error)
- func (d *Device) GetDisplayMode() (string, error)
- func (d *Device) GetFLInformation() (string, error)
- func (d *Device) GetFirmwareVersion() (string, error)
- func (d *Device) GetHDMIOut() (string, error)
- func (d *Device) GetISF() (string, error)
- func (d *Device) GetListeningMode() (string, error)
- func (d *Device) GetMonitorResolution() (string, error)
- func (d *Device) GetMute() (bool, error)
- func (d *Device) GetNetworkInfo() (string, error)
- func (d *Device) GetNetworkJacketArt() (string, error)
- func (d *Device) GetNetworkListInfo() (*NLS, error)
- func (d *Device) GetNetworkMenuStatus() (*NetworkMenuStatus, error)
- func (d *Device) GetNetworkPlayStatus() (*NetworkPlayStatus, error)
- func (d *Device) GetNetworkStatus() (*NetworkStatus, error)
- func (d *Device) GetNetworkTitle() (*NLT, error)
- func (d *Device) GetNetworkTitleName() (string, error)
- func (d *Device) GetPower() (bool, error)
- func (d *Device) GetPreset() (string, error)
- func (d *Device) GetSource() (string, error)
- func (d *Device) GetSourceByCode() (Source, error)
- func (d *Device) GetTempData() (uint8, error)
- func (d *Device) GetVideoInformation() (string, error)
- func (d *Device) GetVolume() (uint8, error)
- func (d *Device) GetWideVideoMode() (string, error)
- func (d *Device) SelectNetworkListItem(i int) error
- func (d *Device) SetGetAll(command, arg string) (*MultiMessage, error)
- func (d *Device) SetGetOne(command, arg string) (*Message, error)
- func (d *Device) SetListeningMode(code string) (string, error)
- func (d *Device) SetMute(mute bool) (bool, error)
- func (d *Device) SetNetworkJacketArt(s bool) (bool, error)
- func (d *Device) SetNetworkPlayStatus(s string) (string, error)
- func (d *Device) SetNetworkPreset(p string) (string, error)
- func (d *Device) SetNetworkService(s string) error
- func (d *Device) SetNetworkServiceTuneIn() error
- func (d *Device) SetOnly(command, arg string) error
- func (d *Device) SetPower(on bool) (*Message, error)
- func (d *Device) SetPreset(p string) (string, error)
- func (d *Device) SetSource(source Source) (*Message, error)
- func (d *Device) SetSourceByCode(code int) (*Message, error)
- func (d *Device) SetVolume(level uint8) (uint8, error)
- type DeviceType
- type Message
- type MultiMessage
- type NLS
- type NLT
- type NRI
- type NetSource
- type NetworkMenuStatus
- type NetworkPlayStatus
- type NetworkStatus
- type Source
Constants ¶
const ( NetSrcDLNA NetSource = "00" NetSrcFavorite = "01" NetSrcVTuner = "02" NetSrcSiriusXM = "03" NetSrcPandora = "04" NetSrcRhapsody = "05" NetSrcLastFM = "06" NetSrcNapster = "07" NetSrcSlacker = "08" NetSrcMediafly = "09" NetSrcSpotify = "0A" NetSrcAUPEO = "0B" NetSrcRadiko = "0C" NetSrcEOnkyo = "0D" NetSrcTuneIn = "0E" NetSrcMP3Tunes = "0F" NetSrcSimfy = "10" NetSrcHomeMedia = "11" NetSrcDeezer = "12" NetSrciHeartRadio = "13" NetSrcUnknown = "FF" )
Sample sources
const ( SrcVCR Source = "00" SrcCBL = "01" SrcGame = "02" SrcAux1 = "03" SrcAux2 = "04" SrcPC = "05" SrcVideo7 = "06" SrcDVD = "10" SrcStrm = "11" SrcTV = "12" SrcTape = "20" SrcTape2 = "21" SrcPhono = "22" SrcCD = "23" SrcFM = "24" SrcAM = "25" SrcTuner = "26" SrcDLNA2 = "27" SrcInternetRadio = "28" SrcUsbFront = "29" SrcUsbRear = "2A" SrcNetwork = "2B" SrcUSBToggle = "2C" SrcAirplay = "2D" SrcBluetooth = "2E" SrcDAC = "2F" SrcMultiChan = "30" SrcXM = "31" SrcSirius = "32" SrcDAB = "33" SrcUniversal = "40" SrcLine = "41" SrcLine2 = "42" SrcOptical = "44" SrcCoax = "45" SrcHDMI5 = "55" SrcHDMI6 = "56" SrcHDMI7 = "57" )
Sample sources
Variables ¶
var DimmerState = map[string]string{
"Bright": "00",
"Medium": "01",
"Dim": "02",
"Off": "03",
"Bright & LED-Off": "08",
"unknown": "ff",
}
var ListeningModes = map[string]string{
"00": "stereo",
"01": "direct",
"02": "surround",
"03": "[film, game-rpg]",
"04": "thx",
"05": "[action, game-action]",
"06": "[musical, game-rock]",
"07": "mono-movie",
"08": "orchestra",
"09": "unplugged",
"0A": "studio-mix",
"0B": "tv-logic",
"0C": "all-ch-stereo",
"0D": "theater-dimensional",
"0E": "enhanced-7, enhance, game-sports",
"0F": "mono",
"11": "pure-audio",
"12": "multiplex",
"13": "full-mono",
"14": "[dolby-virtual, surround-enhanced]",
"15": "dts-surround-sensation",
"16": "audyssey-dsx",
"1F": "whole house",
"23": "stage",
"25": "action",
"26": "music",
"2E": "sports",
"40": "straight-decode",
"41": "dolby-ex",
"42": "thx-cinema",
"43": "thx-surround-ex",
"44": "thx-music",
"45": "thx-games",
"50": "[thx-u2, s1, i, s-cinema, cinema2]",
"51": "[thx-musicmode, thx-u2, s2, i, s-music]",
"52": "[thx-games, thx-u2, s2, i, s-games]",
"80": "[plii, pliix-movie, dolby-atmos, dolby-surround]",
"81": "[plii, pliix-music]",
"82": "[neo-6-cinema, neo-x-cinema, dts-x, neural-x]",
"83": "[neo-6-music, neo-x-music]",
"84": "[plii, pliix-thx-cinema, dolby-surround-thx-cinema]",
"85": "[neo-6, neo-x-thx-cinema, dts-neural-x-thx-cinema]",
"86": "[plii, pliix-game]",
"87": "neural-surr",
"88": "[neural-thx, nexural-surround]",
"89": "[plii, pliix-thx-games, dolby-surround-thx-games]",
"8A": "[neo-6, neo-x-thx-games, dts-neural-x-thx-games]",
"8B": "[plii, pliix-thx-music, dolby-surround-thx-music]",
"8C": "[neo-6, neo-x-thx-music, dts-neural-x-thx-music]",
"8D": "neural-thx-cinema",
"8E": "neural-thx-music",
"8F": "neural-thx-games",
"90": "pliiz-height",
"91": "neo-6-cinema-dts-surround-sensation",
"92": "neo-6-music-dts-surround-sensation",
"93": "neural-digital-music",
"94": "pliiz-height-thx-cinema",
"95": "pliiz-height-thx-music",
"96": "pliiz-height-thx-games",
"97": "[pliiz-height-thx-u2, s2-cinema]",
"98": "[pliiz-height-thx-u2, s2-music]",
"99": "[pliiz-height-thx-u2, s2-games]",
"9A": "neo-x-game",
"A0": "[pliix, plii-movie-audyssey-dsx]",
"A1": "[pliix, plii-music-audyssey-dsx]",
"A2": "[pliix, plii-game-audyssey-dsx]",
"A3": "neo-6-cinema-audyssey-dsx",
"A4": "neo-6-music-audyssey-dsx",
"A5": "neural-surround-audyssey-dsx",
"A6": "neural-digital-music-audyssey-dsx",
"A7": "dolby-ex-audyssey-dsx",
"FF": "auto-surround",
"MOVIE": "movie",
"MUSIC": "music",
"GAME": "game",
"THX": "thx",
"AUTO": "auto",
"SURR": "surr",
"STEREO": "stereo",
}
var Menu menu
var NetSourceByName = map[string]NetSource{ "DLNA": NetSrcDLNA, "Favorite": NetSrcFavorite, "vTuner": NetSrcVTuner, "SiriusXM": NetSrcSiriusXM, "Pandora": NetSrcPandora, "Rhapsody": NetSrcRhapsody, "Last.fm": NetSrcLastFM, "Napster": NetSrcNapster, "Slacker": NetSrcSlacker, "Mediafly": NetSrcMediafly, "Spotify": NetSrcSpotify, "AUPEO!": NetSrcAUPEO, "radiko": NetSrcRadiko, "e-Onkyo": NetSrcEOnkyo, "TuneIn": NetSrcTuneIn, "mp3Tunes": NetSrcMP3Tunes, "Simfy": NetSrcSimfy, "HomeMedia": NetSrcHomeMedia, "Deezer": NetSrcDeezer, "iHeartRadio": NetSrciHeartRadio, "unknown": NetSrcUnknown, }
SourceByName - map channel name to source enum const
var NetSourceToName = map[NetSource]string{ NetSrcDLNA: "DLNA", NetSrcFavorite: "Favorite", NetSrcVTuner: "vTuner", NetSrcSiriusXM: "SiriusXM", NetSrcPandora: "Pandora", NetSrcRhapsody: "Rhapsody", NetSrcLastFM: "Last.fm", NetSrcNapster: "Napster", NetSrcSlacker: "Slacker", NetSrcMediafly: "Mediafly", NetSrcSpotify: "Spotify", NetSrcAUPEO: "AUPEO!", NetSrcRadiko: "radiko", NetSrcEOnkyo: "e-Onkyo", NetSrcTuneIn: "TuneIn", NetSrcMP3Tunes: "mp3Tunes", NetSrcSimfy: "Simfy", NetSrcHomeMedia: "HomeMedia", NetSrcDeezer: "Deezer", NetSrciHeartRadio: "iHeartRadio", NetSrcUnknown: "unknown", }
var SourceByName = map[string]Source{ "vcr": SrcVCR, "cbl": SrcCBL, "game": SrcGame, "aux1": SrcAux1, "aux2": SrcAux2, "pc": SrcPC, "dvd": SrcDVD, "phono": SrcPhono, "cd": SrcCD, "fm": SrcFM, "am": SrcAM, "tuner": SrcTuner, "dlna2": SrcDLNA2, "internet-radio": SrcInternetRadio, "usb-front": SrcUsbFront, "usb-rear": SrcUsbRear, "network": SrcNetwork, "video7": SrcVideo7, "strm-box": SrcStrm, "tape": SrcTape, "tape2": SrcTape2, "tv": SrcTV, "bluetooth": SrcBluetooth, "dac": SrcDAC, "airplay": SrcAirplay, "usb-toggle": SrcUSBToggle, "line": SrcLine, "line2": SrcLine2, "universal": SrcUniversal, "optical": SrcOptical, "coax": SrcCoax, "multi-ch": SrcMultiChan, "xm": SrcXM, "sirius": SrcSirius, "dab": SrcDAB, "hdmi-5": SrcHDMI5, "hdmi-6": SrcHDMI6, "hdmi-7": SrcHDMI7, }
SourceByName - map channel name to source enum const
var SourceToName = map[Source]string{ SrcVCR: "vcr", SrcCBL: "cbl", SrcGame: "game", SrcAux1: "aux1", SrcAux2: "aux2", SrcPC: "pc", SrcVideo7: "video7", SrcDVD: "dvd", SrcStrm: "strm-box", SrcTV: "TV", SrcTape: "tape", SrcTape2: "tape1", SrcPhono: "phono", SrcCD: "cd", SrcFM: "fm", SrcAM: "am", SrcTuner: "tuner", SrcDLNA2: "dlna2", SrcInternetRadio: "internet-radio", SrcUsbFront: "usb-front", SrcUsbRear: "usb-rear", SrcNetwork: "network", SrcUSBToggle: "usb-toggle", SrcAirplay: "airplay", SrcBluetooth: "bluetooth", SrcDAC: "dac", SrcMultiChan: "multi-ch", SrcXM: "xm", SrcSirius: "sirius", SrcDAB: "dab", SrcUniversal: "universal", SrcLine: "line", SrcLine2: "line2", SrcOptical: "optical", SrcCoax: "coax", SrcHDMI5: "hdmi-5", SrcHDMI6: "hdmi-6", SrcHDMI7: "hdmi-7", }
SourceToName - map source enum to channel name XXX finish this
Functions ¶
Types ¶
type Device ¶
Device of Onkyo receiver
func NewReceiver ¶
NewReceiver - sugar for NewDevice with Receiver as device type and version 1
func (*Device) GetAudioInformation ¶
func (*Device) GetDetails ¶
func (*Device) GetDisplayMode ¶
func (*Device) GetFirmwareVersion ¶
func (*Device) GetListeningMode ¶
func (*Device) GetMonitorResolution ¶
func (*Device) GetNetworkJacketArt ¶
func (*Device) GetNetworkListInfo ¶
func (*Device) GetNetworkMenuStatus ¶
func (d *Device) GetNetworkMenuStatus() (*NetworkMenuStatus, error)
func (*Device) GetNetworkPlayStatus ¶
func (d *Device) GetNetworkPlayStatus() (*NetworkPlayStatus, error)
func (*Device) GetNetworkStatus ¶
func (d *Device) GetNetworkStatus() (*NetworkStatus, error)
func (*Device) GetNetworkTitle ¶
func (*Device) GetNetworkTitleName ¶
func (*Device) GetSource ¶
GetSource - Get Onkyo source channel. Use SourceToName to get readable name
func (*Device) GetSourceByCode ¶
GetSourceByCode - Get Onkyo source channel. Use SourceToName to get readable name
func (*Device) GetTempData ¶
func (*Device) GetVideoInformation ¶
func (*Device) SelectNetworkListItem ¶
func (*Device) SetGetAll ¶
func (d *Device) SetGetAll(command, arg string) (*MultiMessage, error)
Set sends a command and returns all responses
func (*Device) SetNetworkJacketArt ¶
this should return a bool...
func (*Device) SetNetworkPlayStatus ¶
prs : e.g. Sxx or Pxx p -> Play Status: "S": STOP, "P": Play, "p": Pause, "F": FF, "R": FR, "E": EOF r Repeat Status: "-": Off, "R": All, "F": Folder, "1": Repeat 1, "x": disable s Shuffle Status: "-": Off, "S": All , "A": Album, "F": Folder, "x": disable
func (*Device) SetNetworkService ¶
func (*Device) SetNetworkServiceTuneIn ¶
func (*Device) SetSourceByCode ¶
SetSourceByCode - Set Onkyo source channel by code
type DeviceType ¶
type DeviceType byte
DeviceType - device destination code in ISCP
const (
TypeReceiver DeviceType = 0x31
)
Destination code
type Message ¶
type Message struct { Parsed interface{} // the response value pased into ... whatever is appropriate Command string // verify you've got the right Command Response string // the response value Version byte // always the same Destination byte // always the same Valid bool // if the packet was able to be parsed // contains filtered or unexported fields }
Message eISCP
func (*Message) BuildEISCP ¶
BuildEISCP - Build ISCP message into ethernet frame
type MultiMessage ¶
type MultiMessage struct {
Messages []*Message
}
type NLT ¶
type NLT struct { ServiceType NetSource UIType string // 1 - int // 0 : List, 1 : Menu, 2 : Playback, 3 : Popup, 4 : Keyboard, 5 : Menu LayerType string // 1 - int // 0 : NET TOP, 1 : Service Top,DLNA/USB/iPod Top, 2 : under 2nd Layer CurrentPos string // 4 - hex NumItems string // 4 - hex NumLayers string // 2 - hex Reserved string // 2 - unused IconL NetSource IconR NetSource Status string // 2 -- hex -- lookup table // 00 : None, 01 : Connecting, 02 : Acquiring License, 03 : Buffering 04 : Cannot Play, 05 : Searching, 06 : Profile update, 07 : Operation disabled 08 : Server Start-up, 09 : Song rated as Favorite, 0A : Song banned from station, 0B : Authentication Failed, 0C : Spotify Paused(max 1 device), 0D : Track Not Available, 0E : Cannot Skip Title string // the rest }
type NRI ¶
type NRI struct { XMLName xml.Name `xml:"response"` Device struct { ID string `xml:"id,attr"` Brand string `xml:"brand"` Category string `xml:"category"` Year string `xml:"year"` Model string `xml:"model"` Destination string `xml:"destination"` ProductID string `xml:"productid"` DeviceSerial string `xml:"deviceserial"` MacAddress string `xml:"macaddress"` ModelIconURL string `xml:"modeliconurl"` FriendlyName string `xml:"friendlyname"` FirmwareVersion string `xml:"firmwareversion"` EcosystemVersion string `xml:"ecosystemversion"` NetServiceList struct { NetService []struct { ID string `xml:"id,attr"` Value string `xml:"value,attr"` Name string `xml:"name,attr"` Account string `xml:"account,attr"` Password string `xml:"password,attr"` Zone string `xml:"zone,attr"` Enable string `xml:"enable,attr"` Addqueue string `xml:"addqueue,attr"` Sort string `xml:"sort,attr"` } `xml:"netservice"` } `xml:"netservicelist"` ZoneList struct { Zone []struct { ID string `xml:"id,attr"` Value string `xml:"value,attr"` Name string `xml:"name,attr"` Volmax string `xml:"volmax,attr"` Volstep string `xml:"volstep,attr"` Src string `xml:"src,attr"` Dst string `xml:"dst,attr"` Lrselect string `xml:"lrselect,attr"` } `xml:"zone"` } `xml:"zonelist"` SelectorList struct { Selector []struct { ID string `xml:"id,attr"` Value string `xml:"value,attr"` Name string `xml:"name,attr"` Zone string `xml:"zone,attr"` Iconid string `xml:"iconid,attr"` } `xml:"selector"` } `xml:"selectorlist"` PresetList struct { Preset []struct { ID string `xml:"id,attr"` Band string `xml:"band,attr"` Freq string `xml:"freq,attr"` Name string `xml:"name,attr"` } `xml:"preset"` } `xml:"presetlist"` ControlList struct { Control []struct { ID string `xml:"id,attr"` Value string `xml:"value,attr"` Zone string `xml:"zone,attr"` Min string `xml:"min,attr"` Max string `xml:"max,attr"` Step string `xml:"step,attr"` Code string `xml:"code,attr"` Position string `xml:"position,attr"` } `xml:"control"` } `xml:"controllist"` FunctionList struct { Function []struct { ID string `xml:"id,attr"` Value string `xml:"value,attr"` } `xml:"function"` } `xml:"functionlist"` Tuners struct { Tuner []struct { Band string `xml:"band,attr"` Min string `xml:"min,attr"` Max string `xml:"max,attr"` Step string `xml:"step,attr"` } `xml:"tuner"` } `xml:"tuners"` } `xml:"device"` }