----------------------------------------------------------------------------- Gets a value as an 8-bit unsigned integer -----------------------------------------------------------------------------
| 2165 | // Gets a value as an 8-bit unsigned integer |
| 2166 | //----------------------------------------------------------------------------- |
| 2167 | bool Manager::GetValueAsByte |
| 2168 | ( |
| 2169 | ValueID const& _id, |
| 2170 | uint8* o_value |
| 2171 | ) |
| 2172 | { |
| 2173 | bool res = false; |
| 2174 | |
| 2175 | if( o_value ) |
| 2176 | { |
| 2177 | if( ValueID::ValueType_Byte == _id.GetType() ) |
| 2178 | { |
| 2179 | if( Driver* driver = GetDriver( _id.GetHomeId() ) ) |
| 2180 | { |
| 2181 | LockGuard LG(driver->m_nodeMutex); |
| 2182 | if( ValueByte* value = static_cast<ValueByte*>( driver->GetValue( _id ) ) ) |
| 2183 | { |
| 2184 | *o_value = value->GetValue(); |
| 2185 | value->Release(); |
| 2186 | res = true; |
| 2187 | } else { |
| 2188 | OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "Invalid ValueID passed to GetValueAsByte"); |
| 2189 | } |
| 2190 | } |
| 2191 | } else { |
| 2192 | OZW_ERROR(OZWException::OZWEXCEPTION_CANNOT_CONVERT_VALUEID, "ValueID passed to GetValueAsByte is not a Byte Value"); |
| 2193 | } |
| 2194 | } |
| 2195 | |
| 2196 | return res; |
| 2197 | } |
| 2198 | |
| 2199 | //----------------------------------------------------------------------------- |
| 2200 | // <Manager::GetValueAsFloat> |