unit type in the API

Document created by cdnadmin on Jan 24, 2014
Version 1Show Document
  • View in full screen mode
This document was generated from CDN thread

Created by: Alka Malik on 20-04-2011 11:19:00 AM
What does the unit type returned from a API query represent,
EW_ATTRIBUTE_TYPE_UNITS is 1 byte, how should I interpret this number?
is it an enum? it is a char like 'W' (though empirical evidence does suggest this is not the case)
I see values of 0 and -3
 
 

Subject: RE: unit type in the API
Replied by: Brock Miller on 18-05-2011 08:09:11 PM
What does the unit type returned from a API query represent,
EW_ATTRIBUTE_TYPE_UNITS is 1 byte, how should I interpret this number?
is it an enum? it is a char like 'W' (though empirical evidence does suggest this is not the case)
I see values of 0 and -3
 
 

Hi Alka,
 
The EW_ATTRIBUTE_TYPE_UNITS field is an int8_t type representing the base SI units for Watts associated with the power usage value being reported.
 
For example, a value of -3 for units would mean that the usage value is being reported in milli-watts.
 
usage_val * 10^(units) = usage_in_watts
 
Hope that helps!
 
-Brock
 
 

Attachments

    Outcomes