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

git version control dss-commits at forum.digitalstrom.org
Thu Jan 21 11:20:12 CET 2010


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  5a1ac488291a974744f6cc828b4ec293af03021b (commit)
      from  b08a7e7698999e286bb3c03f7d5d17c901909be6 (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 5a1ac488291a974744f6cc828b4ec293af03021b
Author: Patrick Stählin <pstaehlin at futurelab.ch>
Date:   Thu Jan 21 11:16:42 2010 +0100

    Re-enabled ability to join the bus as fast device
    
    Use the property
    @/config/subsystems/DS485Proxy/denyJoiningAsShortDevice@ to disable that
    feature again if needed (for large installations).
    
    Fixes #271

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

Changes:
diff --git a/core/ds485/ds485.cpp b/core/ds485/ds485.cpp
index 733c70e..a74f081 100644
--- a/core/ds485/ds485.cpp
+++ b/core/ds485/ds485.cpp
@@ -154,7 +154,8 @@ namespace dss {
   DS485Controller::DS485Controller()
   : Thread("DS485Controller"),
     m_State(csInitial),
-    m_RS485DeviceName("/dev/ttyUSB0")
+    m_RS485DeviceName("/dev/ttyUSB0"),
+    m_DenyJoiningAsShortDevice(false)
   {
     m_DSID.upper = DSIDHeader;
     m_DSID.lower = 0xDEADBEEF;
@@ -384,7 +385,9 @@ namespace dss {
         case csSlaveWaitingToJoin:
           {
             if(cmdFrame != NULL) {
-              if(cmdFrame->getCommand() == CommandSolicitSuccessorRequestLong) {
+              bool isSolicitRequestLong = cmdFrame->getCommand() == CommandSolicitSuccessorRequestLong;
+              bool isSolicitRequestShort = cmdFrame->getCommand() == CommandSolicitSuccessorRequest;
+              if(isSolicitRequestLong || (isSolicitRequestShort && !m_DenyJoiningAsShortDevice)) {
                 // if it's the first of it's kind, determine how many we've got to skip
                 if(numberOfJoinPacketsToWait == -1) {
                   if(cmdFrame->getCommand() == CommandSolicitSuccessorRequest) {
diff --git a/core/ds485/ds485.h b/core/ds485/ds485.h
index e645325..bc70e0e 100644
--- a/core/ds485/ds485.h
+++ b/core/ds485/ds485.h
@@ -227,6 +227,7 @@ namespace dss {
     dsid_t m_DSID;
     typedef boost::function<void()> BusReadyCallback;
     BusReadyCallback m_BusReadyCallback;
+    bool m_DenyJoiningAsShortDevice;
   private:
     DS485Frame* getFrameFromWire();
     bool putFrameOnWire(const DS485Frame* _pFrame, bool _freeFrame = true);
@@ -261,6 +262,7 @@ namespace dss {
     void setDSID(const dsid_t& _value) { m_DSID = _value; }
 
     void setBusReadyCallback(BusReadyCallback _value) { m_BusReadyCallback = _value; }
+    void setDenyJoiningAsShortDevice(const bool _value) { m_DenyJoiningAsShortDevice = _value; }
   }; // DS485Controller
 
   class IDS485FrameCollector {
diff --git a/core/ds485/ds485proxy.cpp b/core/ds485/ds485proxy.cpp
index 352b911..1fe11ba 100644
--- a/core/ds485/ds485proxy.cpp
+++ b/core/ds485/ds485proxy.cpp
@@ -77,6 +77,7 @@ namespace dss {
             ->linkToProxy(PropertyProxyMemberFunction<DS485Controller, std::string>(m_DS485Controller, &DS485Controller::getStateAsString));
 
       _pDSS->getPropertySystem().setStringValue("/system/dsid", "3504175FE0000000DEADBEEF", true, false);
+      _pDSS->getPropertySystem().setBoolValue(getPropertyBasePath() + "denyJoiningAsShortDevice", false, true, false);
     }
   } // ctor
 
@@ -870,6 +871,7 @@ namespace dss {
   void DS485Proxy::doStart() {
     if(m_InitializeDS485Controller) {
       try {
+        m_DS485Controller.setDenyJoiningAsShortDevice(getDSS().getPropertySystem().getBoolValue(getConfigPropertyBasePath() + "denyJoiningAsShortDevice"));
         m_DS485Controller.setDSID(dsid_t::fromString(getDSS().getPropertySystem().getStringValue(getConfigPropertyBasePath() + "dsid")));
         m_DS485Controller.setBusReadyCallback(boost::bind(&DS485Proxy::busReady,this));
         m_DS485Controller.run();


hooks/post-receive
-- 
digitalSTROM Server


More information about the dss-commits mailing list