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

Method RequestValue

cpp/src/command_classes/ThermostatSetpoint.cpp:145–188  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Request current state from the device -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

143// Request current state from the device
144//-----------------------------------------------------------------------------
145bool ThermostatSetpoint::RequestValue
146(
147 uint32 const _requestFlags,
148 uint16 const _setPointIndex,
149 uint8 const _instance,
150 Driver::MsgQueue const _queue
151)
152{
153 if( _setPointIndex == 0xff ) // check for supportedget
154 {
155 // Request the supported setpoints
156 Msg* msg = new Msg( "ThermostatSetpointCmd_SupportedGet", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
157 msg->SetInstance( this, _instance );
158 msg->Append( GetNodeId() );
159 msg->Append( 2 );
160 msg->Append( GetCommandClassId() );
161 msg->Append( ThermostatSetpointCmd_SupportedGet );
162 msg->Append( GetDriver()->GetTransmitOptions() );
163 GetDriver()->SendMsg( msg, _queue );
164 return true;
165 }
166 if ( !m_com.GetFlagBool(COMPAT_FLAG_GETSUPPORTED) )
167 {
168 Log::Write( LogLevel_Info, GetNodeId(), "ThermostatSetpointCmd_Get Not Supported on this node");
169 return false;
170 }
171 Value* value = GetValue( 1, _setPointIndex );
172 if( value != NULL )
173 {
174 value->Release();
175 // Request the setpoint value
176 Msg* msg = new Msg( "ThermostatSetpointCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
177 msg->SetInstance( this, _instance );
178 msg->Append( GetNodeId() );
179 msg->Append( 3 );
180 msg->Append( GetCommandClassId() );
181 msg->Append( ThermostatSetpointCmd_Get );
182 msg->Append( (_setPointIndex & 0xFF) );
183 msg->Append( GetDriver()->GetTransmitOptions() );
184 GetDriver()->SendMsg( msg, _queue );
185 return true;
186 }
187 return false;
188}
189
190//-----------------------------------------------------------------------------
191// <ThermostatSetpoint::HandleMsg>

Callers

nothing calls this directly

Calls 8

GetCommandClassIdFunction · 0.85
WriteFunction · 0.85
SendMsgMethod · 0.80
GetFlagBoolMethod · 0.80
GetNodeIdFunction · 0.70
SetInstanceMethod · 0.45
AppendMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected