2019-06-26 15:14:52 +00:00
|
|
|
package stanza
|
2016-02-15 10:08:54 +00:00
|
|
|
|
2019-06-04 15:04:25 +00:00
|
|
|
import (
|
|
|
|
"encoding/xml"
|
|
|
|
)
|
2016-02-15 10:08:54 +00:00
|
|
|
|
|
|
|
type ControlSet struct {
|
|
|
|
XMLName xml.Name `xml:"urn:xmpp:iot:control set"`
|
|
|
|
Fields []ControlField `xml:",any"`
|
2020-01-31 10:48:03 +00:00
|
|
|
// Result sets
|
|
|
|
ResultSet *ResultSet `xml:"set,omitempty"`
|
2016-02-15 10:08:54 +00:00
|
|
|
}
|
|
|
|
|
2019-06-13 15:22:39 +00:00
|
|
|
func (c *ControlSet) Namespace() string {
|
|
|
|
return c.XMLName.Space
|
|
|
|
}
|
|
|
|
|
2020-01-31 10:48:03 +00:00
|
|
|
func (c *ControlSet) GetSet() *ResultSet {
|
|
|
|
return c.ResultSet
|
|
|
|
}
|
|
|
|
|
2016-02-15 10:08:54 +00:00
|
|
|
type ControlGetForm struct {
|
|
|
|
XMLName xml.Name `xml:"urn:xmpp:iot:control getForm"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ControlField struct {
|
|
|
|
XMLName xml.Name
|
|
|
|
Name string `xml:"name,attr,omitempty"`
|
|
|
|
Value string `xml:"value,attr,omitempty"`
|
|
|
|
}
|
2016-02-15 15:33:27 +00:00
|
|
|
|
|
|
|
type ControlSetResponse struct {
|
|
|
|
XMLName xml.Name `xml:"urn:xmpp:iot:control setResponse"`
|
|
|
|
}
|
2019-06-13 15:22:39 +00:00
|
|
|
|
|
|
|
func (c *ControlSetResponse) Namespace() string {
|
|
|
|
return c.XMLName.Space
|
|
|
|
}
|
2020-01-31 10:48:03 +00:00
|
|
|
func (c *ControlSetResponse) GetSet() *ResultSet {
|
|
|
|
return nil
|
|
|
|
}
|
2019-06-27 08:22:36 +00:00
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Registry init
|
|
|
|
|
|
|
|
func init() {
|
2020-01-31 10:48:03 +00:00
|
|
|
TypeRegistry.MapExtension(PKTIQ, xml.Name{Space: "urn:xmpp:iot:control", Local: "set"}, ControlSet{})
|
2019-06-27 08:22:36 +00:00
|
|
|
}
|