[Debian-iot-packaging] [openzwave-controlpanel] 38/81: Send all node info to new connections. Support new notification AllNodesQueriedSomeDead.
Dara Adib
daradib-guest at moszumanska.debian.org
Thu Dec 22 16:57:49 UTC 2016
This is an automated email from the git hooks/post-receive script.
daradib-guest pushed a commit to branch debian/master
in repository openzwave-controlpanel.
commit c4d671d788b57ebc63721b278a56093e381e6bde
Author: glsatz <glsatz at gmail.com>
Date: Wed Jan 23 07:07:27 2013 +0000
Send all node info to new connections.
Support new notification AllNodesQueriedSomeDead.
---
ozwcp.cpp | 20 ++++++++++++++++++++
ozwcp.h | 2 +-
webserver.cpp | 2 +-
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/ozwcp.cpp b/ozwcp.cpp
index 4a57873..f530b24 100644
--- a/ozwcp.cpp
+++ b/ozwcp.cpp
@@ -419,6 +419,23 @@ MyValue *MyNode::getValue (uint8 n)
}
/*
+ * Mark all nodes as changed
+ */
+void MyNode::setAllChanged (bool ch)
+{
+ nodechanged = ch;
+ int i = 0;
+ int j = 1;
+ while (j <= nodecount && i < MAX_NODES) {
+ if (nodes[i] != NULL) {
+ nodes[i]->setChanged(true);
+ j++;
+ }
+ i++;
+ }
+}
+
+/*
* Returns next item on the removed list.
*/
@@ -665,6 +682,9 @@ void OnNotification (Notification const* _notification, void* _context)
case Notification::Type_AwakeNodesQueried:
Log::Write(LogLevel_Info, "Notification: Awake Nodes Queried");
break;
+ case Notification::Type_AllNodesQueriedSomeDead:
+ Log::Write(LogLevel_Info, "Notification: Awake Nodes Queried Some Dead");
+ break;
case Notification::Type_AllNodesQueried:
Log::Write(LogLevel_Info, "Notification: All Nodes Queried");
break;
diff --git a/ozwcp.h b/ozwcp.h
index 10bde73..d817859 100644
--- a/ozwcp.h
+++ b/ozwcp.h
@@ -94,7 +94,7 @@ public:
uint32 getTime() { return mtime; }
void setTime(uint32 t) { mtime = t; }
static bool getAnyChanged() { return nodechanged; }
- static void setAnyChanged(bool ch) { nodechanged = ch; }
+ static void setAllChanged(bool ch);
bool getChanged() { return changed; }
void setChanged(bool ch) { changed = ch; nodechanged = ch; }
static void addRemoved(uint8 node) { removed.push_back(node); }
diff --git a/webserver.cpp b/webserver.cpp
index e4bf6d5..60afe3e 100644
--- a/webserver.cpp
+++ b/webserver.cpp
@@ -1024,7 +1024,7 @@ int Webserver::Handler (struct MHD_Connection *conn, const char *url,
if (strcmp((char *)cp->conn_arg1, "open") == 0) { /* start connection */
if (devname != NULL || usb) {
- MyNode::setAnyChanged(true);
+ MyNode::setAllChanged(true);
} else {
if ((char *)cp->conn_arg3 != NULL && strcmp((char *)cp->conn_arg3, "true") == 0) {
Manager::Get()->AddDriver("HID Controller", Driver::ControllerInterface_Hid );
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-iot/openzwave-controlpanel.git
More information about the Debian-iot-packaging
mailing list