diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fdee6c1e..33cacaaed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -273,12 +273,12 @@ if (WIN32) src/vscp/common/canaldlldef.h src/vscp/common/vscpcanaldeviceif.h src/vscp/common/vscpcanaldeviceif.cpp - src/vscp/common/canal_xmlconfig.h - src/vscp/common/canal_xmlconfig.cpp - src/vscp/common/vscp_client_base.h - src/vscp/common/vscp_client_base.cpp - src/vscp/common/vscp_client_mqtt.h - src/vscp/common/vscp_client_mqtt.cpp + src/vscp/common/canal-xmlconfig.h + src/vscp/common/canal-xmlconfig.cpp + src/vscp/common/vscp-client-base.h + src/vscp/common/vscp-client-base.cpp + src/vscp/common/vscp-client-mqtt.h + src/vscp/common/vscp-client-mqtt.cpp ./third_party/mustache/mustache.hpp ./third_party/sqlite3/sqlite3.h ./third_party/sqlite3/sqlite3.c @@ -323,12 +323,12 @@ else() src/vscp/common/canaldlldef.h src/vscp/common/vscpcanaldeviceif.h src/vscp/common/vscpcanaldeviceif.cpp - src/vscp/common/canal_xmlconfig.h - src/vscp/common/canal_xmlconfig.cpp - src/vscp/common/vscp_client_base.h - src/vscp/common/vscp_client_base.cpp - src/vscp/common/vscp_client_mqtt.h - src/vscp/common/vscp_client_mqtt.cpp + src/vscp/common/canal-xmlconfig.h + src/vscp/common/canal-xmlconfig.cpp + src/vscp/common/vscp-client-base.h + src/vscp/common/vscp-client-base.cpp + src/vscp/common/vscp-client-mqtt.h + src/vscp/common/vscp-client-mqtt.cpp ./third_party/mustache/mustache.hpp ./third_party/sqlite3/sqlite3.h ./third_party/sqlite3/sqlite3.c @@ -400,7 +400,6 @@ if(MSVC) OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto -# websockets_shared ${MOSQUITTO_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES} expat::expat diff --git a/src/vscp/common/canal-xmlconfig.cpp b/src/vscp/common/canal-xmlconfig.cpp index 8571e7a95..972f34299 100644 --- a/src/vscp/common/canal-xmlconfig.cpp +++ b/src/vscp/common/canal-xmlconfig.cpp @@ -43,7 +43,7 @@ #include "vscp.h" #include "vscphelper.h" -#include "canal_xmlconfig.h" +#include "canal-xmlconfig.h" #include #include diff --git a/src/vscp/common/mqtt.h b/src/vscp/common/mqtt.h index afba4d3e6..193421a37 100644 --- a/src/vscp/common/mqtt.h +++ b/src/vscp/common/mqtt.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/vscp/common/vscp-bootdevice.h b/src/vscp/common/vscp-bootdevice.h index 3b1954e3a..15d640277 100644 --- a/src/vscp/common/vscp-bootdevice.h +++ b/src/vscp/common/vscp-bootdevice.h @@ -71,7 +71,7 @@ #include "guid.h" #include "mdf.h" #include "register.h" -#include "vscp_client_base.h" +#include "vscp-client-base.h" #include diff --git a/src/vscp/common/vscp-client-base.cpp b/src/vscp/common/vscp-client-base.cpp index 94ec965ce..1d189a3bb 100644 --- a/src/vscp/common/vscp-client-base.cpp +++ b/src/vscp/common/vscp-client-base.cpp @@ -35,7 +35,7 @@ #include #include -#include "vscp_client_base.h" +#include "vscp-client-base.h" /////////////////////////////////////////////////////////////////////////////// // CVscpClient diff --git a/src/vscp/common/vscp-client-canal.cpp b/src/vscp/common/vscp-client-canal.cpp index bb2b5a5e3..96a208def 100644 --- a/src/vscp/common/vscp-client-canal.cpp +++ b/src/vscp/common/vscp-client-canal.cpp @@ -35,7 +35,7 @@ #include -#include "vscp_client_canal.h" +#include "vscp-client-canal.h" #include "vscphelper.h" diff --git a/src/vscp/common/vscp-client-canal.h b/src/vscp/common/vscp-client-canal.h index e972615ed..b2aa81d60 100644 --- a/src/vscp/common/vscp-client-canal.h +++ b/src/vscp/common/vscp-client-canal.h @@ -27,7 +27,7 @@ #define VSCPCLIENTCANAL_H__INCLUDED_ #include "vscp.h" -#include "vscp_client_base.h" +#include "vscp-client-base.h" #include "vscpcanaldeviceif.h" #include diff --git a/src/vscp/common/vscp-client-level2.cpp b/src/vscp/common/vscp-client-level2.cpp index 4e771faf5..6e1276189 100644 --- a/src/vscp/common/vscp-client-level2.cpp +++ b/src/vscp/common/vscp-client-level2.cpp @@ -62,7 +62,7 @@ #include #include #include -#include "vscp_client_level2.h" +#include "vscp-client-level2.h" #include #include diff --git a/src/vscp/common/vscp-client-mqtt.cpp b/src/vscp/common/vscp-client-mqtt.cpp index 790cdf37f..374f2fa84 100644 --- a/src/vscp/common/vscp-client-mqtt.cpp +++ b/src/vscp/common/vscp-client-mqtt.cpp @@ -27,7 +27,7 @@ #include #endif -#include "vscp_client_mqtt.h" +#include "vscp-client-mqtt.h" #include #ifndef WIN32 diff --git a/src/vscp/common/vscp-client-mqtt.h b/src/vscp/common/vscp-client-mqtt.h index 26d887683..99b3a5db7 100644 --- a/src/vscp/common/vscp-client-mqtt.h +++ b/src/vscp/common/vscp-client-mqtt.h @@ -152,7 +152,7 @@ mqtt-options/protocol-version can be set to 310/311/500 #if !defined(VSCPCLIENTMQTT_H__INCLUDED_) #define VSCPCLIENTMQTT_H__INCLUDED_ -#include "vscp_client_base.h" +#include "vscp-client-base.h" #include #include #include diff --git a/src/vscp/common/vscp-client-multicast.cpp b/src/vscp/common/vscp-client-multicast.cpp index 0ddc7f95d..a067a391b 100644 --- a/src/vscp/common/vscp-client-multicast.cpp +++ b/src/vscp/common/vscp-client-multicast.cpp @@ -28,7 +28,7 @@ #endif #include "vscphelper.h" -#include "vscp_client_multicast.h" +#include "vscp-client-multicast.h" /////////////////////////////////////////////////////////////////////////////// // CTor diff --git a/src/vscp/common/vscp-client-multicast.h b/src/vscp/common/vscp-client-multicast.h index 6a69cfcb0..f2ae587ac 100644 --- a/src/vscp/common/vscp-client-multicast.h +++ b/src/vscp/common/vscp-client-multicast.h @@ -27,7 +27,7 @@ #define VSCPCLIENTMULTICAST_H__INCLUDED_ #include "vscp.h" -#include "vscp_client_base.h" +#include "vscp-client-base.h" class vscpClientMulticast : public CVscpClient { diff --git a/src/vscp/common/vscp-client-rawcan.cpp b/src/vscp/common/vscp-client-rawcan.cpp index 3ac39922c..805c342eb 100644 --- a/src/vscp/common/vscp-client-rawcan.cpp +++ b/src/vscp/common/vscp-client-rawcan.cpp @@ -27,7 +27,7 @@ #include #endif -#include "vscp_client_rawcan.h" +#include "vscp-client-rawcan.h" #include "vscphelper.h" /////////////////////////////////////////////////////////////////////////////// diff --git a/src/vscp/common/vscp-client-rawcan.h b/src/vscp/common/vscp-client-rawcan.h index d6d9f6190..bab962602 100644 --- a/src/vscp/common/vscp-client-rawcan.h +++ b/src/vscp/common/vscp-client-rawcan.h @@ -27,7 +27,7 @@ #define VSCPCLIENTRAWCAN_H__INCLUDED_ #include "vscp.h" -#include "vscp_client_base.h" +#include "vscp-client-base.h" class vscpClientRawCan : public CVscpClient { diff --git a/src/vscp/common/vscp-client-rawmqtt.cpp b/src/vscp/common/vscp-client-rawmqtt.cpp index b93ea7265..288cb6f03 100644 --- a/src/vscp/common/vscp-client-rawmqtt.cpp +++ b/src/vscp/common/vscp-client-rawmqtt.cpp @@ -28,7 +28,7 @@ #endif #include "vscphelper.h" -#include "vscp_client_rawmqtt.h" +#include "vscp-client-rawmqtt.h" /////////////////////////////////////////////////////////////////////////////// // CTor diff --git a/src/vscp/common/vscp-client-rawmqtt.h b/src/vscp/common/vscp-client-rawmqtt.h index 7bbd5bb46..f736aec60 100644 --- a/src/vscp/common/vscp-client-rawmqtt.h +++ b/src/vscp/common/vscp-client-rawmqtt.h @@ -27,7 +27,7 @@ #define VSCPCLIENTRAWMQTT_H__INCLUDED_ #include "vscp.h" -#include "vscp_client_base.h" +#include "vscp-client-base.h" class vscpClientRawMqtt : public CVscpClient { diff --git a/src/vscp/common/vscp-client-socketcan.cpp b/src/vscp/common/vscp-client-socketcan.cpp index 782615371..7678f3e5f 100644 --- a/src/vscp/common/vscp-client-socketcan.cpp +++ b/src/vscp/common/vscp-client-socketcan.cpp @@ -54,7 +54,7 @@ #include -#include "vscp_client_socketcan.h" +#include "vscp-client-socketcan.h" #include #include #include diff --git a/src/vscp/common/vscp-client-tcp.cpp b/src/vscp/common/vscp-client-tcp.cpp index 3115147c1..a5efbad55 100644 --- a/src/vscp/common/vscp-client-tcp.cpp +++ b/src/vscp/common/vscp-client-tcp.cpp @@ -27,7 +27,7 @@ #include #endif -#include "vscp_client_tcp.h" +#include "vscp-client-tcp.h" void workerThread(vscpClientTcp *pObj); diff --git a/src/vscp/common/vscp-client-tcp.h b/src/vscp/common/vscp-client-tcp.h index ca8c20ab9..fd672f580 100644 --- a/src/vscp/common/vscp-client-tcp.h +++ b/src/vscp/common/vscp-client-tcp.h @@ -26,7 +26,7 @@ #if !defined(VSCPCLIENTTCP_H__INCLUDED_) #define VSCPCLIENTTCP_H__INCLUDED_ -#include "vscp_client_base.h" +#include "vscp-client-base.h" #include #include diff --git a/src/vscp/common/vscp-client-udp.cpp b/src/vscp/common/vscp-client-udp.cpp index c97452015..bc226755c 100644 --- a/src/vscp/common/vscp-client-udp.cpp +++ b/src/vscp/common/vscp-client-udp.cpp @@ -28,7 +28,7 @@ #endif #include "vscphelper.h" -#include "vscp_client_udp.h" +#include "vscp-client-udp.h" /////////////////////////////////////////////////////////////////////////////// // CTor diff --git a/src/vscp/common/vscp-client-udp.h b/src/vscp/common/vscp-client-udp.h index ae0e5110f..8d7bb592c 100644 --- a/src/vscp/common/vscp-client-udp.h +++ b/src/vscp/common/vscp-client-udp.h @@ -27,7 +27,7 @@ #define VSCPCLIENTUDP_H__INCLUDED_ #include "vscp.h" -#include "vscp_client_base.h" +#include "vscp-client-base.h" class vscpClientUdp : public CVscpClient { diff --git a/src/vscp/common/vscp-client-ws1.cpp b/src/vscp/common/vscp-client-ws1.cpp index ee23697f0..0b96b650e 100644 --- a/src/vscp/common/vscp-client-ws1.cpp +++ b/src/vscp/common/vscp-client-ws1.cpp @@ -39,7 +39,7 @@ #include // #include "civetweb.h" -#include "vscp_client_ws1.h" +#include "vscp-client-ws1.h" /* static int diff --git a/src/vscp/common/vscp-client-ws1.h b/src/vscp/common/vscp-client-ws1.h index bd73978a2..8a9648d24 100644 --- a/src/vscp/common/vscp-client-ws1.h +++ b/src/vscp/common/vscp-client-ws1.h @@ -36,7 +36,7 @@ #endif #include "vscp.h" -#include "vscp_client_base.h" +#include "vscp-client-base.h" const uint32_t WS1_CONNECTION_TIMEOUT = 30000; const uint32_t WS1_RESPONSE_TIMEOUT = 2000; diff --git a/src/vscp/common/vscp-client-ws2.cpp b/src/vscp/common/vscp-client-ws2.cpp index fe7a3ed0f..1129735f6 100644 --- a/src/vscp/common/vscp-client-ws2.cpp +++ b/src/vscp/common/vscp-client-ws2.cpp @@ -39,7 +39,7 @@ #include // #include "civetweb.h" -#include "vscp_client_ws2.h" +#include "vscp-client-ws2.h" #include // Needs C++11 -std=c++11 diff --git a/src/vscp/common/vscp-client-ws2.h b/src/vscp/common/vscp-client-ws2.h index 1ffd1ae06..0e50a8d5f 100644 --- a/src/vscp/common/vscp-client-ws2.h +++ b/src/vscp/common/vscp-client-ws2.h @@ -35,7 +35,7 @@ #endif #include "vscp.h" -#include "vscp_client_base.h" +#include "vscp-client-base.h" #include const uint32_t WS2_CONNECTION_TIMEOUT = 30000; diff --git a/src/vscp/common/vscp_debug.h b/src/vscp/common/vscp-debug.h similarity index 100% rename from src/vscp/common/vscp_debug.h rename to src/vscp/common/vscp-debug.h diff --git a/src/vscp/common/vscp-type.h b/src/vscp/common/vscp_type.h similarity index 100% rename from src/vscp/common/vscp-type.h rename to src/vscp/common/vscp_type.h diff --git a/src/vscp/common/vscpcanaldeviceif.cpp b/src/vscp/common/vscpcanaldeviceif.cpp index 0d34b2345..c252e7144 100644 --- a/src/vscp/common/vscpcanaldeviceif.cpp +++ b/src/vscp/common/vscpcanaldeviceif.cpp @@ -42,7 +42,7 @@ #include // Needs C++11 -std=c++11 #include -#include +#include #include #include #include diff --git a/src/vscp/common/vscphelper.cpp b/src/vscp/common/vscphelper.cpp index 06e793610..27a8eb019 100644 --- a/src/vscp/common/vscphelper.cpp +++ b/src/vscp/common/vscphelper.cpp @@ -60,7 +60,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/vscp/daemon/controlobject.cpp b/src/vscp/daemon/controlobject.cpp index cb26a4a7c..0209f3150 100644 --- a/src/vscp/daemon/controlobject.cpp +++ b/src/vscp/daemon/controlobject.cpp @@ -79,9 +79,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/vscp/daemon/devicelist.cpp b/src/vscp/daemon/devicelist.cpp index 93a05cee9..ba8c66cf2 100644 --- a/src/vscp/daemon/devicelist.cpp +++ b/src/vscp/daemon/devicelist.cpp @@ -52,8 +52,8 @@ #include #include #include -#include -#include +#include +#include #include #include // Needs C++11 -std=c++11 diff --git a/src/vscp/daemon/devicelist.h b/src/vscp/daemon/devicelist.h index 7b91c7eb3..f7294032a 100644 --- a/src/vscp/daemon/devicelist.h +++ b/src/vscp/daemon/devicelist.h @@ -34,7 +34,7 @@ #include #include -#include +#include //#include #include #include diff --git a/src/vscp/daemon/devicethread.cpp b/src/vscp/daemon/devicethread.cpp index 85a520905..d5f63ee5d 100644 --- a/src/vscp/daemon/devicethread.cpp +++ b/src/vscp/daemon/devicethread.cpp @@ -51,12 +51,12 @@ #include "devicethread.h" -#include +#include #include #include #include #include -#include +#include #include #include @@ -81,27 +81,23 @@ extern uint64_t gDebugLevel; // static void -receive_event_callback(vscpEvent *pev, void *pobj) +receive_event_callback(vscpEvent &ev, void *pobj) { int rv; // Check pointers - if (nullptr == pev) { - return; - } - if (nullptr == pobj) { return; } CDeviceItem *pDeviceItem = (CDeviceItem *) pobj; - spdlog::trace("VSCP Event received. class={0} type={1}", pev->vscp_class, pev->vscp_type); + spdlog::trace("VSCP Event received. class={0} type={1}", ev.vscp_class, ev.vscp_type); if (VSCP_DRIVER_LEVEL1 == pDeviceItem->m_driverLevel) { canalMsg msg; - vscp_convertEventToCanal(&msg, pev); + vscp_convertEventToCanal(&msg, &ev); // Use blocking method if available if (nullptr != pDeviceItem->m_proc_CanalBlockingSend) { @@ -121,7 +117,7 @@ receive_event_callback(vscpEvent *pev, void *pobj) } } else if (VSCP_DRIVER_LEVEL2 == pDeviceItem->m_driverLevel) { - if (CANAL_ERROR_SUCCESS != pDeviceItem->m_proc_VSCPWrite(pDeviceItem->m_openHandle, pev, 500)) { + if (CANAL_ERROR_SUCCESS != pDeviceItem->m_proc_VSCPWrite(pDeviceItem->m_openHandle, &ev, 500)) { spdlog::error("driver: mqtt_on_message - Failed to send level II event."); } } @@ -406,7 +402,7 @@ deviceThread(void *pData) &pDeviceItem->m_pCtrlObj->m_map_type_id2Token); // Set event callback - pDeviceItem->m_mqttClient.setCallback(receive_event_callback, pDeviceItem); + pDeviceItem->m_mqttClient.setCallbackEv(receive_event_callback, pDeviceItem); // Connect to server if (VSCP_ERROR_SUCCESS != pDeviceItem->m_mqttClient.connect()) { @@ -687,7 +683,7 @@ deviceThread(void *pData) &pDeviceItem->m_pCtrlObj->m_map_type_id2Token); // Set event callback - pDeviceItem->m_mqttClient.setCallback(receive_event_callback); + pDeviceItem->m_mqttClient.setCallbackEv(receive_event_callback); // Connect to server if (VSCP_ERROR_SUCCESS != pDeviceItem->m_mqttClient.connect()) { diff --git a/src/vscp/daemon/vscpd.cpp b/src/vscp/daemon/vscpd.cpp index 6ee97f567..abf043111 100644 --- a/src/vscp/daemon/vscpd.cpp +++ b/src/vscp/daemon/vscpd.cpp @@ -59,7 +59,7 @@ #endif -#include "canal_macro.h" +#include "canal-macro.h" #include "vscpd.h" #include "controlobject.h" #include diff --git a/tests/vscp-client-canal/test-vscp-client-canal.cpp b/tests/vscp-client-canal/test-vscp-client-canal.cpp index 6c58f1c03..244073436 100644 --- a/tests/vscp-client-canal/test-vscp-client-canal.cpp +++ b/tests/vscp-client-canal/test-vscp-client-canal.cpp @@ -1,5 +1,5 @@ -#include "vscp_client_canal.h" +#include "vscp-client-canal.h" int main() diff --git a/tests/vscp-client-mqtt/test-vscp-client-mqtt.cpp b/tests/vscp-client-mqtt/test-vscp-client-mqtt.cpp index 2352affc3..92484c53b 100644 --- a/tests/vscp-client-mqtt/test-vscp-client-mqtt.cpp +++ b/tests/vscp-client-mqtt/test-vscp-client-mqtt.cpp @@ -26,7 +26,7 @@ #include #include "spdlog/spdlog.h" -#include "vscp_client_mqtt.h" +#include "vscp-client-mqtt.h" void test_ev_callback( vscpEvent *pev, void *pobj ) { diff --git a/tests/vscp-client-tcp/test-vscp-client-tcp.cpp b/tests/vscp-client-tcp/test-vscp-client-tcp.cpp index 6edd4f83e..8f1ace1ab 100644 --- a/tests/vscp-client-tcp/test-vscp-client-tcp.cpp +++ b/tests/vscp-client-tcp/test-vscp-client-tcp.cpp @@ -1,5 +1,5 @@ -#include "vscp_client_tcp.h" +#include "vscp-client-tcp.h" int main() diff --git a/tests/vscp-client-ws1/test-vscp-client-ws1.cpp b/tests/vscp-client-ws1/test-vscp-client-ws1.cpp index a35066628..29cbb5a5f 100644 --- a/tests/vscp-client-ws1/test-vscp-client-ws1.cpp +++ b/tests/vscp-client-ws1/test-vscp-client-ws1.cpp @@ -9,7 +9,7 @@ #include "civetweb.h" #include // Needs C++11 -std=c++11 -#include "vscp_client_ws1.h" +#include "vscp-client-ws1.h" #define WS2_RESPONSE_TIMEOUT 2000 diff --git a/tests/vscp-client-ws2/save_test-vscp-client-ws2.cpp b/tests/vscp-client-ws2/save_test-vscp-client-ws2.cpp index 950d5ea20..1303d9a73 100644 --- a/tests/vscp-client-ws2/save_test-vscp-client-ws2.cpp +++ b/tests/vscp-client-ws2/save_test-vscp-client-ws2.cpp @@ -9,7 +9,7 @@ #include "civetweb.h" #include // Needs C++11 -std=c++11 -#include "vscp_client_mqtt.h" +#include "vscp-client-mqtt.h" #define WS2_RESPONSE_TIMEOUT 2000 diff --git a/tests/vscp-client-ws2/test-vscp-client-ws2.cpp b/tests/vscp-client-ws2/test-vscp-client-ws2.cpp index f8668d29a..c80dadb94 100644 --- a/tests/vscp-client-ws2/test-vscp-client-ws2.cpp +++ b/tests/vscp-client-ws2/test-vscp-client-ws2.cpp @@ -9,7 +9,7 @@ #include "civetweb.h" #include // Needs C++11 -std=c++11 -#include "vscp_client_ws2.h" +#include "vscp-client-ws2.h" #define WS2_RESPONSE_TIMEOUT 2000