save work

This commit is contained in:
Nanosonde 2020-07-10 21:37:28 +02:00
parent 373d44d29b
commit 2d0b0d05e5

View File

@ -266,8 +266,9 @@ void TpUartDataLinkLayer::loop()
{
uint8_t c = 0x10;
// If this is not a nullptr we consider this a device to be a coupler
// TODO: Improve for coupler mode, only ACK according to filter tables
// TODO: Improve for coupler mode. Use callback from bau to check if we are addressed
// The bau knows everything and could either check the address table object (normal device)
// or any filter tables (coupler) to see if we are addressed.
if (_groupAddressTable)
{
//check if individual or group address
@ -291,10 +292,26 @@ void TpUartDataLinkLayer::loop()
else
{
// TODO: test for only our coupler
//individual
if (_deviceObject.induvidualAddress() == getWord(buffer + 4))
//check if individual or group address
if ((buffer[6] & 0x80) == 0)
{
c |= 0x01;
//individual
if (_deviceObject.induvidualAddress() == getWord(buffer + 4))
{
c |= 0x01;
}
}
else
{
// TODO: test for only our coupler
//group
if (getWord(buffer + 4) == 0)
{
c |= 0x01;
}
}
}