upnp

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: BSD-3-Clause Imports: 14 Imported by: 1

Documentation

Overview

Package go-net-upnp provides UPnP control point and device frameworks to implement the control point and any devices.

go-net-upnp supports UPnP control functions. The control point can search UPnP devices in the local network, get the device and service descriptions. and post actions in the service:

cp := upnp.NewControlPoint()
err := cp.Start()
...
defer cp.Stop()
...
err = cp.SearchRootDevice()
...
for n, dev := range cp.GetRootDevices() {
	...
}

The control point can post actions in the service, and get the action response:

service, err := dev.GetServiceByType("xxxx")
...
action, err := service.GetActionByName("xxxx")
...
action.SetArgumentString("xxxx", "xxxx")
err = action.Post()
...
resArg = action.GetArgumentString("xxxx")

In addition to the control point functions, go-net-upnp supports UPnP device functions to implement any UPnP devices using Go.

To implement UPnP devices, prepare the UPnP device and service descriptions as the following:

type SampleDevice struct {
	*upnp.Device
	...
}

func NewSampleDevice() (*SampleDevice, error) {
	dev, err := upnp.NewDeviceFromDescription(xxxxDeviceDescription)
	...
	service, err := dev.GetServiceByType("urn:schemas-upnp-org:service:xxxx:x")
	...
	err = service.LoadDescriptionBytes([]byte(xxxxServiceDescription))
	...
	sampleDev := &SampleDevice{
		Device: dev,
		...
	}
	return sampleDev, nil
}

Next, implement the control actions in the service descriptions using upnp.ActionListener as the following:

sampleDev, err := NewSampleDevice()
...
sampleDev.ActionListener = sampleDev
...
func (self *SampleDevice) ActionRequestReceived(action *upnp.Action) upnp.Error {
	switch action.Name {
	case SetTarget:
		xxxx, err := action.GetArgumentString(xxxx)
		...
		err := action.SetArgumentBool(...., ....)
		...
		return nil
	case xxxx
		...
	}
	return upnp.NewErrorFromCode(upnp.ErrorOptionalActionNotImplemented)
}

Index

Constants

View Source
const (
	ProductName = "go-net-upnp"

	SupportVersion      = "1.1"
	SupportVersionMajor = 1
	SupportVersionMinor = 1

	ControlPointDefaultPortBase  = 5004
	ControlPointDefaultPortRange = 1024
	ControlPointDefaultPortMax   = ControlPointDefaultPortBase + ControlPointDefaultPortRange
	ControlPointDefaultSearchMX  = ssdp.DefaultMSearchMX

	DeviceDefaultPortBase  = 6004
	DeviceDefaultPortRange = 1024
	DeviceDefaultPortMax   = DeviceDefaultPortBase + DeviceDefaultPortRange
	DeviceUUIDPrefix       = "uuid:"

	DeviceProtocol              = "http"
	DeviceDefaultDescriptionURL = "/description.xml"

	In  = "in"
	Out = "out"

	UnknownDirection = 0
	InDirection      = 1
	OutDirection     = 2
)
View Source
const (
	ErrorInvalidAction                = control.ErrorInvalidAction
	ErrorInvalidArgs                  = control.ErrorInvalidArgs
	ErrorActionFailed                 = control.ErrorActionFailed
	ErrorArgumentValueInvalid         = control.ErrorArgumentValueInvalid
	ErrorArgumentValueOutOfRange      = control.ErrorArgumentValueOutOfRange
	ErrorOptionalActionNotImplemented = control.ErrorOptionalActionNotImplemented
	ErrorOutOfMemory                  = control.ErrorOutOfMemory
	ErrorHumanInterventionRequired    = control.ErrorHumanInterventionRequired
	ErrorStringArgumentTooLong        = control.ErrorStringArgumentTooLong
)
View Source
const (
	ProductVersion = "0.8.3"
)

Variables

This section is empty.

Functions

func NewActionRequestFromAction

func NewActionRequestFromAction(action *Action) (*control.ActionRequest, error)

NewActionRequestFromAction returns a new Request.

func NewActionResponseFromAction

func NewActionResponseFromAction(action *Action) (*control.ActionResponse, error)

NewActionResponseFromAction returns a new Response.

func NewArgumentFromArgument

func NewArgumentFromArgument(arg *Argument) *control.Argument

NewArgument returns a new argument.

func NewErrorResponseFromError

func NewErrorResponseFromError(upnpError Error) *control.ErrorResponse

