MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / HandleApplicationSlaveCommandRequest

Method HandleApplicationSlaveCommandRequest

cpp/src/Driver.cpp:6787–6818  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Process a request from the Z-Wave PC interface -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

6785// Process a request from the Z-Wave PC interface
6786//-----------------------------------------------------------------------------
6787void Driver::HandleApplicationSlaveCommandRequest
6788(
6789 uint8* _data
6790)
6791{
6792 Log::Write( LogLevel_Info, GetNodeNumber( m_currentMsg ), "APPLICATION_SLAVE_COMMAND_HANDLER rxStatus %x dest %d source %d len %d", _data[2], _data[3], _data[4], _data[5] );
6793 Node* node = GetNodeUnsafe( _data[4] );
6794 if( node != NULL && _data[5] == 3 && _data[6] == 0x20 && _data[7] == 0x01 ) // only support Basic Set for now
6795 {
6796 map<uint8,uint8>::iterator it = node->m_buttonMap.begin();
6797 for( ; it != node->m_buttonMap.end(); ++it )
6798 {
6799 if( it->second == _data[3] )
6800 break;
6801 }
6802 if( it != node->m_buttonMap.end() )
6803 {
6804 Notification *notification;
6805 if( _data[8] == 0 )
6806 {
6807 notification = new Notification( Notification::Type_ButtonOff );
6808 }
6809 else
6810 {
6811 notification = new Notification( Notification::Type_ButtonOn );
6812 }
6813 notification->SetHomeAndNodeIds( m_homeId, _data[4] );
6814 notification->SetButtonId( it->first );
6815 QueueNotification( notification );
6816 }
6817 }
6818}
6819
6820//-----------------------------------------------------------------------------
6821// <Driver::NodeFromMessage>

Callers

nothing calls this directly

Calls 3

WriteFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected