Documentation
¶
Overview ¶
A client implementation of the SSDP protocol.
mgr := ssdp.MakeManager() mgr.Discover("en0", "13104", false) qry := ssdp.ServiceQueryTerms{ ssdp.ServiceKey("schemas-upnp-org-MusicServices"): -1, } result := mgr.QueryServices(qry) if device_list, has := result["schemas-upnp-org-MusicServices"]; has { for _, device := range device_list { ... } } mgr.Close()
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device interface { // The product name (e.g. "Sonos") Product() string // The product version (e.g. "28.1-83040 (BR100)") ProductVersion() string // The device name (e.h. "ZonePlayer") Name() string // A URI that can be queried for device capabilities Location() Location // The device's Universally Unique ID UUID() UUID // Search for a service in the device's capabilities; same // return semantics as querying a map Service(key ServiceKey) (service Service, has bool) // Return a list of services implemented by this device Services() []ServiceKey }
An abstraction of an SSDP leaf device
type Manager ¶
type Manager interface { // Initiates SSDP discovery, where ifiname names a network device // to query, port gives a free port on that network device to listen // for responses, and the subscribe flag (currrently unimplemented) // determines whether to listen to asynchronous updates after the // initial query is complete. Discover(ifiname, port string, subscribe bool) error // After discovery is complete searches for devices implementing // the services specified in query. QueryServices(query ServiceQueryTerms) ServiceMap // Return the list of devices that were found during discovery Devices() DeviceMap // Shuts down asynchronous subscriptions to device state Close() error }
Encapsulates SSDP discovery, handles updates, and stores results
type Service ¶
type Service interface { // The version of the service Version() int64 }
An abstraction of an SSDP service
type ServiceMap ¶
type ServiceMap map[ServiceKey]DeviceMap
Discovered devices sorted by supported service
type ServiceQueryTerms ¶
type ServiceQueryTerms map[ServiceKey]int64
A map of service key to minimum required version
Click to show internal directories.
Click to hide internal directories.