NewErrorResponseFromError returns a new error response.

Types

type Action

type Action struct {
	XMLName       xml.Name     `xml:"action"`
	Name          string       `xml:"name"`
	ArgumentList  ArgumentList `xml:"argumentList"`
	ParentService *Service     `xml:"-"`
}

A Action represents a UPnP action.

func NewAction

func NewAction() *Action

NewAction returns a new Action.

func (*Action) GetArgumentBool

func (action *Action) GetArgumentBool(name string) (bool, error)

GetArgumentBool return a boolean value into the specified argument.

func (*Action) GetArgumentByName

func (action *Action) GetArgumentByName(name string) (*Argument, error)

GetArgumentByName returns an argument by the specified name.

func (*Action) GetArgumentFloat

func (action *Action) GetArgumentFloat(name string) (float64, error)

GetArgumentFloat return a integer value into the specified argument.

func (*Action) GetArgumentInt

func (action *Action) GetArgumentInt(name string) (int, error)

GetArgumentInt return a integer value into the specified argument.

func (*Action) GetArgumentString

func (action *Action) GetArgumentString(name string) (string, error)

GetArgumentString return a string value into the specified argument.

func (*Action) GetArguments

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

GetArguments returns all arguments.

func (*Action) GetInputArguments

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

GetInputArguments returns all input arguments.

func (*Action) GetOutputArguments

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

GetOutputArguments returns all output arguments.

func (*Action) Post

func (action *Action) Post() error

Post sends the specified arguments into the deveice.

func (*Action) SetArgumentBool

func (action *Action) SetArgumentBool(name string, value bool) error

SetArgumentBool sets a boolean value into the specified argument.

func (*Action) SetArgumentFloat

func (action *Action) SetArgumentFloat(name string, value float64) error

SetArgumentFloat sets a integer value into the specified argument.

func (*Action) SetArgumentInt

func (action *Action) SetArgumentInt(name string, value int) error

SetArgumentInt sets a integer value into the specified argument.

func (*Action) SetArgumentString

func (action *Action) SetArgumentString(name string, value string) error

SetArgumentString sets a string value into the specified argument.

func (*Action) SetArgumentsByActionRequest

func (action *Action) SetArgumentsByActionRequest(actionReq *control.ActionRequest) error

SetArgumentsByActionRequest sets request arguments into the specified argument.

func (*Action) SetArgumentsByActionResponse

func (action *Action) SetArgumentsByActionResponse(actionRes *control.ActionResponse) error

SetArgumentsByActionResponse sets response arguments into the specified argument.

type ActionList

type ActionList struct {
	XMLName xml.Name `xml:"actionList"`
	Actions []Action `xml:"action"`
}

A ActionList represents a UPnP action list.

type AllowedValue

type AllowedValue struct {
	XMLName xml.Name `xml:"allowedValue"`
	Value   string   `xml:",innerxml"`
}

A AllowedValue represents a UPnP allowed value.

func NewAllowedValue

func NewAllowedValue() *AllowedValue

NewAllowedValue returns a new AllowedValue.

type AllowedValueList

type AllowedValueList struct {
	XMLName       xml.Name       `xml:"allowedValueList"`
	AllowedValues []AllowedValue `xml:"allowedValue"`
}

A AllowedValueList represents a UPnP allowed value list.

type AllowedValueRange

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

A AllowedValueRange represents a icon. NOTE : Minimum, Maximum and Step uses string type instead float64

because some devices sets a blank into the fields such as BUFFALO WZR-900DHP

func NewAllowedValueRange

func NewAllowedValueRange() *AllowedValueRange

NewAllowedValueRange returns a new AllowedValueRange.

type Argument

type Argument struct {
	XMLName              xml.Name `xml:"argument"`
	Name                 string   `xml:"name"`
	Direction            string   `xml:"direction"`
	RelatedStateVariable string   `xml:"relatedStateVariable"`

	Value        string  `xml:"-"`
	ParentAction *Action `xml:"-"`
}

A Argument represents a UPnP argument.

func NewArgument

func NewArgument() *Argument

NewArgument returns a new Argument.

func (*Argument) GetBool

func (arg *Argument) GetBool() (bool, error)

GetBool return a boolean value into the specified argument.

func (*Argument) GetDirection

func (arg *Argument) GetDirection() int

GetDirection returns a directional integer of the specified argument.

func (*Argument) GetFloat

func (arg *Argument) GetFloat() (float64, error)

