connectedbytcpnew

package
v0.0.0-...-b0e10ae Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2016 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log = logging.Log.New("pkg", "drivers/connectedbytcp")

Log is used to log messages for the connectedbytcp package. Logs are disabled by default; use sift/logging.SetLevel() to set log levels for all packages, or Log.SetHandler() to set a custom handler for this package (see: https://godoc.org/gopkg.in/inconshreveable/log15.v2)

Functions

func XMLDeviceToSIFTDevice

func XMLDeviceToSIFTDevice(device XMLDevice) (types.Device, error)

XMLDeviceToSIFTDevice converts a Connected By TCP XMLDevice into a SIFT types.Device

Types

type AdapterFactory

type AdapterFactory struct{}

An AdapterFactory creates adapters

func NewFactory

func NewFactory() *AdapterFactory

NewFactory properly instantiates a new AdapterFactory

func (*AdapterFactory) GetIPv4Description

func (f *AdapterFactory) GetIPv4Description() ipv4.ServiceDescription

GetIPv4Description returns a description of the example IPv4 service that can be used to identify example services on a network

func (*AdapterFactory) HandleIPv4

func (f *AdapterFactory) HandleIPv4(context *ipv4.ServiceContext) adapter.Adapter

HandleIPv4 spawns a new Adapter to handle a context

func (*AdapterFactory) Name

func (f *AdapterFactory) Name() string

Name returns the name of this adapter factory, "Connected By TCP"

type XMLDID

type XMLDID struct {
	XMLName xml.Name `xml:"did"`
	Value   string   `xml:",chardata"`
}

XMLDID captures the data from a similarly-named Connected by TCP API structure

type XMLDevice

type XMLDevice struct {
	XMLName xml.Name         `xml:"device"`
	DID     XMLDID           `xml:"did"`
	Name    XMLDeviceName    `xml:"name"`
	Offline XMLDeviceOffline `xml:"offline"`
	State   XMLDeviceState   `xml:"state"`
	Level   XMLDeviceLevel   `xml:"level"`
}

XMLDevice captures the data from a similarly-named Connected by TCP API structure

func ReadDevice

func ReadDevice(xmlStr []byte) (*XMLDevice, error)

ReadDevice marshals valid XML describing a Device from the Connected by TCP API into an XMLDevice struct

func ReadRoom

func ReadRoom(xmlStr []byte) ([]XMLDevice, error)

ReadRoom marshals valid XML describing a Room from the Connected by TCP API into a collection of XMLDevice structs

type XMLDeviceLevel

type XMLDeviceLevel struct {
	XMLName xml.Name `xml:"level"`
	Value   string   `xml:",chardata"`
}

XMLDeviceLevel captures the data from a similarly-named Connected by TCP API structure

type XMLDeviceName

type XMLDeviceName struct {
	XMLName xml.Name `xml:"name"`
	Value   string   `xml:",chardata"`
}

XMLDeviceName captures the data from a similarly-named Connected by TCP API structure

type XMLDeviceOffline

type XMLDeviceOffline struct {
	XMLName xml.Name `xml:"offline"`
	Value   string   `xml:",chardata"`
}

XMLDeviceOffline captures the data from a similarly-named Connected by TCP API structure

type XMLDeviceState

type XMLDeviceState struct {
	XMLName xml.Name `xml:"state"`
	Value   string   `xml:",chardata"`
}

XMLDeviceState captures the data from a similarly-named Connected by TCP API structure

type XMLGCmd

type XMLGCmd struct {
	XMLName xml.Name `xml:"gcmd"`
	Value   string   `xml:",chardata"`
}

XMLGCmd captures the data from a similarly-named Connected by TCP API structure

type XMLGData

type XMLGData struct {
	XMLName xml.Name `xml:"gdata"`
	Gips    []XMLGip `xml:"gip"`
}

XMLGData captures the data from a similarly-named Connected by TCP API structure

type XMLGWRCmd

type XMLGWRCmd struct {
	XMLName xml.Name `xml:"gwrcmd"`
	Command XMLGCmd  `xml:"gcmd"`
	Data    XMLGData `xml:"gdata"`
}

XMLGWRCmd captures the data from a similarly-named Connected by TCP API structure

func DecodeGwrcmds

func DecodeGwrcmds(r io.Reader) ([]XMLGWRCmd, error)

DecodeGwrcmds marshals valid XML describing Gwrcmds from the Connected by TCP API into a collection of XMLGWRCmd structs

func ReadGwrcmds

func ReadGwrcmds(xmlStr []byte) ([]XMLGWRCmd, error)

ReadGwrcmds marshals valid XML describing Gwrcmds from the Connected by TCP API into a collection of XMLGWRCmd structs

type XMLGWRCmds

type XMLGWRCmds struct {
	XMLName  xml.Name    `xml:"gwrcmds"`
	Commands []XMLGWRCmd `xml:"gwrcmd"`
}

XMLGWRCmds captures the data from a similarly-named Connected by TCP API structure

type XMLGip

type XMLGip struct {
	XMLName xml.Name  `xml:"gip"`
	Rooms   []XMLRoom `xml:"room"`
}

XMLGip captures the data from a similarly-named Connected by TCP API structure

type XMLLoginGip

type XMLLoginGip struct {
	XMLName xml.Name   `xml:"gip"`
	Version XMLVersion `xml:"version"`
	RC      XMLRC      `xml:"rc"`
	Token   XMLToken   `xml:"token"`
	Rooms   []XMLRoom  `xml:"room"`
}

XMLLoginGip captures the data from a similarly-named Connected by TCP API structure

func ReadGwrLogin

func ReadGwrLogin(xmlStr []byte) (XMLLoginGip, error)

ReadGwrLogin marshals valid XML describing GwrLogins from the Connected by TCP API into a collection of XMLLoginGip structs

type XMLRC

type XMLRC struct {
	XMLName xml.Name `xml:"rc"`
	Value   string   `xml:",chardata"`
}

XMLRC captures the data from a similarly-named Connected by TCP API structure

type XMLRoom

type XMLRoom struct {
	XMLName xml.Name    `xml:"room"`
	Devices []XMLDevice `xml:"device"`
}

XMLRoom captures the data from a similarly-named Connected by TCP API structure

type XMLToken

type XMLToken struct {
	XMLName xml.Name `xml:"token"`
	Value   string   `xml:",chardata"`
}

XMLToken captures the data from a similarly-named Connected by TCP API structure

type XMLVersion

type XMLVersion struct {
	XMLName xml.Name `xml:"version"`
	Value   string   `xml:",chardata"`
}

XMLVersion captures the data from a similarly-named Connected by TCP API structure

Notes

Bugs

  • The ConnectedByTCP Gateway produces a x509 certificate which is not recognized by the default HTTP client. This adapter currently ignores the certificate check (!!!)

Jump to

Keyboard shortcuts

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