Documentation ¶
Index ¶
- Constants
- func NestedUnzip(src, dest string, pwd func(string) string) ([]string, error)
- func Unzip(src string, dest string, pwd func(string) string) ([]string, error)
- type ApplicationProgram
- type ApplicationProgramID
- type Area
- type AreaID
- type ComObject
- type ComObjectID
- type ComObjectInstanceRef
- type ComObjectRef
- type ComObjectRefID
- type Connector
- type DeviceInstance
- type DeviceInstanceID
- type ExportArchive
- type GroupAddress
- type GroupAddressID
- type GroupAddressStyle
- type GroupRange
- type GroupRangeID
- type Hardware
- type Hardware2Program
- type Hardware2ProgramID
- type HardwareData
- type HardwareFile
- type HardwareID
- type Ids
- type Installation
- type InstallationFile
- type Language
- type LanguageID
- type Line
- type LineID
- type ManufacturerData
- type ManufacturerFile
- type ManufacturerID
- type ModuleID
- type Product
- type ProductID
- type Project
- type ProjectFile
- type ProjectID
- type ProjectInfo
- type Space
- type SpaceID
- type Translation
- type TranslationRefID
Constants ¶
const ( SpaceTypeBuilding = "Building" SpaceTypeBuildingPart = "BuildingPart" SpaceTypeFloor = "Floor" SpaceTypeRoom = "Room" SpaceTypeDistributionBoard = "DistributionBoard" SpaceTypeStairway = "Stairway" SpaceTypeCorridor = "Corridor" )
Variables ¶
This section is empty.
Functions ¶
func NestedUnzip ¶
Unzip will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2).
Types ¶
type ApplicationProgram ¶
type ApplicationProgram struct { ID ApplicationProgramID ManufacturerID ManufacturerID Name string Version uint Objects []ComObject ObjectRefs []ComObjectRef }
ApplicationProgram is an application program.
type ApplicationProgramID ¶
type ApplicationProgramID string
ApplicationProgramID is the ID of an application program.
type ComObject ¶
type ComObject struct { ID ComObjectID ApplicationProgramID ApplicationProgramID ManufacturerID ManufacturerID ModuleID ModuleID Name string Text string Description string FunctionText string ObjectSize string DatapointType string Priority string ReadFlag bool WriteFlag bool CommunicationFlag bool TransmitFlag bool UpdateFlag bool ReadOnInitFlag bool }
ComObject is a communication object.
type ComObjectInstanceRef ¶
type ComObjectInstanceRef struct { ComObjectRefID ComObjectRefID ComObjectID ComObjectID DatapointType string Links []string }
ComObjectInstanceRef connects a communication object reference with zero or more group addresses.
type ComObjectRef ¶
type ComObjectRef struct { ID ComObjectRefID ComObjectID ComObjectID ApplicationProgramID ApplicationProgramID ManufacturerID ManufacturerID Name string Text string Description string FunctionText string ObjectSize string DatapointType string Priority string ReadFlag bool WriteFlag bool CommunicationFlag bool TransmitFlag bool UpdateFlag bool ReadOnInitFlag bool }
ComObjectRef is an instance/reference to a communication object.
type ComObjectRefID ¶
type ComObjectRefID string
ComObjectRefID is the ID of a communication object reference.
func (ComObjectRefID) IDs ¶
func (s ComObjectRefID) IDs() (m string, ap string, o string, r string)
IDs returns the manfucturer, applicaton program, communication object and communcation object reference ids.
func (ComObjectRefID) InstanceID ¶
func (s ComObjectRefID) InstanceID() string
type Connector ¶
type Connector struct { Receive bool RefID GroupAddressID }
Connector is a connection to a group address.
type DeviceInstance ¶
type DeviceInstance struct { ID DeviceInstanceID ProjectID ProjectID ManufacturerID ManufacturerID HardwareID HardwareID ProductID ProductID Hardware2ProgramID Hardware2ProgramID Name string Address uint16 ComObjects []ComObjectInstanceRef }
DeviceInstance is a device instance.
type DeviceInstanceID ¶
type DeviceInstanceID string
DeviceInstanceID is the ID of a device instance.
type ExportArchive ¶
type ExportArchive struct { ProjectFiles []ProjectFile ManufacturerFiles []ManufacturerFile HardwareFiles []HardwareFile // contains filtered or unexported fields }
ExportArchive is a handle to an exported archive (.knxproj or .knxprod).
func OpenExportArchive ¶
func OpenExportArchive(path, password string) (*ExportArchive, error)
OpenExportArchive opens the exported archive located at given path.
func (*ExportArchive) Delete ¶
func (ex *ExportArchive) Delete() error
type GroupAddress ¶
type GroupAddress struct { ID GroupAddressID ProjectID ProjectID Name string Description string Address uint16 DatapointType string }
GroupAddress is a group address.
type GroupAddressStyle ¶
type GroupAddressStyle int
const ( GroupAddressStyleThree GroupAddressStyle = iota GroupAddressStyleTwo GroupAddressStyleFree )
type GroupRange ¶
type GroupRange struct { ID GroupRangeID Name string RangeStart uint16 RangeEnd uint16 Addresses []GroupAddress SubRanges []GroupRange }
GroupRange is a range of group addresses.
type Hardware ¶
type Hardware struct { ID HardwareID Name string Products []Product Hardware2Programs []Hardware2Program }
type Hardware2Program ¶
type Hardware2Program struct { ManufacturerID ManufacturerID HardwareID HardwareID ID Hardware2ProgramID ApplicationProgramIDs []ApplicationProgramID }
type Hardware2ProgramID ¶
type Hardware2ProgramID string
type HardwareData ¶
type HardwareData struct { Manufacturer ManufacturerID Hardwares []Hardware Languages []Language }
HardwareData contains hardware-specific data.
func DecodeHardwareData ¶
func DecodeHardwareData(r io.Reader) (*HardwareData, error)
DecodeHardwareData parses the contents of a manufacturer file.
func (*HardwareData) UnmarshalXML ¶
func (md *HardwareData) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
UnmarshalXML implements xml.Unmarshaler.
type HardwareFile ¶
type HardwareFile struct { Path string ManufacturerID ManufacturerID }
HardwareFile is a hardware file.
func (*HardwareFile) Decode ¶
func (hf *HardwareFile) Decode() (hd *HardwareData, err error)
Decode the file in order to retrieve the manufacturer data inside it.
type Ids ¶
type Ids struct { Manufacturer ManufacturerID AppProgram ApplicationProgramID Module ModuleID ComObject ComObjectID ComObjectRef ComObjectRefID }
type Installation ¶
type Installation struct { Name string Topology []Area Locations []Space GroupAddresses []GroupRange }
Installation is an installation within a project.
type InstallationFile ¶
InstallationFile is a file that contains zero or more project installations.
func (*InstallationFile) Decode ¶
func (i *InstallationFile) Decode() (p *Project, err error)
Decode the file in order to retrieve the project inside it.
type Language ¶
type Language struct { ID LanguageID Translations []Translation }
type Line ¶
type Line struct { ID LineID ProjectID ProjectID Name string Address uint16 Devices []DeviceInstance }
Line is a line.
type ManufacturerData ¶
type ManufacturerData struct { ID ManufacturerID Programs []ApplicationProgram Languages []Language }
ManufacturerData contains manufacturer-specific data.
func DecodeManufacturerData ¶
func DecodeManufacturerData(r io.Reader) (*ManufacturerData, error)
DecodeManufacturerData parses the contents of a manufacturer file.
func (*ManufacturerData) UnmarshalXML ¶
func (md *ManufacturerData) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
UnmarshalXML implements xml.Unmarshaler.
type ManufacturerFile ¶
type ManufacturerFile struct { Path string ManufacturerID ManufacturerID ApplicationProgramID ApplicationProgramID }
ManufacturerFile is a manufacturer file.
func (*ManufacturerFile) Decode ¶
func (mf *ManufacturerFile) Decode() (md *ManufacturerData, err error)
Decode the file in order to retrieve the manufacturer data inside it.
type Product ¶
type Product struct { ID ProductID ManufacturerID ManufacturerID HardwareID HardwareID Text string }
type Project ¶
type Project struct { ID ProjectID Name string Installations []Installation }
Project contains an entire project. These information are usually stored within a file located at P-XXXX/N.xml (0 <= N <= 16).
func DecodeProject ¶
DecodeProject parses the contents of a project file.
func (*Project) UnmarshalXML ¶
UnmarshalXML implements xml.Unmarshaler.
type ProjectFile ¶
type ProjectFile struct { Path string ProjectID string InstallationFiles []InstallationFile }
ProjectFile is a file that contains project information.
func (*ProjectFile) Decode ¶
func (pf *ProjectFile) Decode() (pi *ProjectInfo, err error)
Decode the file in order to retrieve the project info inside it.
type ProjectInfo ¶
type ProjectInfo struct { ID ProjectID Name string Comment string AddressStyle GroupAddressStyle }
ProjectInfo contains project information. These information are usually stored in the P-XXXX/Project.xml file.
func DecodeProjectInfo ¶
func DecodeProjectInfo(r io.Reader) (*ProjectInfo, error)
DecodeProjectInfo parses the contents of project info file.
func (*ProjectInfo) UnmarshalXML ¶
func (pi *ProjectInfo) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
UnmarshalXML implements xml.Unmarshaler.
type Space ¶
type Space struct { ID SpaceID ProjectID ProjectID DeviceInstanceIDs []DeviceInstanceID Type string Name string SubSpaces []Space }
Space is a space for devices and other spaces.
type Translation ¶
type Translation struct { RefID TranslationRefID Texts map[string]string }