fixing issues from PR review

This commit is contained in:
Ing-Dom 2023-12-26 13:48:50 +01:00
parent 311abdd88f
commit 142e0a2325
6 changed files with 9 additions and 25 deletions

View File

@ -151,18 +151,4 @@ bool Bau07B0::isAckRequired(uint16_t address, bool isGrpAddr)
return false; return false;
} }
// /// @brief sets the Callback Function indicating sent or received telegrams
// /// @param activityCallback
// /// @details the info parameter
// void Bau07B0::setActivityCallback(ActivityCallback activityCallback)
// {
// _activityCallback = activityCallback;
// }
// void Bau07B0::Activity(uint8_t info)
// {
// if(_activityCallback)
// _activityCallback(info);
// }
#endif #endif

View File

@ -7,7 +7,7 @@
#include "cemi_frame.h" #include "cemi_frame.h"
void DataLinkLayerCallbacks::Activity(uint8_t info) void DataLinkLayerCallbacks::activity(uint8_t info)
{ {
if(_activityCallback) if(_activityCallback)
_activityCallback(info); _activityCallback(info);

View File

@ -18,7 +18,7 @@ protected:
ActivityCallback _activityCallback = nullptr; ActivityCallback _activityCallback = nullptr;
public: public:
virtual ~DataLinkLayerCallbacks() = default; virtual ~DataLinkLayerCallbacks() = default;
virtual void Activity(uint8_t info); virtual void activity(uint8_t info);
virtual void setActivityCallback(ActivityCallback activityCallback); virtual void setActivityCallback(ActivityCallback activityCallback);
}; };

View File

@ -32,7 +32,7 @@ bool IpDataLinkLayer::sendFrame(CemiFrame& frame)
bool success = sendBytes(packet.data(), packet.totalLength()); bool success = sendBytes(packet.data(), packet.totalLength());
#ifdef KNX_ACTIVITYCALLBACK #ifdef KNX_ACTIVITYCALLBACK
if(_dllcb) if(_dllcb)
_dllcb->Activity((_netIndex << KNX_ACTIVITYCALLBACK_NET) | (KNX_ACTIVITYCALLBACK_DIR_SEND << KNX_ACTIVITYCALLBACK_DIR)); _dllcb->activity((_netIndex << KNX_ACTIVITYCALLBACK_NET) | (KNX_ACTIVITYCALLBACK_DIR_SEND << KNX_ACTIVITYCALLBACK_DIR));
#endif #endif
dataConReceived(frame, success); dataConReceived(frame, success);
return success; return success;
@ -57,7 +57,7 @@ void IpDataLinkLayer::loop()
#ifdef KNX_ACTIVITYCALLBACK #ifdef KNX_ACTIVITYCALLBACK
if(_dllcb) if(_dllcb)
_dllcb->Activity((_netIndex << KNX_ACTIVITYCALLBACK_NET) | (KNX_ACTIVITYCALLBACK_DIR_RECV << KNX_ACTIVITYCALLBACK_DIR)); _dllcb->activity((_netIndex << KNX_ACTIVITYCALLBACK_NET) | (KNX_ACTIVITYCALLBACK_DIR_RECV << KNX_ACTIVITYCALLBACK_DIR));
#endif #endif
uint16_t code; uint16_t code;
@ -78,7 +78,7 @@ void IpDataLinkLayer::loop()
auto hpai = searchRequest.hpai(); auto hpai = searchRequest.hpai();
#ifdef KNX_ACTIVITYCALLBACK #ifdef KNX_ACTIVITYCALLBACK
if(_dllcb) if(_dllcb)
_dllcb->Activity((_netIndex << KNX_ACTIVITYCALLBACK_NET) | (KNX_ACTIVITYCALLBACK_DIR_SEND << KNX_ACTIVITYCALLBACK_DIR) | (KNX_ACTIVITYCALLBACK_IPUNICAST)); _dllcb->activity((_netIndex << KNX_ACTIVITYCALLBACK_NET) | (KNX_ACTIVITYCALLBACK_DIR_SEND << KNX_ACTIVITYCALLBACK_DIR) | (KNX_ACTIVITYCALLBACK_IPUNICAST));
#endif #endif
_platform.sendBytesUniCast(hpai.ipAddress(), hpai.ipPortNumber(), searchResponse.data(), searchResponse.totalLength()); _platform.sendBytesUniCast(hpai.ipAddress(), hpai.ipPortNumber(), searchResponse.data(), searchResponse.totalLength());
break; break;

View File

@ -550,7 +550,7 @@ void TpUartDataLinkLayer::frameBytesReceived(uint8_t* buffer, uint16_t length)
//printHex("=>", buffer, length); //printHex("=>", buffer, length);
#ifdef KNX_ACTIVITYCALLBACK #ifdef KNX_ACTIVITYCALLBACK
if(_dllcb) if(_dllcb)
_dllcb->Activity((_netIndex << KNX_ACTIVITYCALLBACK_NET) | (KNX_ACTIVITYCALLBACK_DIR_RECV << KNX_ACTIVITYCALLBACK_DIR)); _dllcb->activity((_netIndex << KNX_ACTIVITYCALLBACK_NET) | (KNX_ACTIVITYCALLBACK_DIR_RECV << KNX_ACTIVITYCALLBACK_DIR));
#endif #endif
CemiFrame frame(buffer, length); CemiFrame frame(buffer, length);
frameReceived(frame); frameReceived(frame);
@ -660,7 +660,7 @@ bool TpUartDataLinkLayer::sendSingleFrameByte()
_TxByteCnt = 0; _TxByteCnt = 0;
#ifdef KNX_ACTIVITYCALLBACK #ifdef KNX_ACTIVITYCALLBACK
if(_dllcb) if(_dllcb)
_dllcb->Activity((_netIndex << KNX_ACTIVITYCALLBACK_NET) | (KNX_ACTIVITYCALLBACK_DIR_SEND << KNX_ACTIVITYCALLBACK_DIR)); _dllcb->activity((_netIndex << KNX_ACTIVITYCALLBACK_NET) | (KNX_ACTIVITYCALLBACK_DIR_SEND << KNX_ACTIVITYCALLBACK_DIR));
#endif #endif
return false; return false;
} }

View File

@ -21,8 +21,6 @@ class TpUartDataLinkLayer : public DataLinkLayer
using DataLinkLayer::_platform; using DataLinkLayer::_platform;
public: public:
// TpUartDataLinkLayer(DeviceObject& devObj, NetworkLayerEntity& netLayerEntity,
// Platform& platform, ITpUartCallBacks& cb);
TpUartDataLinkLayer(DeviceObject& devObj, NetworkLayerEntity& netLayerEntity, TpUartDataLinkLayer(DeviceObject& devObj, NetworkLayerEntity& netLayerEntity,
Platform& platform, ITpUartCallBacks& cb, DataLinkLayerCallbacks* dllcb = nullptr); Platform& platform, ITpUartCallBacks& cb, DataLinkLayerCallbacks* dllcb = nullptr);