mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
Merge pull request #251 from OpenKNX/fix_data_property_read_idx0
fixed wrong answers to property read
This commit is contained in:
commit
f7ac39c66f
@ -5,15 +5,16 @@
|
|||||||
|
|
||||||
uint8_t DataProperty::read(uint16_t start, uint8_t count, uint8_t* data) const
|
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)
|
if (start == 0)
|
||||||
{
|
{
|
||||||
pushWord(_currentElements, data);
|
pushWord(_currentElements, data);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (count == 0 || _currentElements == 0 || start > _currentElements || count > _currentElements - start + 1)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
// we start counting with zero
|
// we start counting with zero
|
||||||
start -= 1;
|
start -= 1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user