----------------------------------------------------------------------------- Handle a message from the Z-Wave network -----------------------------------------------------------------------------
| 107 | // Handle a message from the Z-Wave network |
| 108 | //----------------------------------------------------------------------------- |
| 109 | bool Language::HandleMsg |
| 110 | ( |
| 111 | uint8 const* _data, |
| 112 | uint32 const _length, |
| 113 | uint32 const _instance // = 1 |
| 114 | ) |
| 115 | { |
| 116 | if( LanguageCmd_Report == (LanguageCmd)_data[0] ) |
| 117 | { |
| 118 | char language[4]; |
| 119 | char country[3]; |
| 120 | |
| 121 | language[0] = _data[1]; |
| 122 | language[1] = _data[2]; |
| 123 | language[2] = _data[3]; |
| 124 | language[3] = 0; |
| 125 | |
| 126 | country[0] = _data[4]; |
| 127 | country[1] = _data[5]; |
| 128 | country[2] = 0; |
| 129 | |
| 130 | Log::Write( LogLevel_Info, GetNodeId(), "Received Language report: Language=%s, Country=%s", language, country ); |
| 131 | ClearStaticRequest( StaticRequest_Values ); |
| 132 | |
| 133 | if( ValueString* languageValue = static_cast<ValueString*>( GetValue( _instance, LanguageIndex_Language ) ) ) |
| 134 | { |
| 135 | languageValue->OnValueRefreshed( language ); |
| 136 | languageValue->Release(); |
| 137 | } |
| 138 | if( ValueString* countryValue = static_cast<ValueString*>( GetValue( _instance, LanguageIndex_Country ) ) ) |
| 139 | { |
| 140 | countryValue->OnValueRefreshed( country ); |
| 141 | countryValue->Release(); |
| 142 | } |
| 143 | return true; |
| 144 | } |
| 145 | |
| 146 | return false; |
| 147 | } |
| 148 | |
| 149 | //----------------------------------------------------------------------------- |
| 150 | // <Language::CreateVars> |
nothing calls this directly
no test coverage detected