Comments (3)
Hey,
thank you, it's really kind to get such a feedback.
The encoding isn't implemented in this module, so you have to do more to send a floating value. I guess you mean EIS5/DPT9 Values.
var encodeDPT9 = function(value) {
var state = value;
var data = null;
var sign = (state < 0 ? 0x8000 : 0 );
var exp = 0;
var mant = 0;
mant = new Number(state * 100.0);
while( Math.abs(mant) > 2046 ) {
mant = mant >> 1;
exp += 1;
}
data = sign | (exp << 11) | (mant & 0x07ff);
var buf = new Array(3);
buf[0] = 0;
buf[1] = data >> 8;
buf[2] = data & 0xff;
return buf;
};
var conn = eibd.Connection();
var address = eibd.str2addr('1/0/0');
conn.socketRemote({ host: host, port: port }, function() {
conn.openTGroup(address, 1, function (err) {
if(err) {
callback(err);
} else {
var data = encodeDPT9(20.5);
conn.sendAPDU(data, callback);
}
});
})
I hope this is a solution for your issue. I've only executed the code local with tests and not in any eibd/knx environment, because I don't have access to one at the moment.
from node-eibd.
Thanks ! I'll see if it's work.
I found a little problem in your example :
parser.on('write', function(src, dest, val){
console.log('Write from '+src+' to '+dest+': '+val);
});
==>
parser.on('write', function(src, dest, dpt, val){
console.log('Write from '+src+' to '+dest+': '+val);
});
You just missed the dpt argument in your function
from node-eibd.
Thanks. I've fixed it.
from node-eibd.
Related Issues (20)
- KNX "software" devices HOT 4
- Error when running example code HOT 10
- Wrong lenght using DPT10/11 HOT 23
- command line apps have no error handlers HOT 3
- groupsocketlisten with conn_sep branch of knxd HOT 3
- Documentation link dead HOT 2
- knx connection HOT 5
- DPT232 HOT 1
- Cannot connect HOT 3
- Missing DPT in telegram HOT 2
- When sending a read message, the response contains the wrong value HOT 2
- 16 bit group addresses HOT 4
- Mandatory closing of connection after sending APDU HOT 3
- groupread executable broken for non-socket reads HOT 5
- [Enhancement] Use a generic telegram decoder to be able to parse all telegrams HOT 2
- DPT14 for thermostat HOT 1
- npm install eibd could't set HOT 2
- /usr/bin/env: βnode\rβ: No such file or directory HOT 1
- Buffer Constructor is deprecated in Node.js 10
- trouble getting groupread response 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 node-eibd.