scpd

package
v0.0.0-...-eefa22b Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: MIT, BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SCPDXMLNamespace = "urn:schemas-upnp-org:service-1-0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name      string     `xml:"name"`
	Arguments []Argument `xml:"argumentList>argument"`
}

func (*Action) InputArguments

func (action *Action) InputArguments() []*Argument

func (*Action) OutputArguments

func (action *Action) OutputArguments() []*Argument

type AllowedValueRange

type AllowedValueRange struct {
	Minimum string `xml:"minimum"`
	Maximum string `xml:"maximum"`
	Step    string `xml:"step"`
}

type Argument

type Argument struct {
	Name                 string `xml:"name"`
	Direction            string `xml:"direction"`            // in|out
	RelatedStateVariable string `xml:"relatedStateVariable"` // ?
	Retval               string `xml:"retval"`               // ?
}

func (*Argument) IsInput

func (arg *Argument) IsInput() bool

func (*Argument) IsOutput

func (arg *Argument) IsOutput() bool

type DataType

type DataType struct {
	Name string `xml:",chardata"`
	Type string `xml:"type,attr"`
}

type SCPD

type SCPD struct {
	XMLName        xml.Name        `xml:"scpd"`
	ConfigId       string          `xml:"configId,attr"`
	SpecVersion    SpecVersion     `xml:"specVersion"`
	Actions        []Action        `xml:"actionList>action"`
	StateVariables []StateVariable `xml:"serviceStateTable>stateVariable"`
}

SCPD is the service description as described by section 2.5 "Service description" in http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf

func (*SCPD) Clean

func (scpd *SCPD) Clean()

Clean attempts to remove stray whitespace etc. in the structure. It seems unfortunately common for stray whitespace to be present in SCPD documents, this method attempts to make it easy to clean them out.

func (*SCPD) GetAction

func (scpd *SCPD) GetAction(action string) *Action

func (*SCPD) GetStateVariable

func (scpd *SCPD) GetStateVariable(variable string) *StateVariable

type SpecVersion

type SpecVersion struct {
	Major int32 `xml:"major"`
	Minor int32 `xml:"minor"`
}

SpecVersion is part of a SCPD document, describes the version of the specification that the data adheres to.

type StateVariable

type StateVariable struct {
	Name              string             `xml:"name"`
	SendEvents        string             `xml:"sendEvents,attr"` // yes|no
	Multicast         string             `xml:"multicast,attr"`  // yes|no
	DataType          DataType           `xml:"dataType"`
	DefaultValue      string             `xml:"defaultValue"`
	AllowedValueRange *AllowedValueRange `xml:"allowedValueRange"`
	AllowedValues     []string           `xml:"allowedValueList>allowedValue"`
}

Jump to

Keyboard shortcuts

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