外观
knx
原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793259147/FIN+5.3.1+knx 中文整理基于 FIN 5.3.1
导读: 枚举类 KnxAddressStyle : 枚举
以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。
目录(导读)
- classes
- enums
- Slot Details
- format
- free
- fromStr
- fromXElem
- threeLevel
- twoLevel
- vals
- decode
- encode
- instance
- tags
- valType
- addr
- desc
- dpt
- dptName
- id
- name
- readable
- toDict
- writable
- bits
- isDefault
- make
- makeFieldMap
- number
- reuse
- text
- part
- subType
- description
- gaLinkIds
- individualAddr
- isRouter
- productRefId
- serialNumber
- byNum
- expandToParts
- parts
- reduceFromParts
- decodeBuf
- encodeBuf
- decodeInt
- encodeInt
- falseStr
- trueStr
- coefficient
- signed
- max
- min
- parseNum
- unit
- unitFor
- unitStr
- width
- bySize
- encoding
- defVal
- subTypes
- addrHash
- basePath
- close
- dptOf
- isOpen
- open
- pingDevice
- projFile
- read
- readRaw
- uri
- useNat
- write
- byName
- dpts
- fromFile
- get
- addressStyle
- dataPoint
- dataPoints
- device
- devices
- fromFileWithDevices
- gaAddrsForDevice
- getFileUri
- log
- master
- masterBase
- parseAddress
- parseTopology
- updateDataPoints
- getConfig
- readZipUtf8
- setConfig
- isInt
- makeFloat
- toFloat
- toInt
- val
概述(中译)
@Serializable { simple=true } 枚举类 KnxAddressStyle : Enum
构造函数
字段
方法
插槽详情
API 正文(英文)
format
Str format(Int addr)
free
const static KnxAddressStyle free := ...
fromStr
static new fromStr(Str name, Bool checked := true)
Return the KnxAddressStyle instance for the specified name. If not a valid name and checked is false return null, otherwise throw ParseErr.
fromXElem
static new fromXElem(XElem elem)
threeLevel
const static KnxAddressStyle threeLevel := ...
twoLevel
const static KnxAddressStyle twoLevel := ...
vals
const static KnxAddressStyle[] vals := ...
List of KnxAddressStyle values indexed by ordinal
KnxDaliTestCtrlDpt
const class KnxDaliTestCtrlDpt : KnxDataType
Fields
| instance |
Methods
| decode | |
| encode | |
| tags | |
| valType |
Slot Details
decode
virtual override Obj decode(Buf buf)
encode
virtual override Buf encode(Obj val, Buf? cached := null)
instance
const static KnxDaliTestCtrlDpt instance := ...
tags
virtual override Str:Obj? tags()
valType
virtual override Type valType()
KnxDaliTestResultDpt
const class KnxDaliTestResultDpt : KnxDataType
Fields
| instance |
Methods
| decode | |
| encode | |
| tags | |
| valType |
Slot Details
decode
virtual override Obj decode(Buf buf)
encode
virtual override Buf encode(Obj val, Buf? cached := null)
instance
const static KnxDaliTestResultDpt instance := ...
tags
virtual override Str:Obj? tags()
valType
virtual override Type valType()
KnxDataPoint
const class KnxDataPoint : Obj
Fields
| addr | |
| desc | |
| dpt | |
| dptName | |
| id | |
| name | |
| readable | |
| tags | |
| writable |
Methods
| toDict |
Slot Details
addr
const Int addr
desc
const Str? desc
dpt
const KnxDataType? dpt
dptName
const Str? dptName
id
const Str id
name
const Str name
readable
const Bool readable
tags
const Str? tags
toDict
Dict toDict()
writable
const Bool writable
KnxDataType
abstract const class KnxDataType : Obj
Constructors
| make |
Fields
| bits | |
| id | |
| isDefault | |
| name | |
| number | |
| text |
Methods
| decode | |
| encode | |
| makeFieldMap | |
| reuse | |
| tags | |
| valType |
Slot Details
bits
const Int bits
decode
abstract Obj decode(Buf buf)
encode
abstract Buf encode(Obj val, Buf? cached := null)
id
const Str id
isDefault
const Bool isDefault
make
new make(|This|? f := null)
makeFieldMap
protected static Field:Obj? makeFieldMap(XElem elem)
name
const Str name
number
const Int number
reuse
static Obj? reuse(Type t, Field:Obj? fMap, Obj? fallback)
tags
abstract Str:Obj? tags()
text
const Str text
valType
abstract Type valType()
KnxDataTypePart
const class KnxDataTypePart : KnxDataType
Constructors
| make |
Fields
| part | |
| subType |
Methods
| decode | |
| encode | |
| tags | |
| valType |
Slot Details
decode
virtual override Obj decode(Buf buf)
encode
virtual override Buf encode(Obj val, Buf? cached := null)
make
new make(KnxDpst subType, KnxDpstPart part, Int number)
part
const KnxDpstPart part
subType
const KnxDpst subType
tags
virtual override Str:Obj? tags()
valType
virtual override Type valType()
KnxDevice
const class KnxDevice : Obj
Represents a physical KNX device extracted from the ETS project Topology. Each device has an individual address (area.line.device), and a list of group address link IDs that bind it to group addresses on the bus.
Fields
| description | Device description from ETS |
| gaLinkIds | Group address link IDs from ComObjectInstanceRefs (e.g. |
| id | ETS internal ID (e.g. |
| individualAddr | Individual address (e.g. |
| isRouter | True if this device is a KNX IP router/interface (has IPConfig element) |
| name | Device name from ETS (may be empty) |
| productRefId | Product reference ID |
| serialNumber | Device serial number |
Methods
| toDict |
Slot Details
description
const Str description
Device description from ETS
gaLinkIds
const Str[] gaLinkIds
Group address link IDs from ComObjectInstanceRefs (e.g. ["GA-13", "GA-14"])id
const Str id
ETS internal ID (e.g. "P-0112-0_DI-1")
individualAddr
const Str individualAddr
Individual address (e.g. "1.1.2")
isRouter
const Bool isRouter
True if this device is a KNX IP router/interface (has IPConfig element)
name
const Str name
Device name from ETS (may be empty)
productRefId
const Str productRefId
Product reference ID
serialNumber
const Str serialNumber
Device serial number
toDict
Dict toDict()
KnxDpst
const class KnxDpst : KnxDataType
Fields
| byNum | |
| parts |
Methods
| decode | |
| encode | |
| expandToParts | |
| reduceFromParts | |
| tags | |
| valType |
Slot Details
byNum
const KnxDataTypePart[] byNum
decode
virtual override Obj decode(Buf buf)
encode
virtual override Buf encode(Obj val, Buf? cached := null)
expandToParts
Obj[] expandToParts(Obj val)
parts
const KnxDpstPart[] parts
reduceFromParts
Obj reduceFromParts(Obj[] vals)
tags
virtual override Str:Obj? tags()
valType
virtual override Type valType()
KnxDpstAbstNum
abstract const class KnxDpstAbstNum : KnxDpstPart
Constructors
| make |
Methods
| decodeBuf | |
| encodeBuf |
Slot Details
decodeBuf
virtual override Number decodeBuf(Buf buf)
encodeBuf
virtual override Buf encodeBuf(Obj val)
make
new make(|This|? f := null)
KnxDpstBool
const class KnxDpstBool : KnxDpstPart
Fields
| falseStr | |
| trueStr |
Methods
| decodeBuf | |
| decodeInt | |
| encodeBuf | |
| encodeInt | |
| tags | |
| valType |
Slot Details
decodeBuf
virtual override Obj decodeBuf(Buf buf)
decodeInt
virtual override Obj decodeInt(Int int)
encodeBuf
virtual override Buf encodeBuf(Obj val)
encodeInt
virtual override Int encodeInt(Obj val)
falseStr
const Str falseStr
tags
virtual override Str:Obj? tags()
trueStr
const Str trueStr
valType
virtual override Type valType()
KnxDpstEnum
const class KnxDpstEnum : KnxDpstAbstNum
Fields
| vals |
Methods
| decodeInt | |
| encodeInt | |
| tags | |
| valType |
Slot Details
decodeInt
virtual override Str decodeInt(Int int)
encodeInt
virtual override Int encodeInt(Obj val)
tags
virtual override Str:Obj? tags()
valType
virtual override Type valType()
vals
const Int:Str vals
KnxDpstFloat
const class KnxDpstFloat : KnxDpstNum
Methods
| decodeInt | |
| encodeInt |
Slot Details
decodeInt
virtual override Number decodeInt(Int int)
encodeInt
virtual override Int encodeInt(Obj val)
KnxDpstInt
const class KnxDpstInt : KnxDpstNum
Fields
| coefficient | |
| signed |
Methods
| decodeInt | |
| encodeInt |
Slot Details
coefficient
const Number? coefficient
decodeInt
virtual override Number decodeInt(Int int)
encodeInt
virtual override Int encodeInt(Obj val)
signed
const Bool signed
KnxDpstNum
abstract const class KnxDpstNum : KnxDpstAbstNum
Constructors
| make |
Fields
| max | |
| min | |
| unit | |
| unitStr |
Methods
| parseNum | |
| tags | |
| unitFor | |
| valType |
Slot Details
make
new make(|This|? f := null)
max
const Num? max
min
const Num? min
parseNum
static Num? parseNum(Str? s)
tags
virtual override Str:Obj? tags()
unit
const Unit? unit
unitFor
static Unit? unitFor(Str? key)
unitStr
const Str? unitStr
valType
virtual override Type valType()
KnxDpstPart
abstract const class KnxDpstPart : Obj
Constructors
| make |
Fields
| id | |
| name | |
| width |
Methods
| decodeBuf | |
| decodeInt | |
| encodeBuf | |
| encodeInt | |
| tags | |
| valType |
Slot Details
decodeBuf
abstract Obj decodeBuf(Buf buf)
decodeInt
abstract Obj decodeInt(Int int)
encodeBuf
abstract Buf encodeBuf(Obj val)
encodeInt
abstract Int encodeInt(Obj val)
id
const Str id
make
new make(|This|? f := null)
name
const Str? name
tags
virtual Str:Obj? tags()
valType
abstract Type valType()
width
const Int width
KnxDpstReserved
const class KnxDpstReserved : KnxDpstPart
Methods
| bySize | |
| decodeBuf | |
| decodeInt | |
| encodeBuf | |
| encodeInt | |
| valType |
Slot Details
bySize
static KnxDpstReserved bySize(Int width)
decodeBuf
virtual override Str decodeBuf(Buf buf)
decodeInt
virtual override Str decodeInt(Int int)
encodeBuf
virtual override Buf encodeBuf(Obj val)
encodeInt
virtual override Int encodeInt(Obj val)
valType
virtual override Type valType()
KnxDpstStr
const class KnxDpstStr : KnxDpstPart
Fields
| encoding |
Methods
| decodeBuf | |
| decodeInt | |
| encodeBuf | |
| encodeInt | |
| valType |
Slot Details
decodeBuf
virtual override Str decodeBuf(Buf buf)
decodeInt
virtual override Str decodeInt(Int int)
encodeBuf
virtual override Buf encodeBuf(Obj val)
encodeInt
virtual override Int encodeInt(Obj val)
encoding
const Str encoding
valType
virtual override Type valType()
KnxDpt
const class KnxDpt : KnxDataType
Fields
| byNum | |
| defVal | |
| subTypes |
Methods
| decode | |
| encode | |
| tags | |
| valType |
Slot Details
byNum
const Int:KnxDpst byNum
decode
virtual override Obj decode(Buf buf)
defVal
const KnxDpst defVal
encode
virtual override Buf encode(Obj val, Buf? cached := null)
subTypes
const KnxDpst[] subTypes
tags
virtual override Str:Obj? tags()
valType
virtual override Type valType()
KnxLink
class KnxLink : Obj
Constructors
| make |
Fields
| basePath | |
| isOpen | |
| projFile | |
| uri | |
| useNat |
Methods
| addrHash | |
| close | |
| decode | |
| dptOf | |
| encode | |
| open | |
| pingDevice | Ping a specific KNX device by its individual address (e.g. |
| read | |
| readRaw | Raw synchronous read without decoding — for ping/connectivity checks only. |
| write |
Slot Details
addrHash
Int addrHash(Uri addr)
basePath
const Str basePath := Env.cur().homeDir().toStr
close
Void close(Str? reason := null)
decode
Obj decode(Uri addr, Buf data)
dptOf
KnxDataType dptOf(Uri addr)
encode
Buf encode(Uri addr, Obj val)
isOpen
Bool isOpen { private set }
make
new make(Uri uri, Bool useNat := false, KnxProjFile? projFile := null, |Int,Buf|? onValUpdate := null, |->Void|? onClose := null)
open
Void open()
pingDevice
Bool pingDevice(Str individualAddr)
Ping a specific KNX device by its individual address (e.g. "1.1.2") using Calimero ManagementClient.readDeviceDesc(). Returns true if the device responds. Throws IOErr on timeout or any other error.
projFile
const KnxProjFile? projFile
read
Obj? read(Uri addr, Bool async := false)
readRaw
Buf? readRaw(Uri addr)
Raw synchronous read without decoding — for ping/connectivity checks only. Returns the raw Buf if the device responds, or throws on timeout.
uri
const Uri uri
useNat
const Bool useNat
write
This write(Uri addr, Obj val)
KnxMaster
const class KnxMaster : Obj
Constructors
| fromFile |
Fields
| byName | |
| byNum | |
| dpts |
Methods
| get |
Slot Details
byName
const Str:KnxDataType byName
byNum
const Int:KnxDpt byNum
dpts
const KnxDpt[] dpts
fromFile
static new fromFile(File file, KnxMaster? fallback := null)
get
@Operator KnxDataType? get(Str id, Bool checked := true)
KnxProjFile
const class KnxProjFile : Obj
Fields
| addressStyle | |
| dataPoints | |
| devices | |
| log | |
| master | |
| masterBase |
Methods
| dataPoint | |
| device | Lookup a KnxDevice by its individual address (e.g. |
| fromFile | |
| fromFileWithDevices | Load and parse the ETS project file including Topology (device list). |
| gaAddrsForDevice | Handles both full ETS IDs (e.g. |
| getFileUri | |
| parseAddress | |
| parseTopology | Parse the Topology section and GA ID mapping from the ETS project 0.xml. |
| updateDataPoints |
Slot Details
addressStyle
const KnxAddressStyle addressStyle
dataPoint
KnxDataPoint? dataPoint(Str addr, Bool checked := true)
dataPoints
const KnxDataPoint[] dataPoints
device
KnxDevice? device(Str individualAddr, Bool checked := true)
Lookup a KnxDevice by its individual address (e.g. "1.1.2")
devices
const KnxDevice[] devices := KnxDevice[,]
fromFile
static KnxProjFile fromFile(File file)
fromFileWithDevices
static KnxProjFile fromFileWithDevices(File file)
Load and parse the ETS project file including Topology (device list). Use this instead of fromFile when you need device-level information.
gaAddrsForDevice
Uri[] gaAddrsForDevice(KnxDevice device)
Handles both full ETS IDs (e.g. "P-014B-0_GA-13") and stripped suffixes ("GA-13").
getFileUri
Uri getFileUri()
log
const static Log log := Log.get(KnxProjFile#.name())
master
const KnxMaster master
masterBase
const static KnxMaster? masterBase
parseAddress
static Int parseAddress(Str addr)
parseTopology
static Str:Obj parseTopology(File file)
Parse the Topology section and GA ID mapping from the ETS project 0.xml. Returns a map with "devices" (KnxDevice[]) and "gaIdToAddr" (Str:Int).
updateDataPoints
Int updateDataPoints(Dict[] newdps)
KnxUtils
class KnxUtils : Obj
Methods
| getConfig | |
| readZipUtf8 | Read a ZIP file with UTF-8 encoding forced for entry names. |
| setConfig |
Slot Details
getConfig
static Str? getConfig(Str key, Str basePath)
readZipUtf8
static Zip readZipUtf8(InStream in)
Read a ZIP file with UTF-8 encoding forced for entry names. This handles files with special characters even when the UTF-8 flag is not set.
setConfig
static Void setConfig(Str key, Str value)
NumberWrap
const class NumberWrap : Obj
Constructors
| make | |
| makeFloat |
Fields
| val |
Methods
| isInt | |
| toFloat | |
| toInt |
Slot Details
isInt
Bool isInt()
make
new make(Number val)
makeFloat
new makeFloat(Float val)
toFloat
Float toFloat()
toInt
Int toInt()
val
const Number val