----------------------------------------------------------------------------- Request current value from the device -----------------------------------------------------------------------------
| 177 | // Request current value from the device |
| 178 | //----------------------------------------------------------------------------- |
| 179 | bool Meter::RequestValue |
| 180 | ( |
| 181 | uint32 const _requestFlags, |
| 182 | uint16 const _dummy1, // = 0 (not used) |
| 183 | uint8 const _instance, |
| 184 | Driver::MsgQueue const _queue |
| 185 | ) |
| 186 | { |
| 187 | bool res = false; |
| 188 | if ( !m_com.GetFlagBool(COMPAT_FLAG_GETSUPPORTED)) |
| 189 | { |
| 190 | Log::Write( LogLevel_Info, GetNodeId(), "MeterCmd_Get Not Supported on this node"); |
| 191 | return false; |
| 192 | } |
| 193 | for( uint8 i=0; i<8; ++i ) |
| 194 | { |
| 195 | uint8 baseIndex = i<<2; |
| 196 | |
| 197 | Value* value = GetValue( _instance, baseIndex ); |
| 198 | if( value != NULL ) |
| 199 | { |
| 200 | value->Release(); |
| 201 | Msg* msg = new Msg( "MeterCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() ); |
| 202 | msg->SetInstance( this, _instance ); |
| 203 | msg->Append( GetNodeId() ); |
| 204 | msg->Append( 3 ); |
| 205 | msg->Append( GetCommandClassId() ); |
| 206 | msg->Append( MeterCmd_Get ); |
| 207 | msg->Append( (uint8)( i << 3 ) ); |
| 208 | msg->Append( GetDriver()->GetTransmitOptions() ); |
| 209 | GetDriver()->SendMsg( msg, _queue ); |
| 210 | res |= true; |
| 211 | } |
| 212 | } |
| 213 | return res; |
| 214 | } |
| 215 | |
| 216 | //----------------------------------------------------------------------------- |
| 217 | // <Meter::HandleMsg> |
nothing calls this directly
no test coverage detected