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; uint8_t c = 0x10;
// If this is not a nullptr we consider this a device to be a coupler // TODO: Improve for coupler mode. Use callback from bau to check if we are addressed
// TODO: Improve for coupler mode, only ACK according to filter tables // 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) if (_groupAddressTable)
{ {
//check if individual or group address //check if individual or group address
@ -291,12 +292,28 @@ void TpUartDataLinkLayer::loop()
else else
{ {
// TODO: test for only our coupler // TODO: test for only our coupler
//individual
//check if individual or group address
if ((buffer[6] & 0x80) == 0)
{
//individual //individual
if (_deviceObject.induvidualAddress() == getWord(buffer + 4)) if (_deviceObject.induvidualAddress() == getWord(buffer + 4))
{ {
c |= 0x01; c |= 0x01;
} }
} }
else
{
// TODO: test for only our coupler
//group
if (getWord(buffer + 4) == 0)
{
c |= 0x01;
}
}
}
_platform.writeUart(c); _platform.writeUart(c);
} }