Comments (8)
from calimero-core.
Hello,
I tried it and it worked fine but is it possible to get the value instead of the ASDU ? How can I convert it ?
Thanks a lot
from calimero-core.
Use a DPT translator from package tuwien.auto.calimero.dptxlator
, you probably need DPTXlator2ByteFloat
with the datapoint type (DPT) 9.001.
from calimero-core.
Okay I checked this class.
But my monitor class give me multiple different type of DPT, temperature, boolean etc.
How can I manage it ?
from calimero-core.
Do you have an example of translating from ASDU to DTP ?
from calimero-core.
Calimero cannot know the exact DPTs you want in your setup. Either, you distinguish based on the datapoint group address, and create the desired translator. Or, you configure your datapoints up front to automate translation, like this:
DatapointModel<StateDP> datapoints = new DatapointMap<>();
datapoints.add(new StateDP(..., "my temp", 0, DPTXlator2ByteFloat.DPT_TEMPERATURE.getID()));
// add your other datapoints
...
// now, you can request a translator for a specific datapoint
TranslatorTypes.createTranslator(0, datapoints.get(...).getDPT());
from calimero-core.
I tried something like this :
` private void print(final String svc, final ProcessEvent e) throws KNXFormatException
{
DatapointModel datapoints = new DatapointMap<>();
try {
datapoints.add(new StateDP(new GroupAddress("1/1/3"), "my temp", 0, DPTXlator2ByteFloat.DPT_TEMPERATURE.getID()));
System.out.println(LocalTime.now() + " " + e.getSourceAddr() + "->" + e.getDestination() + " " + svc + ": "
+ e.getASDU());
System.out.println(TranslatorTypes.createTranslator(0, datapoints.get(new GroupAddress("1/1/3")).getDPT()));
}
catch (final RuntimeException ex) {
System.err.println(ex);
} catch (KNXException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}`
The result is this :
09:39:51.733 1.1.9->1/1/3 write.ind: [B@2c8e27f7
DPT 9.001 [0.0 °C]
So I'm able to get the correct datapoint but the value is still 0.0.
Am I doing something wrong to print my values ?
Thanks a lot for the help
from calimero-core.
You forgot to set the actual knx data you want to translate to a java type:
DPTXlator t = TranslatorTypes.createTranslator(...);
t.setData(e.getASDU());
System.out.println(t);
from calimero-core.
Related Issues (20)
- Does not work with tpuart ic HOT 24
- [Feature Request] Add support for security proxy
- Datapoint type discovery HOT 1
- DPT8 missing in README.md HOT 1
- Mangamementclient no basic restart anymore with v2.5? HOT 3
- [Feature Request] "protected" for some fields and methods of ManagementClientImpl HOT 6
- Warnings from Calimero HOT 13
- Receiving a GroupValueResponse with DPT 1.001 fails due to missing data in the asdu HOT 2
- DPT 251.600 format should be consistent across platforms and locales HOT 3
- readBool maxASDULen should be ‘1’ ?,now is ‘0’ HOT 1
- Android project runtime FATAL EXCEPTION. HOT 5
- GO Diagnostics: Improve selection of surrogate HOT 10
- DPT 10.001 is wrongly parsed when "no day" is present HOT 2
- Throws Exception when EventListener catch one HOT 2
- KNXNetworkLinkFT12: detect status, CEMI setting.... HOT 2
- Implement Transport Layer Connection-Oriented State Machine Style 3 HOT 2
- Throws `KNXTimeoutException` due to missing confirmation although the confirmation was received HOT 2
- Calimero GUI and KNX Virtual HOT 2
- Data Secure - Read Group Request management HOT 2
- Not able to connect to KNX USB RF module HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from calimero-core.