Code Monkey home page Code Monkey logo

Comments (5)

ajlajlajl avatar ajlajlajl commented on July 28, 2024

same goes for DPT 18.1 and valueToBusValueSceneControl().

from knx.

thelsing avatar thelsing commented on July 28, 2024

The logic of the index is as follows:
DPT 3.7 consists of two parts:

  • c 1 bit Increase/Decrease (index 0)
  • bbb 3 bit Stepcode (000b - 111b) (index 1)

The whole DPT-Encoding stuff was taken from a knxd branch. It would probably b easier to understand if every complex dpt would get a struct.
In case of DPT 3.7 a signed char would do the job just fine.

Feel free this ;)

from knx.

ajlajlajl avatar ajlajlajl commented on July 28, 2024

oh, so I've got to create 2 group object to handle a, for example "scene control" DTP? something like this?

	GroupObject& sceneLearn = knx.getGroupObject(2);
	sceneLearn.dataPointType(Dpt(18, 1, 0));
	GroupObject& sceneNumber = knx.getGroupObject(2);
	sceneLearn.dataPointType(Dpt(18, 1, 1));
	sceneLearn.value(1);
	sceneNumber.value(5);

right?

and, if i want to manage it myself i can just use another DTP? like 5.10 ?

	GroupObject& scene = knx.getGroupObject(2);
	scene.dataPointType(Dpt(5,10));
	scene.value(0x85);

would it be alright? (I donno much about KNX protocol so im not sure if its okey to use another DPT there)

from knx.

thelsing avatar thelsing commented on July 28, 2024

No the group object is the same.
Something like:

GroupObject& scene = knx.getGroupObject(2);
learn = scene.value(Dpt(18,1,0));
number = scene.value(Dpt(18,1,1));

should work.

When you write a group object you have to set the first components with GroupObject::valueNoSend and only the last component with GroupObject::value.

GroupObject& scene = knx.getGroupObject(2);
scene.valueNoSend(1, Dpt(18,1,0));
scene.value(37, Dpt(18,1,1));

If you want to decode the data yourself,, you can get a raw pointer with GroupObject::valueRef and the size of the data with GroupObject::valueSize.

The better way would be custom structs for complex datapoints.

from knx.

ajlajlajl avatar ajlajlajl commented on July 28, 2024

Thanks!

from knx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.