Loading...
Searching...
No Matches
Ade.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2011 Raritan Inc. All rights reserved.
*/
#ifndef __PDUMODEL_ADE_IDL__
#define __PDUMODEL_ADE_IDL__
/**
* PDU Model
*/
module pdumodel {
/** Interface for ADE chips directly connected to main controller */
interface Ade {
/** ADE metadata */
structure MetaData {
string adeType; ///< ADE chip model
int channels; ///< Number of channels
double currentDivider; ///< Divider for converting raw readings to Amperes
double voltageDivider; ///< Divider for converting raw readings to Volts
double energyDivider; ///< Divider for converting raw readings to Wh/VAh
};
/** Raw sample data for a single channel */
structure Sample {
long vrms; ///< RMS voltage
long irms; ///< RMS current
long watt; ///< Active power
long va; ///< Apparent power
long wh; ///< Active energy (for this sample)
long vah; ///< Apparent energy (for this sample)
};
/** Map of ADE register values */
typedef map<string, long> RegisterMap;
/**
* Retrieve the ADE metadata.
*
* @return ADE metadata
*/
MetaData getMetaData();
/**
* Retrieve the latest raw samples.
*
* @return Vector of samples, one for each channel
*/
vector<Sample> getLatestSample();
/**
* Retrieve the values of all supported calibration registers.
*
* @return Map of calibration register values
*/
RegisterMap getCalibrationData();
/**
* Set new values for some or all calibration registers.
*
* @note This command is only available during manufacturing!
*
* @param regs Map of new calibration register values
*
* @return 0 if OK
* @return 1 if any parameters are invalid
* @return 2 if the device is not in factory configuration mode
*/
int setCalibrationData(in RegisterMap regs);
};
}
#endif
pdumodel::Ade
Interface for ADE chips directly connected to main controller.
Definition Ade.idl:15
pdumodel::Ade::getMetaData
MetaData getMetaData()
Retrieve the ADE metadata.
pdumodel::Ade::RegisterMap
map< string, long > RegisterMap
Map of ADE register values.
Definition Ade.idl:37
pdumodel::Ade::setCalibrationData
int setCalibrationData(in RegisterMap regs)
Set new values for some or all calibration registers.
pdumodel::Ade::getCalibrationData
RegisterMap getCalibrationData()
Retrieve the values of all supported calibration registers.
pdumodel::Ade::getLatestSample
vector< Sample > getLatestSample()
Retrieve the latest raw samples.
pdumodel
PDU Model.
Definition Ade.idl:12
pdumodel::Ade::MetaData
ADE metadata.
Definition Ade.idl:18
pdumodel::Ade::MetaData::channels
int channels
Number of channels.
Definition Ade.idl:20
pdumodel::Ade::MetaData::currentDivider
double currentDivider
Divider for converting raw readings to Amperes.
Definition Ade.idl:21
pdumodel::Ade::MetaData::voltageDivider
double voltageDivider
Divider for converting raw readings to Volts.
Definition Ade.idl:22
pdumodel::Ade::MetaData::adeType
string adeType
ADE chip model.
Definition Ade.idl:19
pdumodel::Ade::MetaData::energyDivider
double energyDivider
Divider for converting raw readings to Wh/VAh.
Definition Ade.idl:23
pdumodel::Ade::Sample
Raw sample data for a single channel.
Definition Ade.idl:27
pdumodel::Ade::Sample::va
long va
Apparent power.
Definition Ade.idl:31
pdumodel::Ade::Sample::irms
long irms
RMS current.
Definition Ade.idl:29
pdumodel::Ade::Sample::vrms
long vrms
RMS voltage.
Definition Ade.idl:28
pdumodel::Ade::Sample::wh
long wh
Active energy (for this sample)
Definition Ade.idl:32
pdumodel::Ade::Sample::vah
long vah
Apparent energy (for this sample)
Definition Ade.idl:33
pdumodel::Ade::Sample::watt
long watt
Active power.
Definition Ade.idl:30