mirror of
https://github.com/thelsing/knx.git
synced 2025-08-31 13:47:01 +02:00
save work
This commit is contained in:
parent
9b1505e379
commit
7c185a9293
@ -4,10 +4,8 @@
|
|||||||
#include "rf_medium_object.h"
|
#include "rf_medium_object.h"
|
||||||
#include "rf_physical_layer.h"
|
#include "rf_physical_layer.h"
|
||||||
#include "rf_data_link_layer.h"
|
#include "rf_data_link_layer.h"
|
||||||
#ifdef USE_CEMI_SERVER
|
|
||||||
#include "cemi_server.h"
|
#include "cemi_server.h"
|
||||||
#include "cemi_server_object.h"
|
#include "cemi_server_object.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
class Bau27B0 : public BauSystemB
|
class Bau27B0 : public BauSystemB
|
||||||
{
|
{
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#ifdef USE_CEMI_SERVER
|
||||||
|
|
||||||
#include "cemi_server.h"
|
#include "cemi_server.h"
|
||||||
#include "cemi_frame.h"
|
#include "cemi_frame.h"
|
||||||
#include "bau_systemB.h"
|
#include "bau_systemB.h"
|
||||||
@ -346,3 +348,5 @@ void CemiServer::loop()
|
|||||||
{
|
{
|
||||||
_usbTunnelInterface.loop();
|
_usbTunnelInterface.loop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#ifdef USE_CEMI_SERVER
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "cemi_server_object.h"
|
#include "cemi_server_object.h"
|
||||||
#include "bits.h"
|
#include "bits.h"
|
||||||
@ -109,3 +111,5 @@ PropertyDescription* CemiServerObject::propertyDescriptions()
|
|||||||
{
|
{
|
||||||
return _propertyDescriptions;
|
return _propertyDescriptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -21,4 +21,4 @@ private:
|
|||||||
uint8_t _addInfoTypesTable[1] = { 0x02 };
|
uint8_t _addInfoTypesTable[1] = { 0x02 };
|
||||||
uint8_t _commMode = 0x00;
|
uint8_t _commMode = 0x00;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -12,6 +12,8 @@ DataLinkLayer::DataLinkLayer(DeviceObject& devObj, AddressTableObject& addrTab,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_CEMI_SERVER
|
||||||
|
|
||||||
void DataLinkLayer::cemiServer(CemiServer& cemiServer)
|
void DataLinkLayer::cemiServer(CemiServer& cemiServer)
|
||||||
{
|
{
|
||||||
_cemiServer = &cemiServer;
|
_cemiServer = &cemiServer;
|
||||||
@ -30,6 +32,7 @@ void DataLinkLayer::dataRequestFromTunnel(CemiFrame& frame)
|
|||||||
// Send to KNX medium
|
// Send to KNX medium
|
||||||
sendFrame(frame);
|
sendFrame(frame);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void DataLinkLayer::dataRequest(AckType ack, AddressType addrType, uint16_t destinationAddr, FrameFormat format, Priority priority, NPDU& npdu)
|
void DataLinkLayer::dataRequest(AckType ack, AddressType addrType, uint16_t destinationAddr, FrameFormat format, Priority priority, NPDU& npdu)
|
||||||
{
|
{
|
||||||
@ -60,16 +63,15 @@ void DataLinkLayer::dataConReceived(CemiFrame& frame, bool success)
|
|||||||
NPDU& npdu = frame.npdu();
|
NPDU& npdu = frame.npdu();
|
||||||
SystemBroadcast systemBroadcast = frame.systemBroadcast();
|
SystemBroadcast systemBroadcast = frame.systemBroadcast();
|
||||||
|
|
||||||
if (_cemiServer)
|
#ifdef USE_CEMI_SERVER
|
||||||
|
// if the confirmation was caused by a tunnel request then
|
||||||
|
// do not send it to the local stack
|
||||||
|
if (frame.sourceAddress() == _cemiServer->clientAddress())
|
||||||
{
|
{
|
||||||
// if the confirmation was caused by a tunnel request then
|
// Stop processing here and do NOT send it the local network layer
|
||||||
// do not send it to the local stack
|
return;
|
||||||
if (frame.sourceAddress() == _cemiServer->clientAddress())
|
|
||||||
{
|
|
||||||
// Stop processing here and do NOT send it the local network layer
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (addrType == GroupAddress && destination == 0)
|
if (addrType == GroupAddress && destination == 0)
|
||||||
if (systemBroadcast == SysBroadcast)
|
if (systemBroadcast == SysBroadcast)
|
||||||
@ -94,15 +96,14 @@ void DataLinkLayer::frameRecieved(CemiFrame& frame)
|
|||||||
uint16_t ownAddr = _deviceObject.induvidualAddress();
|
uint16_t ownAddr = _deviceObject.induvidualAddress();
|
||||||
SystemBroadcast systemBroadcast = frame.systemBroadcast();
|
SystemBroadcast systemBroadcast = frame.systemBroadcast();
|
||||||
|
|
||||||
if (_cemiServer)
|
#ifdef USE_CEMI_SERVER
|
||||||
|
// Do not send our own message back to the tunnel
|
||||||
|
if (frame.sourceAddress() != _cemiServer->clientAddress())
|
||||||
{
|
{
|
||||||
// Do not send our own message back to the tunnel
|
_cemiServer->dataIndicationToTunnel(frame);
|
||||||
if (frame.sourceAddress() != _cemiServer->clientAddress())
|
|
||||||
{
|
|
||||||
_cemiServer->dataIndicationToTunnel(frame);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (source == ownAddr)
|
if (source == ownAddr)
|
||||||
_deviceObject.induvidualAddressDuplication(true);
|
_deviceObject.induvidualAddressDuplication(true);
|
||||||
|
|
||||||
@ -166,18 +167,17 @@ bool DataLinkLayer::sendTelegram(NPDU & npdu, AckType ack, uint16_t destinationA
|
|||||||
// Thus, reuse the modified cEMI frame as "frame" is only passed by reference here!
|
// Thus, reuse the modified cEMI frame as "frame" is only passed by reference here!
|
||||||
bool success = sendFrame(frame);
|
bool success = sendFrame(frame);
|
||||||
|
|
||||||
if (_cemiServer)
|
#ifdef USE_CEMI_SERVER
|
||||||
{
|
CemiFrame tmpFrame(frame.data(), frame.totalLenght());
|
||||||
CemiFrame tmpFrame(frame.data(), frame.totalLenght());
|
// 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)
|
tmpFrame.rfSerialOrDoA(frame.rfSerialOrDoA());
|
||||||
tmpFrame.rfSerialOrDoA(frame.rfSerialOrDoA());
|
tmpFrame.rfInfo(frame.rfInfo());
|
||||||
tmpFrame.rfInfo(frame.rfInfo());
|
tmpFrame.rfLfn(frame.rfLfn());
|
||||||
tmpFrame.rfLfn(frame.rfLfn());
|
tmpFrame.confirm(ConfirmNoError);
|
||||||
tmpFrame.confirm(ConfirmNoError);
|
_cemiServer->dataIndicationToTunnel(tmpFrame);
|
||||||
_cemiServer->dataIndicationToTunnel(tmpFrame);
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
@ -13,9 +13,11 @@ class DataLinkLayer
|
|||||||
DataLinkLayer(DeviceObject& devObj, AddressTableObject& addrTab, NetworkLayer& layer,
|
DataLinkLayer(DeviceObject& devObj, AddressTableObject& addrTab, NetworkLayer& layer,
|
||||||
Platform& platform);
|
Platform& platform);
|
||||||
|
|
||||||
|
#ifdef USE_CEMI_SERVER
|
||||||
// from tunnel
|
// from tunnel
|
||||||
void cemiServer(CemiServer& cemiServer);
|
void cemiServer(CemiServer& cemiServer);
|
||||||
void dataRequestFromTunnel(CemiFrame& frame);
|
void dataRequestFromTunnel(CemiFrame& frame);
|
||||||
|
#endif
|
||||||
|
|
||||||
// from network layer
|
// from network layer
|
||||||
void dataRequest(AckType ack, AddressType addrType, uint16_t destinationAddr, FrameFormat format,
|
void dataRequest(AckType ack, AddressType addrType, uint16_t destinationAddr, FrameFormat format,
|
||||||
@ -35,5 +37,7 @@ class DataLinkLayer
|
|||||||
AddressTableObject& _groupAddressTable;
|
AddressTableObject& _groupAddressTable;
|
||||||
NetworkLayer& _networkLayer;
|
NetworkLayer& _networkLayer;
|
||||||
Platform& _platform;
|
Platform& _platform;
|
||||||
|
#ifdef USE_CEMI_SERVER
|
||||||
CemiServer* _cemiServer;
|
CemiServer* _cemiServer;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#ifdef USE_CEMI_SERVER
|
||||||
|
|
||||||
#include "bits.h"
|
#include "bits.h"
|
||||||
#include "usb_tunnel_interface.h"
|
#include "usb_tunnel_interface.h"
|
||||||
#include "cemi_server.h"
|
#include "cemi_server.h"
|
||||||
@ -537,3 +539,5 @@ uint16_t UsbTunnelInterface::getHidReportDescriptorLength()
|
|||||||
{
|
{
|
||||||
return sizeof(descHidReport);
|
return sizeof(descHidReport);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user