mirror of
https://github.com/thelsing/knx.git
synced 2025-01-30 00:19:01 +01:00
fixed wrong answers to property read:
with start = 0 (read the number of current elements) and current elements = 0 (empty property) 0 was returned which results in an error message when reading this property.
This commit is contained in:
parent
48000b25aa
commit
a5ba7bcd5e
@ -5,15 +5,16 @@
|
||||
|
||||
uint8_t DataProperty::read(uint16_t start, uint8_t count, uint8_t* data) const
|
||||
{
|
||||
if (count == 0 || _currentElements == 0 || start > _currentElements || count > _currentElements - start + 1)
|
||||
return 0;
|
||||
|
||||
if (start == 0)
|
||||
{
|
||||
pushWord(_currentElements, data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (count == 0 || _currentElements == 0 || start > _currentElements || count > _currentElements - start + 1)
|
||||
return 0;
|
||||
|
||||
|
||||
// we start counting with zero
|
||||
start -= 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user