GetFloat return a integer value into the specified argument.

func (*Argument) GetInt

func (arg *Argument) GetInt() (int, error)

GetInt return a integer value into the specified argument.

func (*Argument) GetString

func (arg *Argument) GetString() (string, error)

GetString returns a string value into the specified argument.

func (*Argument) IsInDirection

func (arg *Argument) IsInDirection() bool

IsInDirection returns true when the argument direction is in, otherwise false.

func (*Argument) IsOutDirection

func (arg *Argument) IsOutDirection() bool

IsOutDirection returns true when the argument direction is out, otherwise false.

func (*Argument) SetBool

func (arg *Argument) SetBool(value bool) error

SetBool sets a boolean value into the specified argument.

func (*Argument) SetDirection

func (arg *Argument) SetDirection(dir int) bool

SetDirection sets a directional string of the specified diractional integer.

func (*Argument) SetFloat

func (arg *Argument) SetFloat(value float64) error

SetFloat sets a integer value into the specified argument.

func (*Argument) SetInt

func (arg *Argument) SetInt(value int) error

SetInt sets a integer value into the specified argument.

func (*Argument) SetString

func (arg *Argument) SetString(value string) error

SetString sets a string value into the specified argument.

type ArgumentList

type ArgumentList struct {
	XMLName   xml.Name   `xml:"argumentList"`
	Arguments []Argument `xml:"argument"`
}

A ArgumentList represents a UPnP argument list.

type ControlPoint

type ControlPoint struct {
	*sync.Mutex

	Port     int
	SearchMX int

	Listener ControlPointListener
	// contains filtered or unexported fields
}

A ControlPoint represents a ControlPoint.

func NewControlPoint

func NewControlPoint() *ControlPoint

NewControlPoint returns a new ControlPoint.

func (*ControlPoint) DeviceNotifyReceived

func (ctrl *ControlPoint) DeviceNotifyReceived(ssdpReq *ssdp.Request)

func (*ControlPoint) DeviceResponseReceived

func (ctrl *ControlPoint) DeviceResponseReceived(ssdpRes *ssdp.Response)

func (*ControlPoint) DeviceSearchReceived

func (ctrl *ControlPoint) DeviceSearchReceived(ssdpReq *ssdp.Request)

func (*ControlPoint) FindDeviceByTypeAndUDN

func (ctrl *ControlPoint) FindDeviceByTypeAndUDN(deviceType string, udn string) (*Device, bool)

FindDeviceByTypeAndUDN returns a devices of the specified deviceType and UDN.

func (*ControlPoint) GetRootDevices

func (ctrl *ControlPoint) GetRootDevices() []*Device

GetRootDevices returns found root devices.

func (*ControlPoint) GetRootDevicesByType

func (ctrl *ControlPoint) GetRootDevicesByType(deviceType string) []*Device

GetRootDevicesByType returns found root devices of the specified device type.

func (*ControlPoint) Search

func (ctrl *ControlPoint) Search(st string) error

Search sends a M-SEARCH request of the specified ST.

func (*ControlPoint) SearchRootDevice

func (ctrl *ControlPoint) SearchRootDevice() error

SearchRootDevice sends a M-SEARCH request for root devices.

func (*ControlPoint) Start

func (ctrl *ControlPoint) Start() error

Start starts this control point.

func (*ControlPoint) StartWithPort

func (ctrl *ControlPoint) StartWithPort(port int) error

Start starts this control point.

func (*ControlPoint) Stop

func (ctrl *ControlPoint) Stop() error

Stop stops this control point.

type ControlPointListener

type ControlPointListener interface {
	ssdp.MulticastListener
	ssdp.UnicastListener
}

A ControlPointListener represents a listener for ControlPoint.

type Device

type Device struct {
	*DeviceDescription
	SpecVersion SpecVersion `xml:"-"`
	URLBase     string      `xml:"-"`

	ParentDevice   *Device              `xml:"-"`
	Port           int                  `xml:"-"`
	HTTPListener   DeviceHTTPListener   `xml:"-"`
	SSDPListener   DeviceSSDPListener   `xml:"-"`
	ActionListener DeviceActionListener `xml:"-"`
	LocationURL    string               `xml:"-"`
	DescriptionURL string               `xml:"-"`
	// contains filtered or unexported fields
}

A Device represents a UPnP device.

func NewDevice

func NewDevice() *Device

NewDevice returns a new Device.

func NewDeviceFromDescription

