----------------------------------------------------------------------------- Handle a message from the Z-Wave network -----------------------------------------------------------------------------
| 117 | // Handle a message from the Z-Wave network |
| 118 | //----------------------------------------------------------------------------- |
| 119 | bool Clock::HandleMsg |
| 120 | ( |
| 121 | uint8 const* _data, |
| 122 | uint32 const _length, |
| 123 | uint32 const _instance // = 1 |
| 124 | ) |
| 125 | { |
| 126 | if (ClockCmd_Report == (ClockCmd)_data[0]) |
| 127 | { |
| 128 | uint8 day = _data[1] >> 5; |
| 129 | uint8 hour = _data[1] & 0x1f; |
| 130 | uint8 minute = _data[2]; |
| 131 | |
| 132 | if (day > 7) /* size of c_dayNames */ |
| 133 | { |
| 134 | Log::Write (LogLevel_Warning, GetNodeId(), "Day Value was greater than range. Setting to Invalid"); |
| 135 | day = 0; |
| 136 | } |
| 137 | |
| 138 | Log::Write( LogLevel_Info, GetNodeId(), "Received Clock report: %s %.2d:%.2d", c_dayNames[day], hour, minute ); |
| 139 | |
| 140 | |
| 141 | if( ValueList* dayValue = static_cast<ValueList*>( GetValue( _instance, ClockIndex_Day ) ) ) |
| 142 | { |
| 143 | dayValue->OnValueRefreshed( day ); |
| 144 | dayValue->Release(); |
| 145 | } |
| 146 | if( ValueByte* hourValue = static_cast<ValueByte*>( GetValue( _instance, ClockIndex_Hour ) ) ) |
| 147 | { |
| 148 | hourValue->OnValueRefreshed( hour ); |
| 149 | hourValue->Release(); |
| 150 | } |
| 151 | if( ValueByte* minuteValue = static_cast<ValueByte*>( GetValue( _instance, ClockIndex_Minute ) ) ) |
| 152 | { |
| 153 | minuteValue->OnValueRefreshed( minute ); |
| 154 | minuteValue->Release(); |
| 155 | } |
| 156 | return true; |
| 157 | } |
| 158 | |
| 159 | return false; |
| 160 | } |
| 161 | |
| 162 | //----------------------------------------------------------------------------- |
| 163 | // <Clock::SetValue> |
nothing calls this directly
no test coverage detected