Skip to content

Commit

Permalink
Merge pull request #251 from OpenKNX/fix_data_property_read_idx0
Browse files Browse the repository at this point in the history
fixed wrong answers to property read
  • Loading branch information
thelsing authored Jul 13, 2023
2 parents aa57fdf + a5ba7bc commit f7ac39c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/knx/data_property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f7ac39c

Please sign in to comment.