envy / esp-knx-ip

A KNX/IP library for the ESP8266 with Arduino
MIT License
135 stars 49 forks source link

[ Question ] Sending and receiving a float type value #60

Closed ascillato closed 6 years ago

ascillato commented 6 years ago

Hi Nico,

How are you?

I want to use your library to send and receive a float type value.

For sending a I use the send_2byte_float() function that works great. It is being received by KNX without any problem.

Now I want to do the other way round. To receive a float type value. Do you have the code to transform the mantisa from the KNX DPT to a float value? When a float is received, the msg.data_len is 3, but the msg.data[0] is always zero. So all the 2byte float is in msg.data[2] and msg.data[1].

So my question is if you have the fragment of code to decode msg.data[2]and msg.data[1] into a float variable ?

Thanks,

Adrian

envy commented 6 years ago

Hi,

Yes, there is ESPKNXIP::data_to_2byte_float

Cheers, Nico

ascillato commented 6 years ago

You Rock!

Thanks a lot :+1: