thelsing / knx

knx stack (TP, IP and RF) for arduino and linux, Can be configured with ETS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue on decoding DPT 10.001 values - "Index"

Sonnengruesser opened this issue · comments

I'm trying to read a DPT 10.001 time value to feed the Arduino RTC. Now I face an issue on the decoding of the bus values.
The code here: busValueToTime will always use "case 0", since the index is defaulted to 0 here.

I didn't find a function to set the Index (also for any other DPT where more than Index 0 exist). Am I missing something?
For DPT10.001 this means bytes 1 (minutes) and 2 (day&hours) will never be read out correctly.

Is the "case 0" function required anyways? Where does the Index come from?

@mumpf is this related to the "SMALL_GROUPOBJECT" flag?

on further review I found the way to correctly read:
tmp_t = COMOBJ.value(Dpt(10,1,1));
still wondering who invented the "index"...

commented

As far as I know, index is used to read/write parts of combined DPT, like DPT3 or DPT19 (and obviously also DPT10). In most cases I have also difficulties to use them, so I tend to use RAW data and decode them on my own.

commented

You found the answer on your own, I will close the issue.