device

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace = "urn:schemas-upnp-org:device-1-0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Desc

type Desc struct {
	XMLName     xml.Name `xml:"root"`
	Xmlns       string   `xml:"xmlns,attr"`
	SpecVersion struct {
		Major int `xml:"major"`
		Minor int `xml:"minor"`
	} `xml:"specVersion"`
	Device struct {
		DeviceType string `xml:"deviceType"`

		// Basic information
		UDN string `xml:"UDN"`
		UPC string `xml:"UPC,omitempty"`

		FriendlyName string `xml:"friendlyName"`
		SerialNumber string `xml:"serialNumber,omitempty"`

		// Manufacturer information
		Manufacturer    string `xml:"manufacturer"`
		ManufacturerURL string `xml:"manufacturerURL,omitempty"`

		// Model information
		ModelName        string `xml:"modelName"`
		ModelDescription string `xml:"modelDescription,omitempty"`
		ModelNumber      string `xml:"modelNumber,omitempty"`
		ModelURL         string `xml:"modelURL,omitempty"`

		// Icon list
		IconList struct {
			Icons []Icon `xml:"icon"`
		} `xml:"iconList"`

		// Service list
		ServiceList struct {
			Services []Service `xml:"service"`
		} `xml:"serviceList"`

		PresentationURL string `xml:"presentationURL,omitempty"`
	} `xml:"device"`
}

Desc is the whole device description document

func (*Desc) Init

func (d *Desc) Init(deviceType string) *Desc

Init fills fixed fields into Description document

type Icon

type Icon struct {
	MimeType string `xml:"mimetype"`
	Width    int    `xml:"width"`
	Height   int    `xml:"height"`
	Depth    int    `xml:"depth"`
	URL      string `xml:"url"`
}

type Service

type Service struct {
	ServiceType string `xml:"serviceType"`
	ServiceId   string `xml:"serviceId"`
	ScpdURL     string `xml:"SCPDURL"`
	ControlURL  string `xml:"controlURL"`
	EventSubURL string `xml:"eventSubURL"`
}

Jump to

Keyboard shortcuts

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