ssdp

package
v0.0.0-...-e4b4827 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// All is a search type to search all services and devices.
	All = "ssdp:all"

	// RootDevice is a search type to search UPnP root devices.
	RootDevice        = "upnp:rootdevice"
	UpnpMediaRenderer = "urn:schemas-upnp-org:device:MediaRenderer:1"
)

Variables

View Source
var Interfaces []net.Interface

Interfaces specify target interfaces to multicast. If no interfaces are specified, all interfaces will be used.

Functions

func Search(searchType string, waitSec int, ch chan<- *Service) error

Search searches services by SSDP.

func SetMulticastRecvAddrIPv4

func SetMulticastRecvAddrIPv4(addr string) error

SetMulticastRecvAddrIPv4 updates multicast address where to receive packets. This never fail now.

func SetMulticastSendAddrIPv4

func SetMulticastSendAddrIPv4(addr string) error

SetMulticastSendAddrIPv4 updates a UDP address to send multicast packets. This never fail now.

Types

type MediaRenderer

type MediaRenderer struct {
	XMLName xml.Name `xml:"root"`
	Device  struct {
		UDN              string `xml:"UDN"`
		FriendlyName     string `xml:"friendlyName"`
		ModelDescription string `xml:"modelDescription"`
		ModelName        string `xml:"modelName"`
		Manufacturer     string `xml:"manufacturer"`
	} `xml:"device"`
	XDevice struct {
		UrlBase    string `xml:"X_URLBase"`
		ControlUrl string `xml:"X_YxcControlURL"`
	} `xml:"X_device"`
}

func GetMediaRenderer

func GetMediaRenderer(device *Service) (*MediaRenderer, error)

func (*MediaRenderer) String

func (s *MediaRenderer) String() string

type Service

type Service struct {
	// Type is a property of "ST"
	Type string

	// USN is a property of "USN"
	USN string

	// Location is a property of "LOCATION"
	Location string

	// Server is a property of "SERVER"
	Server string
	// contains filtered or unexported fields
}

Service is discovered service.

func (*Service) Header

func (s *Service) Header() http.Header

Header returns all properties in response of search.

func (*Service) MaxAge

func (s *Service) MaxAge() int

MaxAge extracts "max-age" value from "CACHE-CONTROL" property.

func (*Service) String

func (s *Service) String() string

Directories

Path Synopsis
Package multicast provides utilities for network multicast.
Package multicast provides utilities for network multicast.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL