mirror of https://github.com/FluuxIO/go-xmpp
Add preliminary support for IoT control (XEP-0325)
parent
adcd2bd467
commit
3a516a43d3
@ -0,0 +1,23 @@
|
||||
package iot
|
||||
|
||||
import "encoding/xml"
|
||||
|
||||
type Control struct {
|
||||
ControlSet ControlSet `xml:",omitempty"`
|
||||
ControlGetForm ControlGetForm `xml:",omitempty"`
|
||||
}
|
||||
|
||||
type ControlSet struct {
|
||||
XMLName xml.Name `xml:"urn:xmpp:iot:control set"`
|
||||
Fields []ControlField `xml:",any"`
|
||||
}
|
||||
|
||||
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"`
|
||||
}
|
@ -1,11 +1,18 @@
|
||||
package xmpp
|
||||
|
||||
import "encoding/xml"
|
||||
import (
|
||||
"encoding/xml"
|
||||
|
||||
type clientIQ struct { // info/query
|
||||
"github.com/processone/gox/xmpp/iot"
|
||||
)
|
||||
|
||||
// info/query
|
||||
type ClientIQ struct {
|
||||
XMLName xml.Name `xml:"jabber:client iq"`
|
||||
Packet
|
||||
Bind bindBind
|
||||
Bind bindBind `xml:",omitempty"`
|
||||
iot.Control
|
||||
RawXML string `xml:",innerxml"`
|
||||
// TODO We need to support detecting the IQ namespace / Query packet
|
||||
// Error clientError
|
||||
}
|
||||
|
Loading…
Reference in New Issue