You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

413 lines
16 KiB

  1. --- a/hardware/Comm5Serial.cpp
  2. +++ b/hardware/Comm5Serial.cpp
  3. @@ -5,6 +5,8 @@
  4. #include "../main/Logger.h"
  5. #include "../main/RFXtrx.h"
  6. +using namespace std::placeholders;
  7. +
  8. /*
  9. This driver allows Domoticz to control any I/O module from the MA-4xxx Family
  10. @@ -92,7 +94,7 @@ bool Comm5Serial::StartHardware()
  11. return false;
  12. }
  13. m_bIsStarted=true;
  14. - setReadCallback(boost::bind(&Comm5Serial::readCallBack, this, _1, _2));
  15. + setReadCallback(std::bind(&Comm5Serial::readCallBack, this, _1, _2));
  16. sOnConnected(this);
  17. return true;
  18. --- a/hardware/DenkoviUSBDevices.cpp
  19. +++ b/hardware/DenkoviUSBDevices.cpp
  20. @@ -16,6 +16,8 @@ enum _edaeUsbState
  21. #define DAE_IO_TYPE_RELAY 2
  22. +using namespace std::placeholders;
  23. +
  24. CDenkoviUSBDevices::CDenkoviUSBDevices(const int ID, const std::string& comPort, const int model) :
  25. m_szSerialPort(comPort)
  26. {
  27. @@ -78,7 +80,7 @@ bool CDenkoviUSBDevices::StartHardware()
  28. m_thread = std::make_shared<std::thread>(&CDenkoviUSBDevices::Do_Work, this);
  29. m_bIsStarted = true;
  30. - setReadCallback(boost::bind(&CDenkoviUSBDevices::readCallBack, this, _1, _2));
  31. + setReadCallback(std::bind(&CDenkoviUSBDevices::readCallBack, this, _1, _2));
  32. sOnConnected(this);
  33. return true;
  34. --- a/hardware/EvohomeRadio.cpp
  35. +++ b/hardware/EvohomeRadio.cpp
  36. @@ -26,6 +26,8 @@
  37. extern std::string szUserDataFolder;
  38. +using namespace std::placeholders;
  39. +
  40. enum evoCommands
  41. {
  42. cmdSysInfo = 0x10e0,
  43. @@ -86,27 +88,27 @@ CEvohomeRadio::CEvohomeRadio(const int ID, const std::string& UserContID)
  44. s_strid >> std::hex >> m_UControllerID;
  45. }
  46. - RegisterDecoder(cmdZoneTemp, boost::bind(&CEvohomeRadio::DecodeZoneTemp, this, _1));
  47. - RegisterDecoder(cmdSetPoint, boost::bind(&CEvohomeRadio::DecodeSetpoint, this, _1));
  48. - RegisterDecoder(cmdSetpointOverride, boost::bind(&CEvohomeRadio::DecodeSetpointOverride, this, _1));
  49. - RegisterDecoder(cmdDHWState, boost::bind(&CEvohomeRadio::DecodeDHWState, this, _1));
  50. - RegisterDecoder(cmdDHWTemp, boost::bind(&CEvohomeRadio::DecodeDHWTemp, this, _1));
  51. - RegisterDecoder(cmdControllerMode, boost::bind(&CEvohomeRadio::DecodeControllerMode, this, _1));
  52. - RegisterDecoder(cmdSysInfo, boost::bind(&CEvohomeRadio::DecodeSysInfo, this, _1));
  53. - RegisterDecoder(cmdZoneName, boost::bind(&CEvohomeRadio::DecodeZoneName, this, _1));
  54. - RegisterDecoder(cmdZoneHeatDemand, boost::bind(&CEvohomeRadio::DecodeHeatDemand, this, _1));
  55. - RegisterDecoder(cmdOpenThermBridge, boost::bind(&CEvohomeRadio::DecodeOpenThermBridge, this, _1));
  56. - RegisterDecoder(cmdOpenThermSetpoint, boost::bind(&CEvohomeRadio::DecodeOpenThermSetpoint, this, _1));
  57. - RegisterDecoder(cmdZoneInfo, boost::bind(&CEvohomeRadio::DecodeZoneInfo, this, _1));
  58. - RegisterDecoder(cmdControllerHeatDemand, boost::bind(&CEvohomeRadio::DecodeHeatDemand, this, _1));
  59. - RegisterDecoder(cmdBinding, boost::bind(&CEvohomeRadio::DecodeBinding, this, _1));
  60. - RegisterDecoder(cmdActuatorState, boost::bind(&CEvohomeRadio::DecodeActuatorState, this, _1));
  61. - RegisterDecoder(cmdActuatorCheck, boost::bind(&CEvohomeRadio::DecodeActuatorCheck, this, _1));
  62. - RegisterDecoder(cmdZoneWindow, boost::bind(&CEvohomeRadio::DecodeZoneWindow, this, _1));
  63. - RegisterDecoder(cmdExternalSensor, boost::bind(&CEvohomeRadio::DecodeExternalSensor, this, _1));
  64. - RegisterDecoder(cmdDeviceInfo, boost::bind(&CEvohomeRadio::DecodeDeviceInfo, this, _1));
  65. - RegisterDecoder(cmdBatteryInfo, boost::bind(&CEvohomeRadio::DecodeBatteryInfo, this, _1));
  66. - RegisterDecoder(cmdSync, boost::bind(&CEvohomeRadio::DecodeSync, this, _1));
  67. + RegisterDecoder(cmdZoneTemp, std::bind(&CEvohomeRadio::DecodeZoneTemp, this, _1));
  68. + RegisterDecoder(cmdSetPoint, std::bind(&CEvohomeRadio::DecodeSetpoint, this, _1));
  69. + RegisterDecoder(cmdSetpointOverride, std::bind(&CEvohomeRadio::DecodeSetpointOverride, this, _1));
  70. + RegisterDecoder(cmdDHWState, std::bind(&CEvohomeRadio::DecodeDHWState, this, _1));
  71. + RegisterDecoder(cmdDHWTemp, std::bind(&CEvohomeRadio::DecodeDHWTemp, this, _1));
  72. + RegisterDecoder(cmdControllerMode, std::bind(&CEvohomeRadio::DecodeControllerMode, this, _1));
  73. + RegisterDecoder(cmdSysInfo, std::bind(&CEvohomeRadio::DecodeSysInfo, this, _1));
  74. + RegisterDecoder(cmdZoneName, std::bind(&CEvohomeRadio::DecodeZoneName, this, _1));
  75. + RegisterDecoder(cmdZoneHeatDemand, std::bind(&CEvohomeRadio::DecodeHeatDemand, this, _1));
  76. + RegisterDecoder(cmdOpenThermBridge, std::bind(&CEvohomeRadio::DecodeOpenThermBridge, this, _1));
  77. + RegisterDecoder(cmdOpenThermSetpoint, std::bind(&CEvohomeRadio::DecodeOpenThermSetpoint, this, _1));
  78. + RegisterDecoder(cmdZoneInfo, std::bind(&CEvohomeRadio::DecodeZoneInfo, this, _1));
  79. + RegisterDecoder(cmdControllerHeatDemand, std::bind(&CEvohomeRadio::DecodeHeatDemand, this, _1));
  80. + RegisterDecoder(cmdBinding, std::bind(&CEvohomeRadio::DecodeBinding, this, _1));
  81. + RegisterDecoder(cmdActuatorState, std::bind(&CEvohomeRadio::DecodeActuatorState, this, _1));
  82. + RegisterDecoder(cmdActuatorCheck, std::bind(&CEvohomeRadio::DecodeActuatorCheck, this, _1));
  83. + RegisterDecoder(cmdZoneWindow, std::bind(&CEvohomeRadio::DecodeZoneWindow, this, _1));
  84. + RegisterDecoder(cmdExternalSensor, std::bind(&CEvohomeRadio::DecodeExternalSensor, this, _1));
  85. + RegisterDecoder(cmdDeviceInfo, std::bind(&CEvohomeRadio::DecodeDeviceInfo, this, _1));
  86. + RegisterDecoder(cmdBatteryInfo, std::bind(&CEvohomeRadio::DecodeBatteryInfo, this, _1));
  87. + RegisterDecoder(cmdSync, std::bind(&CEvohomeRadio::DecodeSync, this, _1));
  88. }
  89. --- a/hardware/EvohomeSerial.cpp
  90. +++ b/hardware/EvohomeSerial.cpp
  91. @@ -7,6 +7,8 @@
  92. #include "../main/localtime_r.h"
  93. #include <boost/exception/diagnostic_information.hpp>
  94. +using namespace std::placeholders;
  95. +
  96. CEvohomeSerial::CEvohomeSerial(const int ID, const std::string &szSerialPort, const int baudrate, const std::string &UserContID) :
  97. CEvohomeRadio(ID, UserContID)
  98. {
  99. @@ -64,7 +66,7 @@ bool CEvohomeSerial::OpenSerialDevice()
  100. }
  101. m_nBufPtr=0;
  102. m_bIsStarted=true;
  103. - setReadCallback(boost::bind(&CEvohomeSerial::ReadCallback, this, _1, _2));
  104. + setReadCallback(std::bind(&CEvohomeSerial::ReadCallback, this, _1, _2));
  105. sOnConnected(this);
  106. return true;
  107. }
  108. --- a/hardware/MQTT.cpp
  109. +++ b/hardware/MQTT.cpp
  110. @@ -18,6 +18,8 @@
  111. #define TOPIC_IN "domoticz/in"
  112. #define QOS 1
  113. +using namespace std::placeholders;
  114. +
  115. const char* szTLSVersions[3] =
  116. {
  117. "tlsv1",
  118. @@ -133,8 +135,8 @@ void MQTT::on_connect(int rc)
  119. _log.Log(LOG_STATUS, "MQTT: connected to: %s:%d", m_szIPAddress.c_str(), m_usIPPort);
  120. m_IsConnected = true;
  121. sOnConnected(this);
  122. - m_sDeviceReceivedConnection = m_mainworker.sOnDeviceReceived.connect(boost::bind(&MQTT::SendDeviceInfo, this, _1, _2, _3, _4));
  123. - m_sSwitchSceneConnection = m_mainworker.sOnSwitchScene.connect(boost::bind(&MQTT::SendSceneInfo, this, _1, _2));
  124. + m_sDeviceReceivedConnection = m_mainworker.sOnDeviceReceived.connect(std::bind(&MQTT::SendDeviceInfo, this, _1, _2, _3, _4));
  125. + m_sSwitchSceneConnection = m_mainworker.sOnSwitchScene.connect(std::bind(&MQTT::SendSceneInfo, this, _1, _2));
  126. }
  127. subscribe(NULL, m_TopicIn.c_str());
  128. }
  129. --- a/hardware/Pinger.cpp
  130. +++ b/hardware/Pinger.cpp
  131. @@ -25,6 +25,8 @@
  132. #define GET_IO_SERVICE(s) ((s).get_io_service())
  133. #endif
  134. +using namespace std::placeholders;
  135. +
  136. class pinger
  137. : private domoticz::noncopyable
  138. {
  139. @@ -87,7 +89,7 @@ private:
  140. }
  141. else
  142. {
  143. - timer_.async_wait(boost::bind(&pinger::start_send, this));
  144. + timer_.async_wait(std::bind(&pinger::start_send, this));
  145. }
  146. }
  147. }
  148. @@ -100,7 +102,7 @@ private:
  149. // Wait for a reply. We prepare the buffer to receive up to 64KB.
  150. socket_.async_receive(reply_buffer_.prepare(65536),
  151. - boost::bind(&pinger::handle_receive, this, _2));
  152. + std::bind(&pinger::handle_receive, this, _2));
  153. }
  154. void handle_receive(std::size_t length)
  155. @@ -384,7 +386,7 @@ void CPinger::DoPingHosts()
  156. if (m_iThreadsRunning < 1000)
  157. {
  158. //m_iThreadsRunning++;
  159. - boost::thread t(boost::bind(&CPinger::Do_Ping_Worker, this, *itt));
  160. + boost::thread t(std::bind(&CPinger::Do_Ping_Worker, this, *itt));
  161. SetThreadName(t.native_handle(), "PingerWorker");
  162. t.join();
  163. }
  164. --- a/hardware/RAVEn.cpp
  165. +++ b/hardware/RAVEn.cpp
  166. @@ -11,6 +11,8 @@
  167. //Rainforest RAVEn USB ZigBee Smart Meter Adapter
  168. //https://rainforestautomation.com/rfa-z106-raven/
  169. +using namespace std::placeholders;
  170. +
  171. RAVEn::RAVEn(const int ID, const std::string& devname)
  172. : device_(devname), m_wptr(m_buffer), m_currUsage(0), m_totalUsage(0)
  173. {
  174. @@ -46,7 +48,7 @@ bool RAVEn::StartHardware()
  175. _log.Log(LOG_ERROR, "RAVEn: Error opening serial port!!!");
  176. return false;
  177. }
  178. - setReadCallback(boost::bind(&RAVEn::readCallback, this, _1, _2));
  179. + setReadCallback(std::bind(&RAVEn::readCallback, this, _1, _2));
  180. m_bIsStarted = true;
  181. sOnConnected(this);
  182. --- a/hardware/RFLinkSerial.cpp
  183. +++ b/hardware/RFLinkSerial.cpp
  184. @@ -5,6 +5,8 @@
  185. #include "../main/localtime_r.h"
  186. #include <boost/exception/diagnostic_information.hpp>
  187. +using namespace std::placeholders;
  188. +
  189. CRFLinkSerial::CRFLinkSerial(const int ID, const std::string& devname) :
  190. m_szSerialPort(devname)
  191. {
  192. @@ -181,7 +183,7 @@ bool CRFLinkSerial::OpenSerialDevice()
  193. m_rfbufferpos = 0;
  194. m_LastReceivedTime = mytime(NULL);
  195. - setReadCallback(boost::bind(&CRFLinkSerial::readCallback, this, _1, _2));
  196. + setReadCallback(std::bind(&CRFLinkSerial::readCallback, this, _1, _2));
  197. sOnConnected(this);
  198. return true;
  199. --- a/hardware/TCPProxy/tcpproxy_server.cpp
  200. +++ b/hardware/TCPProxy/tcpproxy_server.cpp
  201. @@ -21,6 +21,8 @@
  202. #define GET_IO_SERVICE(s) ((s).get_io_service())
  203. #endif
  204. +using namespace std::placeholders;
  205. +
  206. namespace tcp_proxy
  207. {
  208. bridge::bridge(boost::asio::io_service& ios)
  209. @@ -186,8 +188,8 @@ namespace tcp_proxy
  210. session_ = std::shared_ptr<bridge>(
  211. new bridge(io_service_)
  212. );
  213. - session_->sDownstreamData.connect( boost::bind( &acceptor::OnDownstreamData, this, _1, _2 ) );
  214. - session_->sUpstreamData.connect( boost::bind( &acceptor::OnUpstreamData, this, _1, _2 ) );
  215. + session_->sDownstreamData.connect( std::bind( &acceptor::OnDownstreamData, this, _1, _2 ) );
  216. + session_->sUpstreamData.connect( std::bind( &acceptor::OnUpstreamData, this, _1, _2 ) );
  217. acceptor_.async_accept(session_->downstream_socket(),
  218. boost::bind(&acceptor::handle_accept,
  219. --- a/hardware/ZiBlueSerial.cpp
  220. +++ b/hardware/ZiBlueSerial.cpp
  221. @@ -8,6 +8,8 @@
  222. #define ZiBlue_RETRY_DELAY 30
  223. +using namespace std::placeholders;
  224. +
  225. CZiBlueSerial::CZiBlueSerial(const int ID, const std::string& devname) :
  226. m_szSerialPort(devname)
  227. {
  228. @@ -136,7 +138,7 @@ bool CZiBlueSerial::OpenSerialDevice()
  229. m_rfbufferpos = 0;
  230. m_LastReceivedTime = mytime(NULL);
  231. - setReadCallback(boost::bind(&CZiBlueSerial::readCallback, this, _1, _2));
  232. + setReadCallback(std::bind(&CZiBlueSerial::readCallback, this, _1, _2));
  233. sOnConnected(this);
  234. --- a/hardware/plugins/PluginTransports.cpp
  235. +++ b/hardware/plugins/PluginTransports.cpp
  236. @@ -13,6 +13,8 @@
  237. #include "icmp_header.hpp"
  238. #include "ipv4_header.hpp"
  239. +using namespace std::placeholders;
  240. +
  241. namespace Plugins {
  242. void CPluginTransport::handleRead(const boost::system::error_code& e, std::size_t bytes_transferred)
  243. @@ -972,7 +974,7 @@ namespace Plugins {
  244. if (m_bConnected)
  245. {
  246. pPlugin->MessagePlugin(new onConnectCallback(pPlugin, m_pConnection, 0, "SerialPort " + m_Port + " opened successfully."));
  247. - setReadCallback(boost::bind(&CPluginTransportSerial::handleRead, this, _1, _2));
  248. + setReadCallback(std::bind(&CPluginTransportSerial::handleRead, this, _1, _2));
  249. }
  250. else
  251. {
  252. --- a/push/FibaroPush.cpp
  253. +++ b/push/FibaroPush.cpp
  254. @@ -14,6 +14,8 @@
  255. #define __STDC_FORMAT_MACROS
  256. #include <inttypes.h>
  257. +using namespace std::placeholders;
  258. +
  259. CFibaroPush::CFibaroPush()
  260. {
  261. m_bLinkActive = false;
  262. @@ -22,7 +24,7 @@ CFibaroPush::CFibaroPush()
  263. void CFibaroPush::Start()
  264. {
  265. UpdateActive();
  266. - m_sConnection = m_mainworker.sOnDeviceReceived.connect(boost::bind(&CFibaroPush::OnDeviceReceived, this, _1, _2, _3, _4));
  267. + m_sConnection = m_mainworker.sOnDeviceReceived.connect(std::bind(&CFibaroPush::OnDeviceReceived, this, _1, _2, _3, _4));
  268. }
  269. void CFibaroPush::Stop()
  270. @@ -400,4 +402,4 @@ namespace http {
  271. root["title"] = "DeleteFibaroLink";
  272. }
  273. }
  274. -}
  275. \ No newline at end of file
  276. +}
  277. --- a/push/GooglePubSubPush.cpp
  278. +++ b/push/GooglePubSubPush.cpp
  279. @@ -21,6 +21,8 @@ extern "C" {
  280. #include <boost/python.hpp>
  281. #endif
  282. +using namespace std::placeholders;
  283. +
  284. extern std::string szUserDataFolder;
  285. // this should be filled in by the preprocessor
  286. @@ -38,7 +40,7 @@ CGooglePubSubPush::CGooglePubSubPush()
  287. void CGooglePubSubPush::Start()
  288. {
  289. UpdateActive();
  290. - m_sConnection = m_mainworker.sOnDeviceReceived.connect(boost::bind(&CGooglePubSubPush::OnDeviceReceived, this, _1, _2, _3, _4));
  291. + m_sConnection = m_mainworker.sOnDeviceReceived.connect(std::bind(&CGooglePubSubPush::OnDeviceReceived, this, _1, _2, _3, _4));
  292. }
  293. void CGooglePubSubPush::Stop()
  294. --- a/push/HttpPush.cpp
  295. +++ b/push/HttpPush.cpp
  296. @@ -15,6 +15,8 @@
  297. #define __STDC_FORMAT_MACROS
  298. #include <inttypes.h>
  299. +using namespace std::placeholders;
  300. +
  301. CHttpPush::CHttpPush()
  302. {
  303. m_bLinkActive = false;
  304. @@ -23,7 +25,7 @@ CHttpPush::CHttpPush()
  305. void CHttpPush::Start()
  306. {
  307. UpdateActive();
  308. - m_sConnection = m_mainworker.sOnDeviceReceived.connect(boost::bind(&CHttpPush::OnDeviceReceived, this, _1, _2, _3, _4));
  309. + m_sConnection = m_mainworker.sOnDeviceReceived.connect(std::bind(&CHttpPush::OnDeviceReceived, this, _1, _2, _3, _4));
  310. }
  311. void CHttpPush::Stop()
  312. --- a/push/InfluxPush.cpp
  313. +++ b/push/InfluxPush.cpp
  314. @@ -15,6 +15,8 @@
  315. #define __STDC_FORMAT_MACROS
  316. #include <inttypes.h>
  317. +using namespace std::placeholders;
  318. +
  319. CInfluxPush::CInfluxPush() :
  320. m_InfluxPort(8086),
  321. m_bInfluxDebugActive(false)
  322. @@ -33,7 +35,7 @@ bool CInfluxPush::Start()
  323. m_thread = std::make_shared<std::thread>(&CInfluxPush::Do_Work, this);
  324. SetThreadName(m_thread->native_handle(), "InfluxPush");
  325. - m_sConnection = m_mainworker.sOnDeviceReceived.connect(boost::bind(&CInfluxPush::OnDeviceReceived, this, _1, _2, _3, _4));
  326. + m_sConnection = m_mainworker.sOnDeviceReceived.connect(std::bind(&CInfluxPush::OnDeviceReceived, this, _1, _2, _3, _4));
  327. return (m_thread != NULL);
  328. }
  329. --- a/push/WebsocketPush.cpp
  330. +++ b/push/WebsocketPush.cpp
  331. @@ -3,6 +3,8 @@
  332. #include "../webserver/WebsocketHandler.h"
  333. #include "../main/mainworker.h"
  334. +using namespace std::placeholders;
  335. +
  336. extern boost::signals2::signal<void(const std::string &Subject, const std::string &Text, const std::string &ExtraData, const int Priority, const std::string & Sound, const bool bFromNotification)> sOnNotificationReceived;
  337. @@ -19,9 +21,9 @@ void CWebSocketPush::Start()
  338. if (isStarted) {
  339. return;
  340. }
  341. - m_sConnection = m_mainworker.sOnDeviceReceived.connect(boost::bind(&CWebSocketPush::OnDeviceReceived, this, _1, _2, _3, _4));
  342. - m_sNotification = sOnNotificationReceived.connect(boost::bind(&CWebSocketPush::OnNotificationReceived, this, _1, _2, _3, _4, _5, _6));
  343. - m_sSceneChanged = m_mainworker.sOnSwitchScene.connect(boost::bind(&CWebSocketPush::OnSceneChange, this, _1, _2));
  344. + m_sConnection = m_mainworker.sOnDeviceReceived.connect(std::bind(&CWebSocketPush::OnDeviceReceived, this, _1, _2, _3, _4));
  345. + m_sNotification = sOnNotificationReceived.connect(std::bind(&CWebSocketPush::OnNotificationReceived, this, _1, _2, _3, _4, _5, _6));
  346. + m_sSceneChanged = m_mainworker.sOnSwitchScene.connect(std::bind(&CWebSocketPush::OnSceneChange, this, _1, _2));
  347. isStarted = true;
  348. }
  349. --- a/webserver/proxyclient.cpp
  350. +++ b/webserver/proxyclient.cpp
  351. @@ -19,6 +19,8 @@
  352. extern std::string szAppVersion;
  353. +using namespace std::placeholders;
  354. +
  355. #define PROXY_TIMEOUT 60
  356. #define PONG "PONG"
  357. @@ -349,7 +351,7 @@ namespace http {
  358. // todo: make a map of websocket connections. There can be more than one.
  359. // open new virtual websocket connection
  360. // todo: different request_url's can have different websocket handlers
  361. - websocket_handlers[pdu->m_requestid] = new CWebsocketHandler(m_pWebEm, boost::bind(&CProxyClient::WS_Write, this, pdu->m_requestid, _1));
  362. + websocket_handlers[pdu->m_requestid] = new CWebsocketHandler(m_pWebEm, std::bind(&CProxyClient::WS_Write, this, pdu->m_requestid, _1));
  363. websocket_handlers[pdu->m_requestid]->Start();
  364. }