func NewDeviceFromDescription(devDesc string) (*Device, error)

NewDeviceFromDescription returns a device from the specified string.

func NewDeviceFromDescriptionURL

func NewDeviceFromDescriptionURL(descURL string) (*Device, error)

NewDeviceFromDescriptionURL returns a device from the specified URL.

func NewDeviceFromSSDPRequest

func NewDeviceFromSSDPRequest(ssdpReq *ssdp.Request) (*Device, error)

NewDeviceFromSSDPRequest returns a device from the specified SSDP packet.

func NewDeviceFromSSDPResponse

func NewDeviceFromSSDPResponse(ssdpRes *ssdp.Response) (*Device, error)

NewDeviceFromSSDPRequest returns a device from the specified SSDP packet.

func (*Device) DescriptionString

func (dev *Device) DescriptionString() (string, error)

DescriptionString returns a descrition string.

func (*Device) DeviceNotifyReceived

func (dev *Device) DeviceNotifyReceived(ssdpReq *ssdp.Request)

func (*Device) DeviceSearchReceived

func (dev *Device) DeviceSearchReceived(ssdpReq *ssdp.Request)

func (*Device) GetAbsoluteURL

func (dev *Device) GetAbsoluteURL(path string) (*url.URL, error)

GetAbsoluteURL return a absolute URL of the specified path using URLBase or LocationURL.

func (*Device) GetEmbeddedDeviceByType

func (dev *Device) GetEmbeddedDeviceByType(deviceType string) (*Device, error)

GetEmbeddedDeviceByType returns a embedded device by the specified deviceType.

func (*Device) GetEmbeddedDevices

func (dev *Device) GetEmbeddedDevices() []*Device

GetEmbeddedDevices returns all embedded devices.

func (*Device) GetRootDevice

func (dev *Device) GetRootDevice() *Device

GetRootDevice returns the root device.

func (*Device) GetServiceByControlURL

func (dev *Device) GetServiceByControlURL(ctrlURL string) (*Service, error)

GetServiceByControlURL returns a service by the specified control URL.

func (*Device) GetServiceByEventSubURL

func (dev *Device) GetServiceByEventSubURL(eventURL string) (*Service, error)

GetServiceByEventSubURL returns a service by the specified event subscription URL.

func (*Device) GetServiceByID added in v0.8.3

func (dev *Device) GetServiceByID(serviceID string) (*Service, error)

GetServiceByID returns a service by the specified serviceId.

func (*Device) GetServiceByType

func (dev *Device) GetServiceByType(serviceType string) (*Service, error)

GetServiceByType returns a service by the specified serviceType.

func (*Device) GetServices

func (dev *Device) GetServices() []*Service

GetServices returns all services.

func (*Device) HTTPRequestReceived

func (dev *Device) HTTPRequestReceived(httpReq *http.Request, httpRes http.ResponseWriter)

func (*Device) HasDeviceType added in v0.8.1

func (dev *Device) HasDeviceType(deviceType string) bool

HasDeviceType returns true if the device or the embedded device type is the specified type, otherwise false.

func (*Device) HasServiceType added in v0.8.1

func (dev *Device) HasServiceType(serviceType string) bool

HasServiceType returns true if the device or the embedded device has the specified service type, otherwise false.

func (*Device) LoadDescriptionBytes

func (dev *Device) LoadDescriptionBytes(descBytes []byte) error

LoadDescriptionBytes loads a device description string.

func (*Device) LoadServiceDescriptions

func (dev *Device) LoadServiceDescriptions() error

LoadServiceDescriptions loads service descriptions.

func (*Device) SetLocationURL

func (dev *Device) SetLocationURL(url string) error

SetLocationURL set a location URL of SSDP packet.

func (*Device) SetUDN

func (dev *Device) SetUDN(uuid string) error

SetUDN sets a the specified UUID with a prefix.

func (*Device) Start

func (dev *Device) Start() error

Start starts this control point.

func (*Device) StartWithPort

func (dev *Device) StartWithPort(port int) error

Start starts this control point.

func (*Device) Stop

func (dev *Device) Stop() error

Stop stops this control point.

type DeviceActionListener

type DeviceActionListener interface {
	ActionRequestReceived(*Action) Error
}

A DeviceActionListener represents a listener for action request.

type DeviceDescription

