mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
Merge pull request #283 from tonylu00/fix/cemi-server-failed-without-rf
Fix: build for cemi_server on platform without RF support will failed
This commit is contained in:
commit
8a31e9091a
@ -56,6 +56,7 @@ void CemiServer::dataConfirmationToTunnel(CemiFrame& frame)
|
|||||||
|
|
||||||
void CemiServer::dataIndicationToTunnel(CemiFrame& frame)
|
void CemiServer::dataIndicationToTunnel(CemiFrame& frame)
|
||||||
{
|
{
|
||||||
|
#ifdef USE_RF
|
||||||
bool isRf = _dataLinkLayer->mediumType() == DptMedium::KNX_RF;
|
bool isRf = _dataLinkLayer->mediumType() == DptMedium::KNX_RF;
|
||||||
uint8_t data[frame.dataLength() + (isRf ? 10 : 0)];
|
uint8_t data[frame.dataLength() + (isRf ? 10 : 0)];
|
||||||
|
|
||||||
@ -74,6 +75,10 @@ void CemiServer::dataIndicationToTunnel(CemiFrame& frame)
|
|||||||
{
|
{
|
||||||
memcpy(&data[0], frame.data(), frame.dataLength());
|
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));
|
CemiFrame tmpFrame(data, sizeof(data));
|
||||||
|
|
||||||
@ -102,7 +107,7 @@ void CemiServer::frameReceived(CemiFrame& frame)
|
|||||||
{
|
{
|
||||||
frame.sourceAddress(_clientAddress);
|
frame.sourceAddress(_clientAddress);
|
||||||
}
|
}
|
||||||
|
#ifdef USE_RF
|
||||||
if (isRf)
|
if (isRf)
|
||||||
{
|
{
|
||||||
// Check if we have additional info for RF
|
// Check if we have additional info for RF
|
||||||
@ -133,7 +138,7 @@ void CemiServer::frameReceived(CemiFrame& frame)
|
|||||||
_frameNumber = (_frameNumber + 1) & 0x7;
|
_frameNumber = (_frameNumber + 1) & 0x7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
print("L_data_req: src: ");
|
print("L_data_req: src: ");
|
||||||
print(frame.sourceAddress(), HEX);
|
print(frame.sourceAddress(), HEX);
|
||||||
print(" dst: ");
|
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
|
// We can just copy the pointer for rfSerialOrDoA as sendFrame() sets
|
||||||
// a pointer to const uint8_t data in either device object (serial) or
|
// a pointer to const uint8_t data in either device object (serial) or
|
||||||
// RF medium object (domain address)
|
// RF medium object (domain address)
|
||||||
|
#ifdef USE_RF
|
||||||
tmpFrame.rfSerialOrDoA(frame.rfSerialOrDoA());
|
tmpFrame.rfSerialOrDoA(frame.rfSerialOrDoA());
|
||||||
tmpFrame.rfInfo(frame.rfInfo());
|
tmpFrame.rfInfo(frame.rfInfo());
|
||||||
tmpFrame.rfLfn(frame.rfLfn());
|
tmpFrame.rfLfn(frame.rfLfn());
|
||||||
|
#endif
|
||||||
tmpFrame.confirm(ConfirmNoError);
|
tmpFrame.confirm(ConfirmNoError);
|
||||||
_cemiServer->dataIndicationToTunnel(tmpFrame);
|
_cemiServer->dataIndicationToTunnel(tmpFrame);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user