Update KNX Library - Send String

This commit is contained in:
Adrian Scillato 2019-07-09 19:57:29 -03:00 committed by GitHub
parent 09af192a21
commit 6b52e96f2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

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