mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
Fix build for cemi_server without RF support
This commit is contained in:
parent
57b5b05ce1
commit
9a46d7b1b2
@ -56,6 +56,7 @@ void CemiServer::dataConfirmationToTunnel(CemiFrame& frame)
|
||||
|
||||
void CemiServer::dataIndicationToTunnel(CemiFrame& frame)
|
||||
{
|
||||
#ifdef USE_RF
|
||||
bool isRf = _dataLinkLayer->mediumType() == DptMedium::KNX_RF;
|
||||
uint8_t data[frame.dataLength() + (isRf ? 10 : 0)];
|
||||
|
||||
@ -74,6 +75,10 @@ void CemiServer::dataIndicationToTunnel(CemiFrame& frame)
|
||||
{
|
||||
memcpy(&data[0], frame.data(), frame.dataLength());
|
||||
}
|
||||
#else
|
||||
uint8_t data[frame.dataLength()];
|
||||
memcpy(&data[0], frame.data(), frame.dataLength());
|
||||
#endif
|
||||
|
||||
CemiFrame tmpFrame(data, sizeof(data));
|
||||
|
||||
@ -102,7 +107,7 @@ void CemiServer::frameReceived(CemiFrame& frame)
|
||||
{
|
||||
frame.sourceAddress(_clientAddress);
|
||||
}
|
||||
|
||||
#ifdef USE_RF
|
||||
if (isRf)
|
||||
{
|
||||
// Check if we have additional info for RF
|
||||
@ -133,7 +138,7 @@ void CemiServer::frameReceived(CemiFrame& frame)
|
||||
_frameNumber = (_frameNumber + 1) & 0x7;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
print("L_data_req: src: ");
|
||||
print(frame.sourceAddress(), HEX);
|
||||
print(" dst: ");
|
||||
|
@ -173,9 +173,11 @@ bool DataLinkLayer::sendTelegram(NPDU & npdu, AckType ack, uint16_t destinationA
|
||||
// We can just copy the pointer for rfSerialOrDoA as sendFrame() sets
|
||||
// a pointer to const uint8_t data in either device object (serial) or
|
||||
// RF medium object (domain address)
|
||||
#ifdef USE_RF
|
||||
tmpFrame.rfSerialOrDoA(frame.rfSerialOrDoA());
|
||||
tmpFrame.rfInfo(frame.rfInfo());
|
||||
tmpFrame.rfLfn(frame.rfLfn());
|
||||
#endif
|
||||
tmpFrame.confirm(ConfirmNoError);
|
||||
_cemiServer->dataIndicationToTunnel(tmpFrame);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user