mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
fixing issues from PR review
This commit is contained in:
parent
311abdd88f
commit
142e0a2325
@ -151,18 +151,4 @@ bool Bau07B0::isAckRequired(uint16_t address, bool isGrpAddr)
|
||||
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
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "cemi_frame.h"
|
||||
|
||||
|
||||
void DataLinkLayerCallbacks::Activity(uint8_t info)
|
||||
void DataLinkLayerCallbacks::activity(uint8_t info)
|
||||
{
|
||||
if(_activityCallback)
|
||||
_activityCallback(info);
|
||||
|
@ -18,7 +18,7 @@ protected:
|
||||
ActivityCallback _activityCallback = nullptr;
|
||||
public:
|
||||
virtual ~DataLinkLayerCallbacks() = default;
|
||||
virtual void Activity(uint8_t info);
|
||||
virtual void activity(uint8_t info);
|
||||
virtual void setActivityCallback(ActivityCallback activityCallback);
|
||||
};
|
||||
|
||||
|
@ -32,7 +32,7 @@ bool IpDataLinkLayer::sendFrame(CemiFrame& frame)
|
||||
bool success = sendBytes(packet.data(), packet.totalLength());
|
||||
#ifdef KNX_ACTIVITYCALLBACK
|
||||
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
|
||||
dataConReceived(frame, success);
|
||||
return success;
|
||||
@ -57,7 +57,7 @@ void IpDataLinkLayer::loop()
|
||||
|
||||
#ifdef KNX_ACTIVITYCALLBACK
|
||||
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
|
||||
|
||||
uint16_t code;
|
||||
@ -78,7 +78,7 @@ void IpDataLinkLayer::loop()
|
||||
auto hpai = searchRequest.hpai();
|
||||
#ifdef KNX_ACTIVITYCALLBACK
|
||||
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
|
||||
_platform.sendBytesUniCast(hpai.ipAddress(), hpai.ipPortNumber(), searchResponse.data(), searchResponse.totalLength());
|
||||
break;
|
||||
|
@ -550,7 +550,7 @@ void TpUartDataLinkLayer::frameBytesReceived(uint8_t* buffer, uint16_t length)
|
||||
//printHex("=>", buffer, length);
|
||||
#ifdef KNX_ACTIVITYCALLBACK
|
||||
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
|
||||
CemiFrame frame(buffer, length);
|
||||
frameReceived(frame);
|
||||
@ -660,7 +660,7 @@ bool TpUartDataLinkLayer::sendSingleFrameByte()
|
||||
_TxByteCnt = 0;
|
||||
#ifdef KNX_ACTIVITYCALLBACK
|
||||
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
|
||||
return false;
|
||||
}
|
||||
|
@ -21,8 +21,6 @@ class TpUartDataLinkLayer : public DataLinkLayer
|
||||
using DataLinkLayer::_platform;
|
||||
|
||||
public:
|
||||
// TpUartDataLinkLayer(DeviceObject& devObj, NetworkLayerEntity& netLayerEntity,
|
||||
// Platform& platform, ITpUartCallBacks& cb);
|
||||
TpUartDataLinkLayer(DeviceObject& devObj, NetworkLayerEntity& netLayerEntity,
|
||||
Platform& platform, ITpUartCallBacks& cb, DataLinkLayerCallbacks* dllcb = nullptr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user