Code Monkey home page Code Monkey logo

Comments (5)

envy avatar envy commented on August 23, 2024

Hi,

I added a string sending method for DPT16. Please try it out, I did not test it.

from esp-knx-ip.

Poseidon1982 avatar Poseidon1982 commented on August 23, 2024

Many thanks Envy.

I tried to compile my sctach but it didn't work.
In the file "esp-knx-ip.h" I delete the parts "knx_command_type_t ct,".

So from:
void write_14byte_string(address_t const &receiver, knx_command_type_t ct, const char *val) { send_14byte_string(receiver, KNX_CT_WRITE, val); }

to:

void write_14byte_string(address_t const &receiver, const char *val) { send_14byte_string(receiver, KNX_CT_WRITE, val); }

Now it is compilingand tomorrow I will do a test with the sensor. I keep you posted.

Many thanks.
Poseidon

from esp-knx-ip.

envy avatar envy commented on August 23, 2024

Whoops, sorry.

Copy and paste error on my side. I fixed this in the repo, too.

from esp-knx-ip.

Poseidon1982 avatar Poseidon1982 commented on August 23, 2024

Hi Envy,

I tested today and now it working but I had to do some changes in esp-knx-ip-send.cpp.
Following is the change:

void ESPKNXIP::send_14byte_string(address_t const &receiver, knx_command_type_t ct, const char *val)
{
uint8_t buf[15] = {0x00};
int len = strlen(val);
if (len > 15)
{
len = 15;
}
memcpy(buf+1, val, len);
send(receiver, ct, 15, buf);
}

I got some strange values and I assume that there was something in buf. So I took the value from the examples above the file {0x00.
And the length have do be 15 otherwise ETS will not show only 13 bytes.
I don't really understand how it works so I did try and error and end up with a working result.

Many thanks
Poseidon

from esp-knx-ip.

envy avatar envy commented on August 23, 2024

Thanks, fixed. I forgot to initialize the array and account for the first extra byte being needed.

from esp-knx-ip.

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.