type DeviceDescription struct {
	XMLName          xml.Name    `xml:"device"`
	DeviceType       string      `xml:"deviceType"`
	FriendlyName     string      `xml:"friendlyName"`
	Manufacturer     string      `xml:"manufacturer"`
	ManufacturerURL  string      `xml:"manufacturerURL"`
	ModelDescription string      `xml:"modelDescription"`
	ModelName        string      `xml:"modelName"`
	ModelNumber      string      `xml:"modelNumber"`
	ModelURL         string      `xml:"modelURL"`
	SerialNumber     string      `xml:"serialNumber"`
	UDN              string      `xml:"UDN"`
	UPC              string      `xml:"UPC"`
	PresentationURL  string      `xml:"presentationURL"`
	IconList         IconList    `xml:"iconList"`
	ServiceList      ServiceList `xml:"serviceList"`
	DeviceList       DeviceList  `xml:"deviceList"`
}

A DeviceDescription represents a UPnP device description.

type DeviceDescriptionRoot

type DeviceDescriptionRoot struct {
	XMLName     xml.Name    `xml:"root"`
	SpecVersion SpecVersion `xml:"specVersion"`
	URLBase     string      `xml:"URLBase"`
	Device      Device      `xml:"device"`
}

A DeviceDescriptionRoot represents a root UPnP device description.

func NewDeviceDescriptionRoot

func NewDeviceDescriptionRoot() *DeviceDescriptionRoot

func NewDeviceDescriptionRootFromDevice

func NewDeviceDescriptionRootFromDevice(dev *Device) (*DeviceDescriptionRoot, error)

func NewDeviceDescriptionRootFromString

func NewDeviceDescriptionRootFromString(descStr string) (*DeviceDescriptionRoot, error)

type DeviceHTTPListener

type DeviceHTTPListener interface {
	http.RequestListener
}

A DeviceHTTPListener represents a listener for HTTP requests.

type DeviceList

type DeviceList struct {
	XMLName xml.Name `xml:"deviceList"`
	Devices []Device `xml:"device"`
}

A DeviceList represents a ServiceList.

type DeviceListener

type DeviceListener interface {
	DeviceHTTPListener
	DeviceSSDPListener
	DeviceActionListener
}

A DeviceListener represents a listener for all requests.

type DeviceMap

type DeviceMap map[string]map[string]*Device

DeviceMap manages devices by UDN.

func NewDeviceMap

func NewDeviceMap() *DeviceMap

DeviceMap returns a new device map.

func (*DeviceMap) AddDevice

func (devMap *DeviceMap) AddDevice(dev *Device) bool

AddDevice adds a specified device.

func (*DeviceMap) FindDeviceByTypeAndUDN

func (devMap *DeviceMap) FindDeviceByTypeAndUDN(deviceType string, udn string) (*Device, bool)

FindDeviceByTypeAndUDN find a device of the specified device type and udn.

func (*DeviceMap) GetAllDevices

func (devMap *DeviceMap) GetAllDevices() []*Device

GetAllDevices returns all devices.

func (*DeviceMap) GetDevicesByType

func (devMap *DeviceMap) GetDevicesByType(deviceType string) []*Device

GetDevicesByType returns only devices of the specified device type.

func (*DeviceMap) HasDevice

func (devMap *DeviceMap) HasDevice(dev *Device) bool

HasDevice adds a specified device.

func (*DeviceMap) HasDeviceByTypeAndUDN

func (devMap *DeviceMap) HasDeviceByTypeAndUDN(deviceType string, udn string) bool

HasDeviceByTypeAndUDN check whether a device of the specified device type and udn exits.

func (*DeviceMap) Size

func (devMap *DeviceMap) Size() int

Size() returns all device count.

type DeviceSSDPListener

type DeviceSSDPListener interface {
	ssdp.MulticastListener
}

A DeviceSSDPListener represents a listener for SSDP requests.

type Error

type Error interface {
	error
	GetCode() int
	GetDescription() string
}

A Error represents a interface for UPnP error.

func NewErrorFromCode

func NewErrorFromCode(code int) Error

NewErrorFromCode returns a new Error from the specified code.

type Icon

type Icon struct {
	XMLName  xml.Name `xml:"icon"`
	Mimetype string   `xml:"mimetype"`
	Width    string   `xml:"width"`
	Height   string   `xml:"height"`
	Depth    string   `xml:"depth"`
	URL      string   `xml:"url"`
}

A Icon represents a UPnP icon.

func NewIcon

func NewIcon() *Icon

NewIcon returns a new Icon.

type IconList

type IconList struct {
	XMLName xml.Name `xml:"iconList"`
	Icons   []Icon   `xml:"icon"`
}

A IconList represents a UPnP iconList.

type Service

type Service struct {
	XMLName     xml.Name `xml:"service"`
	ServiceType string   `xml:"serviceType"`
	ServiceID   string   `xml:"serviceId"`
	SCPDURL     string   `xml:"SCPDURL"`
	ControlURL  string   `xml:"controlURL"`
	EventSubURL string   `xml:"eventSubURL"`

	ServiceStateTable *ServiceStateTable `xml:"-"`
	ActionList        *ActionList        `xml:"-"`
	ParentDevice      *Device            `xml:"-"`
	// contains filtered or unexported fields
}

A Service represents a UPnP service.

func NewService

func NewService() *Service

NewService returns a new Service.

func NewServiceFromDescriptionBytes

func NewServiceFromDescriptionBytes(descBytes []byte) (*Service, error)

NewServiceFromDescription returns a service from the specified descrition string.

func (*Service) DescriptionString

func (service *Service) DescriptionString() (string, error)

DescriptionString returns a descrition string.

func (*Service) GetAbsoluteControlURL

func (service *Service) GetAbsoluteControlURL() (*url.URL, error)

func (*Service) GetAbsoluteEventSubURL added in v0.8.2

func (service *Service) GetAbsoluteEventSubURL() (*url.URL, error)

func (*Service) GetAbsoluteSCPDURL

func (service *Service) GetAbsoluteSCPDURL() (*url.URL, error)

func (*Service) GetActionByName

func (service *Service) GetActionByName(name string) (*Action, error)

GetActionByName returns an action by the specified name.

func (*Service) GetActions

func (service *Service) GetActions() []*Action

GetActions returns all actions.

func (*Service) LoadDescriptionBytes

func (service *Service) LoadDescriptionBytes(descBytes []byte) error

LoadDescriptionBytes loads a device description string.

func (*Service) LoadDescriptionFromSCPDURL

func (service *Service) LoadDescriptionFromSCPDURL() error

LoadDescriptinString loads a device description string.

type ServiceDescription

type ServiceDescription struct {
	XMLName           xml.Name          `xml:"scpd"`
	ServiceStateTable ServiceStateTable `xml:"serviceStateTable"`
	ActionList        ActionList        `xml:"actionList"`
}

A ServiceDescription represents a UPnP service description.

type ServiceList

type ServiceList struct {
	XMLName  xml.Name  `xml:"serviceList"`
	Services []Service `xml:"service"`
}

A ServiceList represents a UPnP serviceList.

type ServiceStateTable

type ServiceStateTable struct {
	XMLName        xml.Name        `xml:"serviceStateTable"`
	StateVariables []StateVariable `xml:"stateVariable"`
}

A StateVariable represents a UPnP state variable.

type SpecVersion

type SpecVersion struct {
	XMLName xml.Name `xml:"specVersion"`
	Major   int      `xml:"major"`
	Minor   int      `xml:"minor"`
}

A SpecVersion represents a UPnP spec version.

func NewSpecVersion

func NewSpecVersion() *SpecVersion

NewSpecVersion returns a new SpecVersion.

type StateVariable

type StateVariable struct {
	XMLName           xml.Name          `xml:"stateVariable"`
	Name              string            `xml:"name"`
	DataType          string            `xml:"dataType"`
	DefaultValue      string            `xml:"defaultValue"`
	AllowedValueList  AllowedValueList  `xml:"allowedValueList"`
	AllowedValueRange AllowedValueRange `xml:"allowedValueRange"`
	SendEvents        string            `xml:"sendEvents,attr"`
	Multicast         string            `xml:"multicast,attr"`
	ParentService     *Service          `xml:"-"`
}

A StateVariable represents a UPnP state variable.

func NewStateVariable

func NewStateVariable() *StateVariable

NewStateVariable returns a new StateVariable.

Directories

Path Synopsis
Package control implements control functions of UPnP for net-upnp-go.
Package control implements control functions of UPnP for net-upnp-go.
Package http is a wrapper packages of net/http for net-upnp-go.
Package http is a wrapper packages of net/http for net-upnp-go.
Package ssdp implements multicast and unicast functions of SSDP for net-upnp-go.
Package ssdp implements multicast and unicast functions of SSDP for net-upnp-go.
Package util implements some misc functoins for net-upnp-go.
Package util implements some misc functoins for net-upnp-go.

Jump to

Keyboard shortcuts

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