knx.ts 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +211 -0
- package/dist/@types/interfaces/DPTs.d.ts +144 -0
- package/dist/@types/interfaces/DPTs.js +3 -0
- package/dist/@types/interfaces/EMI.d.ts +396 -0
- package/dist/@types/interfaces/EMI.js +2 -0
- package/dist/@types/interfaces/ServiceMessage.d.ts +11 -0
- package/dist/@types/interfaces/ServiceMessage.js +2 -0
- package/dist/@types/interfaces/SystemStatus.d.ts +18 -0
- package/dist/@types/interfaces/SystemStatus.js +2 -0
- package/dist/@types/interfaces/connection.d.ts +139 -0
- package/dist/@types/interfaces/connection.js +2 -0
- package/dist/@types/interfaces/localEndPoint.d.ts +5 -0
- package/dist/@types/interfaces/localEndPoint.js +2 -0
- package/dist/@types/types/AllDpts.d.ts +3 -0
- package/dist/@types/types/AllDpts.js +3 -0
- package/dist/@types/types/DecodedDPTType.d.ts +21 -0
- package/dist/@types/types/DecodedDPTType.js +2 -0
- package/dist/connection/KNXService.d.ts +58 -0
- package/dist/connection/KNXService.js +242 -0
- package/dist/connection/KNXTunneling.d.ts +44 -0
- package/dist/connection/KNXTunneling.js +509 -0
- package/dist/connection/KNXnetIPServer.d.ts +64 -0
- package/dist/connection/KNXnetIPServer.js +900 -0
- package/dist/connection/Router.d.ts +49 -0
- package/dist/connection/Router.js +269 -0
- package/dist/connection/TPUART.d.ts +32 -0
- package/dist/connection/TPUART.js +497 -0
- package/dist/connection/TunnelConnection.d.ts +57 -0
- package/dist/connection/TunnelConnection.js +167 -0
- package/dist/core/CEMI.d.ts +1130 -0
- package/dist/core/CEMI.js +1281 -0
- package/dist/core/ControlField.d.ts +57 -0
- package/dist/core/ControlField.js +120 -0
- package/dist/core/ControlFieldExtended.d.ts +56 -0
- package/dist/core/ControlFieldExtended.js +114 -0
- package/dist/core/EMI.d.ts +2515 -0
- package/dist/core/EMI.js +3898 -0
- package/dist/core/KNXAddInfoTypes.d.ts +225 -0
- package/dist/core/KNXAddInfoTypes.js +602 -0
- package/dist/core/KNXnetIPHeader.d.ts +10 -0
- package/dist/core/KNXnetIPHeader.js +38 -0
- package/dist/core/KNXnetIPStructures.d.ts +179 -0
- package/dist/core/KNXnetIPStructures.js +622 -0
- package/dist/core/MessageCodeField.d.ts +886 -0
- package/dist/core/MessageCodeField.js +399 -0
- package/dist/core/SystemStatus.d.ts +144 -0
- package/dist/core/SystemStatus.js +325 -0
- package/dist/core/data/KNXData.d.ts +7 -0
- package/dist/core/data/KNXData.js +30 -0
- package/dist/core/data/KNXDataDecode.d.ts +396 -0
- package/dist/core/data/KNXDataDecode.js +1186 -0
- package/dist/core/data/KNXDataEncode.d.ts +332 -0
- package/dist/core/data/KNXDataEncode.js +1504 -0
- package/dist/core/enum/APCIEnum.d.ts +587 -0
- package/dist/core/enum/APCIEnum.js +591 -0
- package/dist/core/enum/EnumControlField.d.ts +24 -0
- package/dist/core/enum/EnumControlField.js +36 -0
- package/dist/core/enum/EnumControlFieldExtended.d.ts +36 -0
- package/dist/core/enum/EnumControlFieldExtended.js +41 -0
- package/dist/core/enum/EnumShortACKFrame.d.ts +6 -0
- package/dist/core/enum/EnumShortACKFrame.js +10 -0
- package/dist/core/enum/ErrorCodeSet.d.ts +57 -0
- package/dist/core/enum/ErrorCodeSet.js +2 -0
- package/dist/core/enum/KNXnetIPEnum.d.ts +95 -0
- package/dist/core/enum/KNXnetIPEnum.js +90 -0
- package/dist/core/enum/SAP.d.ts +19 -0
- package/dist/core/enum/SAP.js +23 -0
- package/dist/core/layers/data/APDU.d.ts +38 -0
- package/dist/core/layers/data/APDU.js +115 -0
- package/dist/core/layers/data/NPDU.d.ts +73 -0
- package/dist/core/layers/data/NPDU.js +103 -0
- package/dist/core/layers/data/TPDU.d.ts +53 -0
- package/dist/core/layers/data/TPDU.js +73 -0
- package/dist/core/layers/interfaces/APCI.d.ts +61 -0
- package/dist/core/layers/interfaces/APCI.js +92 -0
- package/dist/core/layers/interfaces/TPCI.d.ts +110 -0
- package/dist/core/layers/interfaces/TPCI.js +196 -0
- package/dist/core/resources/DeviceDescriptorType.d.ts +46 -0
- package/dist/core/resources/DeviceDescriptorType.js +69 -0
- package/dist/errors/DPTNotFound.d.ts +6 -0
- package/dist/errors/DPTNotFound.js +15 -0
- package/dist/errors/InvalidKnxAddresExeption.d.ts +3 -0
- package/dist/errors/InvalidKnxAddresExeption.js +9 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +18 -0
- package/dist/utils/CEMIAdapter.d.ts +16 -0
- package/dist/utils/CEMIAdapter.js +94 -0
- package/dist/utils/KNXHelper.d.ts +78 -0
- package/dist/utils/KNXHelper.js +338 -0
- package/dist/utils/Logger.d.ts +17 -0
- package/dist/utils/Logger.js +96 -0
- package/dist/utils/MessageCodeTranslator.d.ts +19 -0
- package/dist/utils/MessageCodeTranslator.js +77 -0
- package/dist/utils/checksumFrame.d.ts +18 -0
- package/dist/utils/checksumFrame.js +41 -0
- package/dist/utils/localIp.d.ts +7 -0
- package/dist/utils/localIp.js +45 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Arnold Steven Beleño Zuletta
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# knx.ts
|
|
2
|
+
|
|
3
|
+
A high-performance **KNXnet/IP** library written in **TypeScript**. This project focuses on protocol strictness and connection stability, specifically optimized to provide a reliable experience when used as a Gateway for ETS.
|
|
4
|
+
|
|
5
|
+
## 🌟 Current Capabilities
|
|
6
|
+
|
|
7
|
+
- **Robust UDP Tunnelling**: Implements a strict *Stop-and-Wait* queue and sequence number management (KNX Spec Vol 3/8/4). This eliminates common "connection broken" issues in ETS during long sessions.
|
|
8
|
+
- **KNXnet/IP Routing**: Supports standard multicast routing for seamless bus integration.
|
|
9
|
+
- **Intuitive Address-Based Events**: Listen to specific telegrams using group addresses as event names (e.g., `server.on("1/1/1", ...)`).
|
|
10
|
+
- **Echo Cancellation**: Automatically filters out loopback messages to prevent telegram processing loops.
|
|
11
|
+
- **High Performance**: Optimized for Node.js environments with minimal overhead.
|
|
12
|
+
|
|
13
|
+
## đźš§ Status: Experimental & Work-In-Progress
|
|
14
|
+
|
|
15
|
+
As per the `TODO.md`, several features are currently in an **experimental** state or under development:
|
|
16
|
+
|
|
17
|
+
- **TCP Support**: Implementation is present but testing is currently in an experimental phase.
|
|
18
|
+
- **TPUART Hardware**: Integration with TPUART chips via serial is implemented but awaits full hardware verification, this implementation is based from the knxd.
|
|
19
|
+
- **Advanced Routing**: Complex routing between multiple Tunnels and TPUART via the `Router` class is under evaluation.
|
|
20
|
+
- **Device Parameterization**: Support for *Programming Mode* (progMode) is planned to allow full device configuration via ETS.
|
|
21
|
+
- **Source Filtering**: Filtering based on source addresses and selective routing is on the roadmap.
|
|
22
|
+
|
|
23
|
+
## 📦 Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
git clone https://github.com/Wesxt/KNX.ts.git
|
|
27
|
+
cd KNX.ts
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 🛠️ Quick Start
|
|
31
|
+
|
|
32
|
+
### Create a KNXnet/IP Server (Gateway)
|
|
33
|
+
|
|
34
|
+
Perfect for creating a bridge between your IP network and the KNX bus.
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { KNXnetIPServer } from './src/index.ts';
|
|
38
|
+
|
|
39
|
+
const server = new KNXnetIPServer({
|
|
40
|
+
localIp: '192.168.1.50',
|
|
41
|
+
individualAddress: '1.1.0',
|
|
42
|
+
friendlyName: 'TypeScript KNX Gateway',
|
|
43
|
+
clientAddrs: '1.1.10:5' // Provide 5 tunneling slots starting from 1.1.10
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
server.connect().then(() => {
|
|
47
|
+
console.log('KNXnet/IP Server is up and running');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Specific listening for a Group Address
|
|
51
|
+
server.on('1/1/1', (cemi) => {
|
|
52
|
+
console.log('New data on 1/1/1:', cemi.TPDU.apdu.data);
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Tunneling Client
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { KNXTunneling } from './src/index.ts';
|
|
60
|
+
|
|
61
|
+
const tunnel = new KNXTunneling({
|
|
62
|
+
ip: '192.168.1.100',
|
|
63
|
+
port: 3671,
|
|
64
|
+
localIp: '192.168.1.50'
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
tunnel.connect().then(() => {
|
|
68
|
+
console.log('Connected to KNX Bus');
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 📝 Logging
|
|
73
|
+
|
|
74
|
+
The library uses a global singleton logger based on [Pino](https://github.com/pinojs/pino). You can configure it at the very beginning of your application using `setupLogger`.
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
import { setupLogger, knxLogger } from './src/index.ts';
|
|
78
|
+
|
|
79
|
+
// Configure the global logger
|
|
80
|
+
setupLogger({
|
|
81
|
+
level: 'debug', // e.g., 'info', 'warn', 'error', 'debug'
|
|
82
|
+
logToFile: true,
|
|
83
|
+
logDir: './logs',
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// You can also use the global logger in your own application
|
|
87
|
+
knxLogger.info("Application started");
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
All internal components (`KNXnetIPServer`, `KNXTunneling`, `Router`, etc.) automatically use this shared logger to avoid spawning multiple Pino instances.
|
|
91
|
+
|
|
92
|
+
## 📡 Events & Callbacks
|
|
93
|
+
|
|
94
|
+
The library is event-driven. You can listen for system events or specific KNX Group Addresses.
|
|
95
|
+
|
|
96
|
+
### Common Events
|
|
97
|
+
|
|
98
|
+
Both `KNXnetIPServer` and `KNXTunneling` emit the following events:
|
|
99
|
+
|
|
100
|
+
| Event | Description | Callback Arguments |
|
|
101
|
+
|-------|-------------|--------------------|
|
|
102
|
+
| `connected` | Connection established and ready. | `void` (Server) / `{ channelId }` (Tunnel) |
|
|
103
|
+
| `disconnected` | Connection lost or closed. | `void` |
|
|
104
|
+
| `error` | An error occurred during operation. | `Error` |
|
|
105
|
+
| `indication` | Any incoming KNX telegram (L_Data.ind). | `cemi: L_Data_ind` |
|
|
106
|
+
|
|
107
|
+
### Address-Based Events (Server Only)
|
|
108
|
+
|
|
109
|
+
You can listen to specific Group Addresses directly:
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
server.on("1/1/1", (cemi) => {
|
|
113
|
+
// Triggered only for telegrams to 1/1/1
|
|
114
|
+
});
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Understanding the `cemi` Object
|
|
118
|
+
|
|
119
|
+
The `cemi` object (specifically `L_Data_ind`) contains all the information about the KNX telegram. Here are the most relevant properties:
|
|
120
|
+
|
|
121
|
+
| Property | Type | Description |
|
|
122
|
+
|----------|------|-------------|
|
|
123
|
+
| `sourceAddress` | `string` | Physical address of the sender (e.g., `"1.1.5"`). |
|
|
124
|
+
| `destinationAddress` | `string` | Group address (e.g., `"1/1/1"`) or Physical address. |
|
|
125
|
+
| `TPDU.apdu.data` | `Buffer` | The raw payload data. |
|
|
126
|
+
| `TPDU.apdu.apci.command` | `string` | Command type (`A_GroupValue_Write`, `A_GroupValue_Read`, etc.). |
|
|
127
|
+
|
|
128
|
+
#### Handling Data Payloads
|
|
129
|
+
|
|
130
|
+
KNX handles data in two ways depending on the size:
|
|
131
|
+
|
|
132
|
+
- **Short Data (<= 6 bits)**: For DPT1 (Switch), DPT3 (Control), etc. The `cemi.TPDU.apdu.data[0]` contains the value.
|
|
133
|
+
- **Extended Data (> 6 bits)**: For DPT5 (Scaling), DPT9 (Float), etc. The `cemi.TPDU.apdu.data` Buffer contains the full payload (e.g., 2 bytes for DPT9).
|
|
134
|
+
|
|
135
|
+
## 🔢 Data Encoding & Decoding
|
|
136
|
+
|
|
137
|
+
The library provides static utilities to handle KNX Data Point Types (DPT) conversion between raw Buffers and high-level TypeScript objects.
|
|
138
|
+
|
|
139
|
+
### Decoding Incoming Data
|
|
140
|
+
|
|
141
|
+
Use `KnxDataDecode` to transform raw CEMI data into readable values:
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
import { KnxDataDecode } from './src/core/data/KNXDataDecode';
|
|
145
|
+
|
|
146
|
+
server.on('1/1/1', (cemi) => {
|
|
147
|
+
// Decode as DPT 1 (Boolean)
|
|
148
|
+
const value = KnxDataDecode.decodeThis(1, cemi.TPDU.apdu.data);
|
|
149
|
+
console.log('Decoded value:', value); // true or false
|
|
150
|
+
|
|
151
|
+
// Decode as DPT 9 (2-byte Float, e.g., Temperature)
|
|
152
|
+
const temp = KnxDataDecode.decodeThis(9, cemi.TPDU.apdu.data);
|
|
153
|
+
console.log('Temperature:', temp, '°C');
|
|
154
|
+
});
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Encoding Data for Sending
|
|
158
|
+
|
|
159
|
+
Use `KnxDataEncoder` with the `encodeThis` method to prepare buffers for KNX telegrams; the second parameter is always an object (Problem: all DPTs other than DPT1 belonging to a property are different keys instead of just "value" values; this will be fixed in the future):
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
import { KnxDataEncoder } from './src/core/data/KNXDataEncode';
|
|
163
|
+
|
|
164
|
+
// Encode a Boolean (DPT 1)
|
|
165
|
+
const buf1 = KnxDataEncoder.encodeThis(1, { value: true });
|
|
166
|
+
|
|
167
|
+
// Encode a Percentage (DPT 5.001)
|
|
168
|
+
const buf5 = KnxDataEncoder.encodeThis(5.001, { valueDpt5001: 50 });
|
|
169
|
+
|
|
170
|
+
// Encode a Temperature (DPT 9.001)
|
|
171
|
+
const buf9 = KnxDataEncoder.encodeThis(9, { valueDpt9: 22.5 });
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Type Safety & IntelliSense
|
|
175
|
+
|
|
176
|
+
Both `KnxDataDecode.decodeThis()` and `KnxDataEncoder.encodeThis()` are strictly typed. This means:
|
|
177
|
+
|
|
178
|
+
- **IntelliSense Support**: Your IDE will automatically suggest the supported DPTs as you type the first parameter.
|
|
179
|
+
- **Automatic Data Validation**: The second parameter (the data object) automatically adjusts its required properties based on the DPT selected in the first parameter.
|
|
180
|
+
- **Supported DPTs**: You can programmatically check the list of supported DPTs by accessing the static `dptEnum` property:
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
console.log(KnxDataDecode.dptEnum);
|
|
184
|
+
console.log(KnxDataEncoder.dptEnum);
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## 🛠️ Development
|
|
188
|
+
|
|
189
|
+
To build the project:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
npm run build
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
To run routing tests:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
npm run test:routing
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
npm run test:connection
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## 👤 Author
|
|
206
|
+
|
|
207
|
+
- **Arnold Steven Beleño Zuletta (Wesxt)**
|
|
208
|
+
|
|
209
|
+
## ⚖️ License
|
|
210
|
+
|
|
211
|
+
This project is licensed under the MIT License.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
export interface DPT1 {
|
|
2
|
+
value: boolean;
|
|
3
|
+
}
|
|
4
|
+
export interface DPT2 {
|
|
5
|
+
control: 0 | 1;
|
|
6
|
+
valueDpt2: 0 | 1;
|
|
7
|
+
}
|
|
8
|
+
export interface DPT3 {
|
|
9
|
+
control: 0 | 1;
|
|
10
|
+
stepCode: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
11
|
+
}
|
|
12
|
+
export interface DPT4 {
|
|
13
|
+
char: string;
|
|
14
|
+
}
|
|
15
|
+
export interface DPT5 {
|
|
16
|
+
valueDpt5: number;
|
|
17
|
+
}
|
|
18
|
+
export interface DPT5001 {
|
|
19
|
+
valueDpt5001: number;
|
|
20
|
+
}
|
|
21
|
+
export interface DPT5002 {
|
|
22
|
+
valueDpt5002: number;
|
|
23
|
+
}
|
|
24
|
+
export interface DPT6 {
|
|
25
|
+
valueDpt6: number;
|
|
26
|
+
}
|
|
27
|
+
export interface DPT6020 {
|
|
28
|
+
status: 0 | 1;
|
|
29
|
+
mode: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
30
|
+
}
|
|
31
|
+
export interface DPT7 {
|
|
32
|
+
valueDpt7: number;
|
|
33
|
+
}
|
|
34
|
+
export interface DPT8 {
|
|
35
|
+
valueDpt8: number;
|
|
36
|
+
}
|
|
37
|
+
export interface DPT9 {
|
|
38
|
+
valueDpt9: number;
|
|
39
|
+
}
|
|
40
|
+
export interface DPT10001 {
|
|
41
|
+
day: number;
|
|
42
|
+
hour: number;
|
|
43
|
+
minutes: number;
|
|
44
|
+
seconds: number;
|
|
45
|
+
}
|
|
46
|
+
export interface DPT11001 {
|
|
47
|
+
day: number;
|
|
48
|
+
month: number;
|
|
49
|
+
year: number;
|
|
50
|
+
}
|
|
51
|
+
export interface DPT12001 {
|
|
52
|
+
valueDpt12001: number;
|
|
53
|
+
}
|
|
54
|
+
export interface DPT13001 {
|
|
55
|
+
valueDpt13001: number;
|
|
56
|
+
}
|
|
57
|
+
export interface DPT14 {
|
|
58
|
+
valueDpt14: number;
|
|
59
|
+
}
|
|
60
|
+
export interface DPT15 {
|
|
61
|
+
D6: number;
|
|
62
|
+
D5: number;
|
|
63
|
+
D4: number;
|
|
64
|
+
D3: number;
|
|
65
|
+
D2: number;
|
|
66
|
+
D1: number;
|
|
67
|
+
E: 0 | 1;
|
|
68
|
+
P: 0 | 1;
|
|
69
|
+
D: 0 | 1;
|
|
70
|
+
C: 0 | 1;
|
|
71
|
+
index: number;
|
|
72
|
+
}
|
|
73
|
+
export interface DPT16 {
|
|
74
|
+
text: string;
|
|
75
|
+
}
|
|
76
|
+
export interface DPT16002 {
|
|
77
|
+
hex: string;
|
|
78
|
+
}
|
|
79
|
+
export interface DPT20 {
|
|
80
|
+
valueDpt20: number;
|
|
81
|
+
}
|
|
82
|
+
export interface DPT27001 {
|
|
83
|
+
mask: number;
|
|
84
|
+
status: number;
|
|
85
|
+
}
|
|
86
|
+
export interface DPT28001 {
|
|
87
|
+
textDpt28001: string;
|
|
88
|
+
}
|
|
89
|
+
export interface DPT29 {
|
|
90
|
+
valueDpt29: bigint;
|
|
91
|
+
}
|
|
92
|
+
export interface DPT238600 {
|
|
93
|
+
BF: 0 | 1;
|
|
94
|
+
LF: 0 | 1;
|
|
95
|
+
Addr: number;
|
|
96
|
+
}
|
|
97
|
+
export interface DPT245600 {
|
|
98
|
+
LTRF: number;
|
|
99
|
+
LTRD: number;
|
|
100
|
+
LTRP: number;
|
|
101
|
+
SF: number;
|
|
102
|
+
SD: number;
|
|
103
|
+
SP: number;
|
|
104
|
+
LDTR: number;
|
|
105
|
+
LPDTR: number;
|
|
106
|
+
}
|
|
107
|
+
export interface DPT250600 {
|
|
108
|
+
/** Control de Colour Temperature: 0 = decrease, 1 = increase */
|
|
109
|
+
cCT: 0 | 1;
|
|
110
|
+
/**
|
|
111
|
+
* Step Code para Colour Temperature:
|
|
112
|
+
* - 0: Break
|
|
113
|
+
* - 1..7: NĂşmero de intervalos (step)
|
|
114
|
+
*/
|
|
115
|
+
stepCodeCT: number;
|
|
116
|
+
/** Control de Brightness: 0 = decrease, 1 = increase */
|
|
117
|
+
cB: 0 | 1;
|
|
118
|
+
/**
|
|
119
|
+
* Step Code para Brightness:
|
|
120
|
+
* - 0: Break
|
|
121
|
+
* - 1..7: NĂşmero de intervalos (step)
|
|
122
|
+
*/
|
|
123
|
+
stepCodeB: number;
|
|
124
|
+
/**
|
|
125
|
+
* Validez de los campos de Colour Temperature (bit 1 del octeto LSB):
|
|
126
|
+
* 0: inválido, 1: válido
|
|
127
|
+
*/
|
|
128
|
+
validCT: 0 | 1;
|
|
129
|
+
/**
|
|
130
|
+
* Validez de los campos de Brightness (bit 0 del octeto LSB):
|
|
131
|
+
* 0: inválido, 1: válido
|
|
132
|
+
*/
|
|
133
|
+
validB: 0 | 1;
|
|
134
|
+
}
|
|
135
|
+
export interface DPT251600 {
|
|
136
|
+
R: number;
|
|
137
|
+
G: number;
|
|
138
|
+
B: number;
|
|
139
|
+
W: number;
|
|
140
|
+
mR: 0 | 1;
|
|
141
|
+
mG: 0 | 1;
|
|
142
|
+
mB: 0 | 1;
|
|
143
|
+
mW: 0 | 1;
|
|
144
|
+
}
|