diff --git a/database b/database index 87b0bc90b..b1628d11a 100644 Binary files a/database and b/database differ diff --git a/resources/database/vscp-hashtypeevents.sqlite3 b/resources/database/vscp-hashtypeevents.sqlite3 index 87b0bc90b..b1628d11a 100644 Binary files a/resources/database/vscp-hashtypeevents.sqlite3 and b/resources/database/vscp-hashtypeevents.sqlite3 differ diff --git a/src/vscp/common/vscp-client-canal.cpp b/src/vscp/common/vscp-client-canal.cpp index a4a350126..38f145b6e 100644 --- a/src/vscp/common/vscp-client-canal.cpp +++ b/src/vscp/common/vscp-client-canal.cpp @@ -507,7 +507,7 @@ vscpClientCanal::getResponseTimeout(void) // int -vscpClientCanal::setCallbackEv(std::function callback) +vscpClientCanal::setCallbackEv(std::function callback, void *pData) { // Can not be called when connected if (m_bConnected) { @@ -516,7 +516,7 @@ vscpClientCanal::setCallbackEv(std::function ca } spdlog::debug("CANAL CLIENT: ev callback set."); - CVscpClient::setCallbackEv(callback); + CVscpClient::setCallbackEv(callback, pData); return VSCP_ERROR_SUCCESS; } @@ -525,7 +525,7 @@ vscpClientCanal::setCallbackEv(std::function ca // int -vscpClientCanal::setCallbackEx(std::function callback) +vscpClientCanal::setCallbackEx(std::function callback, void *pData) { // Can not be called when connected if (m_bConnected) { @@ -534,7 +534,7 @@ vscpClientCanal::setCallbackEx(std::function } spdlog::debug("CANAL CLIENT: ex callback set."); - CVscpClient::setCallbackEx(callback); + CVscpClient::setCallbackEx(callback, pData); return VSCP_ERROR_SUCCESS; } diff --git a/src/vscp/common/vscp-client-canal.h b/src/vscp/common/vscp-client-canal.h index fef2c87a4..e89a08c50 100644 --- a/src/vscp/common/vscp-client-canal.h +++ b/src/vscp/common/vscp-client-canal.h @@ -161,13 +161,13 @@ class vscpClientCanal : public CVscpClient { Set (and enable) receive callback for events @return Return VSCP_ERROR_SUCCESS of OK and error code else. */ - virtual int setCallbackEv(std::function callback); + virtual int setCallbackEv(std::function callback, void *pData = nullptr); /*! Set (and enable) receive callback ex events @return Return VSCP_ERROR_SUCCESS of OK and error code else. */ - virtual int setCallbackEx(std::function callback); + virtual int setCallbackEx(std::function callback, void *pData = nullptr); /*! Return a JSON representation of connection diff --git a/src/vscp/common/vscp-client-socketcan.cpp b/src/vscp/common/vscp-client-socketcan.cpp index d379f4e66..49e452004 100644 --- a/src/vscp/common/vscp-client-socketcan.cpp +++ b/src/vscp/common/vscp-client-socketcan.cpp @@ -696,14 +696,14 @@ vscpClientSocketCan::sendToCallbacks(vscpEvent *pev) // int -vscpClientSocketCan::setCallbackEv(std::function callback) +vscpClientSocketCan::setCallbackEv(std::function callback, void *pData ) { // Can not be called when connected if (m_bConnected) { return VSCP_ERROR_ERROR; } - CVscpClient::setCallbackEv(callback); + CVscpClient::setCallbackEv(callback, pData); return VSCP_ERROR_SUCCESS; } @@ -713,14 +713,14 @@ vscpClientSocketCan::setCallbackEv(std::function callback) +vscpClientSocketCan::setCallbackEx(std::function callback, void *pData ) { // Can not be called when connected if (m_bConnected) { return VSCP_ERROR_ERROR; } - CVscpClient::setCallbackEx(callback); + CVscpClient::setCallbackEx(callback, pData); return VSCP_ERROR_SUCCESS; } diff --git a/src/vscp/common/vscp-client-socketcan.h b/src/vscp/common/vscp-client-socketcan.h index 8a3eef153..75e927551 100644 --- a/src/vscp/common/vscp-client-socketcan.h +++ b/src/vscp/common/vscp-client-socketcan.h @@ -43,19 +43,19 @@ #include #include -#include #include +#include #include #include #include -#include #include -#include #include +#include +#include #include #include -#include +#include #include "spdlog/sinks/rotating_file_sink.h" #include "spdlog/spdlog.h" @@ -123,7 +123,7 @@ class vscpClientSocketCan : public CVscpClient { Set state of connected flag @param b True for connected, false for not connected. */ - void setConnected(bool b=true) {m_bConnected = b;}; + void setConnected(bool b = true) { m_bConnected = b; }; /*! Send VSCP event to remote host. @@ -211,13 +211,15 @@ class vscpClientSocketCan : public CVscpClient { Set (and enable) receive callback for events @return Return VSCP_ERROR_SUCCESS of OK and error code else. */ - virtual int setCallbackEv(std::function callback); + //using CVscpClient::setCallbackEv; + virtual int setCallbackEv(std::function callback, void *pData = nullptr); /*! Set (and enable) receive callback ex events @return Return VSCP_ERROR_SUCCESS of OK and error code else. */ - virtual int setCallbackEx(std::function callback); + //using CVscpClient::setCallbackEx; + virtual int setCallbackEx(std::function callback, void *pData = nullptr); /*! Return a JSON representation of connection @@ -293,7 +295,7 @@ class vscpClientSocketCan : public CVscpClient { // ------------------------------------------------------------------------ // Event lists - //std::list m_sendList; + // std::list m_sendList; std::list m_receiveList; /*!