Documentation ¶
Overview ¶
Package gosqueeze provides an interface to configure Logitech SqueezeBox devices over a network.
This package is inspired by the work of Robin Bowes and his Net-UDAP Perl module. In particular the packet format was deciphered based on his work.
This module was created specifically for use in the github.com/jcrummy/sbconfig program, however it is available for use in other contexts as well.
Basics ¶
You must specificy a network interface to use for sending broadcast messages. Note replies are listened for on all interfaces due to limitations in broadcast handling.
// Discover what devices are available on the network sbs, _ = gosqueeze.Discover(iface) // Get information about a specific device sbs[0].GetIP(iface) sbs[0].GetData(iface) // Modify a configuration point on the device sbs[0].Data.WirelessSSID = "NewSSID" // Save configuration changes to the device sbs[0].SaveData(iface)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceData ¶ added in v0.0.3
type DeviceData struct { LanIPMode bool `gosqueeze:"4,1"` // false = static IP, true = DHCP LanNetworkAddress net.IP `gosqueeze:"5,4"` // static network address LanSubnetMask net.IP `gosqueeze:"9,4"` // static subnet mask LanGateway net.IP `gosqueeze:"13,4"` // static gateway address Hostname string `gosqueeze:"17,33"` // device hostname Bridging bool `gosqueeze:"50,1"` // true = use device as wireless bridge Interface uint8 `gosqueeze:"52,1"` // 0 = use Wireless, 1 = use Wired PrimaryDNS net.IP `gosqueeze:"59,4"` // static primary DNS address SecondaryDNS net.IP `gosqueeze:"67,4"` // static secondary DNS address ActiveServerAddress net.IP `gosqueeze:"71,4"` // IP address of currently active server (read only) SqueezeCenterAddress net.IP `gosqueeze:"79,4"` // IP address of local Squeezecenter server SqueezeCenterName string `gosqueeze:"83,33"` // Name of local Squeezecenter server (read only) WirelessMode uint8 `gosqueeze:"173,1"` // 0 = infrastructure, 1 = Ad Hoc WirelessSSID string `gosqueeze:"183,33"` // SSID of WiFi access point to connect to WirelessChannel uint8 `gosqueeze:"216,1"` // WiFi Channel, can normally leave at 0 WirelessRegion uint8 `gosqueeze:"218,1"` // 4 = US, 6 = CA, 7 = AU, 13 = FR, 14 = EU, 16 = JP, 21 = TW, 23 = CH WirelessKeylen uint8 `gosqueeze:"220,1"` // Length of wireless key (0 = 64-bit, 1 = 128-bit) WirelessWEPKey0 []byte `gosqueeze:"222,13"` // WEP key 0 - in Hex WirelessWEPKey1 []byte `gosqueeze:"235,13"` // WEP key 1 - in Hex WirelessWEPKey2 []byte `gosqueeze:"248,13"` // WEP key 2 - in Hex WirelessWEPKey3 []byte `gosqueeze:"261,13"` // WEP key 3 - in Hex WirelessWEPOn bool `gosqueeze:"274,1"` // 0 = Wep Off, 1 = Wep On WirelessWPACipher uint8 `gosqueeze:"275,1"` // 1 = TKIIP, 2 = AES, 3 = TKIP & AES WirelessWPAMode uint8 `gosqueeze:"276,1"` // 1 = WPA, 2 = WPA2 WirelessWPAOn bool `gosqueeze:"277,1"` // 0 = WPA Off, 1 = WPA On WirelessWPAPSK string `gosqueeze:"278,64"` // WPA Public Shared Key }
DeviceData is the configuration data of the device Tagged as offset,data length (in bytes)
type Sb ¶
type Sb struct { MacAddr net.HardwareAddr IPAddr net.IP GatewayAddr net.IP SubnetMask net.IPMask ID uint Type string Name string Status string HardwareRev uint FirmwareRev uint Data DeviceData }
Sb represents a squeezebox receiver device