diff --git a/config/act/zir010.xml b/config/act/zir010.xml index 327cbb6c..a5996e15 100644 --- a/config/act/zir010.xml +++ b/config/act/zir010.xml @@ -1,18 +1,18 @@ - + - + - - + + - + diff --git a/config/aeon_labs/hem.xml b/config/aeon_labs/hem.xml new file mode 100644 index 00000000..31bc52b4 --- /dev/null +++ b/config/aeon_labs/hem.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/everspring/sm103.xml b/config/everspring/sm103.xml index 8b2cd209..956434fe 100644 --- a/config/everspring/sm103.xml +++ b/config/everspring/sm103.xml @@ -1,10 +1,10 @@ - + - + - Defines the level in the event sent when the sensor is triggered. Default is 99 (full brightness for a Z-Wave dimmer). + Defines the level in the event sent when the sensor is triggered. Default is 99 (full brightness for a Z-Wave dimmer). 100-127 will set device on to the last value it was when turned off. @@ -12,6 +12,11 @@ On Time sets the number of seconds the sensor stays alerted before the off event is sent. + + + Enable/Disable power saving mode. 0 enables. + + diff --git a/config/manufacturer_specific.xml b/config/manufacturer_specific.xml index b01b48e2..fc2fa882 100644 --- a/config/manufacturer_specific.xml +++ b/config/manufacturer_specific.xml @@ -30,7 +30,7 @@ - + @@ -101,6 +101,7 @@ + diff --git a/cpp/hidapi/linux/hid.c b/cpp/hidapi/linux/hid.c index 79a22c10..6e336766 100644 --- a/cpp/hidapi/linux/hid.c +++ b/cpp/hidapi/linux/hid.c @@ -43,6 +43,15 @@ #include "hidapi.h" +/* + * Added here until linux/hidraw.h has them. These definitions require a version + * 2.6.39 based kernel as well. + */ +#ifndef HIDIOCSFEATURE +#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len) +#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len) +#endif + struct hid_device_ { int device_handle; int blocking; diff --git a/cpp/src/Driver.cpp b/cpp/src/Driver.cpp index 5ce7adec..7f0542fb 100644 --- a/cpp/src/Driver.cpp +++ b/cpp/src/Driver.cpp @@ -778,6 +778,8 @@ void Driver::RemoveMsg ) { // get current message from the queue + if ( m_sendQueue.size() == 0 ) + return; m_sendMutex->Lock(); Msg *msg = m_sendQueue.front(); @@ -788,7 +790,7 @@ void Driver::RemoveMsg { // check to see if this is a "retry." If so, don't signal query stage complete Node* node = GetNodeUnsafe( nodeId ); - if( !node->m_queryRetries ) + if( node != NULL && !node->m_queryRetries ) { // look for more messages for this node in the send queue (to see if query stage is complete) bool bMoreForThisNode = false; @@ -2081,6 +2083,7 @@ void Driver::HandleRemoveNodeFromNetworkRequest case REMOVE_NODE_STATUS_LEARN_READY: { Log::Write( "REMOVE_NODE_STATUS_LEARN_READY" ); + m_controllerCommandNode = 0; if( m_controllerCallback ) { m_controllerCallback( ControllerState_Waiting, m_controllerCallbackContext ); @@ -2154,14 +2157,23 @@ void Driver::HandleRemoveNodeFromNetworkRequest { Log::Write( "REMOVE_NODE_STATUS_DONE" ); - Notification* notification = new Notification( Notification::Type_NodeRemoved ); - notification->SetHomeAndNodeIds( m_homeId, m_controllerCommandNode ); - QueueNotification( notification ); + if ( m_controllerCommandNode == 0 ) // never received "removing" update + { + if ( _data[4] != 0 ) // but message has the clue + m_controllerCommandNode = _data[4]; + } + + if ( m_controllerCommandNode != 0 ) + { + Notification* notification = new Notification( Notification::Type_NodeRemoved ); + notification->SetHomeAndNodeIds( m_homeId, m_controllerCommandNode ); + QueueNotification( notification ); - LockNodes(); - delete m_nodes[m_controllerCommandNode]; - m_nodes[m_controllerCommandNode] = NULL; - ReleaseNodes(); + LockNodes(); + delete m_nodes[m_controllerCommandNode]; + m_nodes[m_controllerCommandNode] = NULL; + ReleaseNodes(); + } if( m_controllerCallback ) { @@ -2687,14 +2699,6 @@ void Driver::CommonAddNodeStatusRequestHandler { Log::Write( "ADD_NODE_STATUS_DONE" ); - // not sure at this point what the extra two bytes after _data[3] are for... - // so far they're generally both 0x00. So flag with a log message if they aren't - // for diagnostic purposes - if( _data[4] || _data[5] ) - { - Log::Write( "WARNING: Unusual payload in response (usually 06 00 00)" ); - } - if( m_controllerCommandNode != 0xff ) InitNode( m_controllerCommandNode ); if( m_controllerCallback ) diff --git a/cpp/src/Group.cpp b/cpp/src/Group.cpp index 2043ab88..0a9cfab4 100644 --- a/cpp/src/Group.cpp +++ b/cpp/src/Group.cpp @@ -249,6 +249,14 @@ void Group::OnGroupChanged m_associations.clear(); notify = true; } + else + { + // Handle initial group creation case + if ( _associations.size() == 0 && m_associations.size() == 0 ) + { + notify = true; + } + } // Add the new associations. uint8 oldSize = (uint8)m_associations.size(); diff --git a/cpp/src/platform/unix/HidControllerImpl.cpp b/cpp/src/platform/unix/HidControllerImpl.cpp index b339a3e3..d1f2b386 100644 --- a/cpp/src/platform/unix/HidControllerImpl.cpp +++ b/cpp/src/platform/unix/HidControllerImpl.cpp @@ -226,7 +226,7 @@ uint32 HidControllerImpl::Read return 0; } -#ifdef DEBUG +#ifdef HIDDEBUG Log::Write("HID read requested %d", _length); #endif if ( m_hidFeatureReportReadBufferPtr == NULL ) @@ -238,7 +238,7 @@ uint32 HidControllerImpl::Read memset( m_hidFeatureReportReadBuffer, 0, PACKET_BUFFER_LENGTH ); m_hidFeatureReportReadBufferBytes = GetFeatureReport( FEATURE_REPORT_LENGTH, 0x5, m_hidFeatureReportReadBuffer ); CHECK_HIDAPI_RESULT( m_hidFeatureReportReadBufferBytes, HidPortError ); -#ifdef DEBUG +#ifdef HIDDEBUG char nstr[16]; snprintf( nstr, sizeof(nstr), "%d", m_hidFeatureReportReadBufferBytes ); string str = "HID read("; @@ -269,7 +269,7 @@ uint32 HidControllerImpl::Read m_hidFeatureReportReadBufferBytes -= _length; if ( m_hidFeatureReportReadBufferBytes == 0 ) m_hidFeatureReportReadBufferPtr = NULL; -#ifdef DEBUG +#ifdef HIDDEBUG Log::Write( "HID read returning %d", _length ); #endif return _length;