Update esp-knx-ip library to latest

This commit is contained in:
Adrian Scillato 2019-07-11 15:29:39 -03:00 committed by GitHub
parent c4dbde6306
commit 16463ef2d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,12 +188,14 @@ void ESPKNXIP::send_4byte_float(address_t const &receiver, knx_command_type_t ct
void ESPKNXIP::send_14byte_string(address_t const &receiver, knx_command_type_t ct, const char *val) void ESPKNXIP::send_14byte_string(address_t const &receiver, knx_command_type_t ct, const char *val)
{ {
uint8_t buf[14]; // DPT16 strings are always 14 bytes long, however the data array is one larger due to the telegram structure.
// The first byte needs to be zero, string start after that.
uint8_t buf[15] = {0x00};
int len = strlen(val); int len = strlen(val);
if (len > 14) if (len > 14)
{ {
len = 14; len = 14;
} }
memcpy(buf, val, len); memcpy(buf+1, val, len);
send(receiver, ct, 14, buf); send(receiver, ct, 15, buf);
} }