openv / vcontrold

:fire: vcontrold Daemon for control and logging of Viessmann® type heating devices
https://github.com/openv/openv/wiki
GNU General Public License v3.0
101 stars 54 forks source link

extend 10 byte limitation #56

Open passuff opened 4 years ago

passuff commented 4 years ago

There are many functions defined at same address but different byte position. From Vitosoft 300 Demo/ xml files I got the following addresses:

HK_AktuelleBetriebsartA1M1~0x2500

<Description>@@viessmann.eventtype.HK_AktuelleBetriebsartA1M1.description</Description>

<DataType>Dropdown</DataType>

<SDKDataType>Int</SDKDataType>

<AccessMode>Read</AccessMode>

<Conversion>NoConversion</Conversion>

<ConversionFactor>0</ConversionFactor>

<ConversionOffset>0</ConversionOffset>

<Address>0x2500</Address>

<FCRead>Virtual_READ</FCRead>

<FCWrite>undefined</FCWrite>

<Parameter>Byte</Parameter>

<BlockLength>22</BlockLength>

<BytePosition>1</BytePosition>

<ByteLength>1</ByteLength>

<BitPosition>0</BitPosition>

<BitLength>0</BitLength>
HK_AufheiztimerA1M1~0x2500

<Description>@@viessmann.eventtype.HK_AufheiztimerA1M1.description</Description>

<SDKDataType>Double</SDKDataType>

<Unit>ecnUnit.Sekunden</Unit>

<AccessMode>Read</AccessMode>

<Conversion>Div10</Conversion>

<Address>0x2500</Address>

<FCRead>Virtual_READ</FCRead>

<FCWrite>undefined</FCWrite>

<Parameter>Byte</Parameter>

<BlockLength>22</BlockLength>

<BytePosition>2</BytePosition>

<ByteLength>4</ByteLength>

<BitPosition>0</BitPosition>

<BitLength>0</BitLength>

<OptionList>NoLogging</OptionList>

So beside from different data and conversion type there are differences in the byte position and length. Currently it is not possible to read byte 12 of blocklength of 22. From /wiki/vcontrold.xml I understand that B0...B9 is possible. I would like to have the optionto read up to 90 bytes (max value for block length defined in viessmann config)?

To read block length of 22 and the specific byte length and position I adjusted "arithmetic.c" to accept at least 22 bytes. I'm evertyhing but a programmer, so I bet you will find a better way to implement it. arithmetic_22byte.c.txt

philverh commented 4 years ago

From a quick scan through the source, I have the impression that reading long strings should be OK, but that the interpretation done at the bit and byte level needs to be upgraded. That is what you tried in your arithmetic_22byte.c file. On the other hand, I saw what I believe is a confusion between bPtr and pPtr in the update you did to extend the byte string handling to 22 bytes. I haven't spent enough time to try to understand the whole.

Time is scarce... ;-)