DPT16 (to bus) implemented (#28)

* DPT16 (to bus) implemented
This commit is contained in:
mumpf 2019-08-18 19:40:08 +02:00 committed by thelsing
parent 74fe42acaf
commit da5466ab02

View File

@ -1275,8 +1275,13 @@ int valueToBusValueAccess(const KNXValue& value, uint8_t* payload, int payload_l
int valueToBusValueString(const KNXValue& value, uint8_t* payload, int payload_length, const Dpt& datatype)
{
//TODO
return false;
const char* strValue = value;
uint8_t val = strValue[0];
for (int n = 0; n < 14; n++) {
if (val) val = strValue[n]; //string terminator 0x00 will stop further assignments and init the remainig payload with zero
unsigned8ToPayload(payload, payload_length, n, val, 0xff);
}
return true;
}
int valueToBusValueScene(const KNXValue& value, uint8_t* payload, int payload_length, const Dpt& datatype)