[dss-commits] digitalSTROM Server branch, master, updated. ffcf55af4195f8493e29c8ef2d9ae80a0513d4b3

git version control dss-commits at forum.digitalstrom.org
Tue Dec 8 18:03:03 CET 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "digitalSTROM Server".

The branch, master has been updated
       via  ffcf55af4195f8493e29c8ef2d9ae80a0513d4b3 (commit)
       via  6e6a60d2229048297c7eff4b9ec348922cd809b6 (commit)
       via  2299676fb2a40d442efcb4871f005a15bdd370a6 (commit)
      from  3b42bdf1854cfc2cb037ea9f0a305cffa5b05917 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ffcf55af4195f8493e29c8ef2d9ae80a0513d4b3
Author: Patrick Stählin <pstaehlin at futurelab.ch>
Date:   Tue Dec 8 16:20:25 2009 +0100

    Fixed some spelling errors

commit 6e6a60d2229048297c7eff4b9ec348922cd809b6
Author: Patrick Stählin <pstaehlin at futurelab.ch>
Date:   Tue Dec 8 16:18:36 2009 +0100

    Catch exceptions in JS:set.byDSID

commit 2299676fb2a40d442efcb4871f005a15bdd370a6
Author: Patrick Stählin <pstaehlin at futurelab.ch>
Date:   Tue Dec 8 16:06:04 2009 +0100

    Removed some errors reported by valgrind
    
    The errors fixes should have no impact on a non-simulated environment
    though.

-----------------------------------------------------------------------

Changes:
diff --git a/core/eventinterpreterplugins.cpp b/core/eventinterpreterplugins.cpp
index a5745f1..7f49e96 100644
--- a/core/eventinterpreterplugins.cpp
+++ b/core/eventinterpreterplugins.cpp
@@ -115,7 +115,7 @@ namespace dss {
             Logger::getInstance()->log("EventInterpreterPluginJavascript::handleEvent: keeping script " + scriptName + " in memory", lsInfo);
           }
         } catch(ScriptException& e) {
-          Logger::getInstance()->log(string("EventInterpreterPluginJavascript::handleEvent: Cought event while running/parsing script '")
+          Logger::getInstance()->log(string("EventInterpreterPluginJavascript::handleEvent: Caught event while running/parsing script '")
                               + scriptName + "'. Message: " + e.what(), lsError);
         }
       } else {
diff --git a/core/scripting/modeljs.cpp b/core/scripting/modeljs.cpp
index 503e970..fb5ecc6 100644
--- a/core/scripting/modeljs.cpp
+++ b/core/scripting/modeljs.cpp
@@ -205,9 +205,17 @@ namespace dss {
       JSString* str = JS_ValueToString(cx, argv[0]);
       if(str != NULL) {
         std::string dsid = JS_GetStringBytes(str);
-        DeviceReference result = set->getByDSID(dsid_t::fromString(dsid));
-        JSObject* resultObj = ext->createJSDevice(*ctx, result);
-        *rval = OBJECT_TO_JSVAL(resultObj);
+        try {
+          DeviceReference result = set->getByDSID(dsid_t::fromString(dsid));
+          JSObject* resultObj = ext->createJSDevice(*ctx, result);
+          *rval = OBJECT_TO_JSVAL(resultObj);
+          return JS_TRUE;
+        } catch(std::invalid_argument&) {
+          Logger::getInstance()->log("JS: set.byDSID: Could not parse dsid: '" + dsid + "'", lsError);
+        } catch(ItemNotFoundException&) {
+          Logger::getInstance()->log("JS: set.byDSID: Device with dsid '" + dsid + "' not found", lsWarning);
+        }
+        *rval = JSVAL_NULL;
         return JS_TRUE;
       }
     }
diff --git a/core/sim/dssim.cpp b/core/sim/dssim.cpp
index db3b4ce..b5bc58b 100644
--- a/core/sim/dssim.cpp
+++ b/core/sim/dssim.cpp
@@ -197,7 +197,7 @@ namespace dss {
             }
           }
         } catch (const std::exception & ex) {
-          log("LoadPlugins: Cought exception while loading " + dir_itr->leaf() + " '" + ex.what() + "'", lsError);
+          log("LoadPlugins: Caught exception while loading " + dir_itr->leaf() + " '" + ex.what() + "'", lsError);
         }
       }
     } catch(const std::exception& ex) {
@@ -978,6 +978,7 @@ namespace dss {
     result->setCommand(CommandEvent);
     result->getPayload().add<uint8_t>(EventDSLinkInterrupt);
     result->getPayload().add<devid_t>(_shortAddress);
+    result->getPayload().add<uint16_t>(0); // priority
     distributeFrame(result);
   } // dSLinkInterrupt
 
diff --git a/core/webserver.cpp b/core/webserver.cpp
index 797d741..df66eb4 100644
--- a/core/webserver.cpp
+++ b/core/webserver.cpp
@@ -94,7 +94,7 @@ namespace dss {
     } catch(std::runtime_error& e) {
       delete plugin;
       plugin = NULL;
-      log(string("Cought exception while loading: ") + e.what(), lsError);
+      log(string("Caught exception while loading: ") + e.what(), lsError);
       return;
     }
     m_Plugins.push_back(plugin);
diff --git a/unix/ds485.h b/unix/ds485.h
index 7046180..eb4d199 100644
--- a/unix/ds485.h
+++ b/unix/ds485.h
@@ -103,17 +103,20 @@ namespace dss {
     DS485Payload m_Payload;
     aFrameSource m_FrameSource;
   public:
-    DS485Frame() {};
-    virtual ~DS485Frame() {};
-    DS485Header& getHeader() { return m_Header; };
+    DS485Frame()
+    : m_FrameSource(fsDSS)
+    {}
+    virtual ~DS485Frame() {}
 
-    virtual std::vector<unsigned char> toChar() const;
+    DS485Header& getHeader() { return m_Header; }
 
     DS485Payload& getPayload();
     const DS485Payload& getPayload() const;
 
     aFrameSource getFrameSource() const { return m_FrameSource; }
     void setFrameSource(aFrameSource _value) { m_FrameSource = _value; }
+
+    virtual std::vector<unsigned char> toChar() const;
   }; // DS485Frame
 
   class DS485CommandFrame : public DS485Frame {


hooks/post-receive
-- 
digitalSTROM Server


More information about the dss-commits mailing list