Raritan PX2/PX3 JSON-RPC API: pdu-json-rpc-api/idl/Ade.idl Source File

Raritan PX2/PX3 JSON-RPC API

Ade.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3 * Copyright 2011 Raritan Inc. All rights reserved.
4 */
5
6 #ifndef __PDUMODEL_ADE_IDL__
7 #define __PDUMODEL_ADE_IDL__
8
9 /**
10 * PDU Model
11 */
12 module pdumodel {
13
14 /** Interface for ADE chips directly connected to main controller */
15 interface Ade {
16
17 /** ADE metadata */
18 structure MetaData {
19 string adeType; ///< ADE chip model
20 int channels; ///< Number of channels
21 double currentDivider; ///< Divider for converting raw readings to Amperes
22 double voltageDivider; ///< Divider for converting raw readings to Volts
23 double energyDivider; ///< Divider for converting raw readings to Wh/VAh
24 };
25
26 /** Raw sample data for a single channel */
27 structure Sample {
28 long vrms; ///< RMS voltage
29 long irms; ///< RMS current
30 long watt; ///< Active power
31 long va; ///< Apparent power
32 long wh; ///< Active energy (for this sample)
33 long vah; ///< Apparent energy (for this sample)
34 };
35
36 /** Map of ADE register values */
37 typedef map<string, long> RegisterMap;
38
39 /**
40 * Retrieve the ADE metadata.
41 *
42 * @return ADE metadata
43 */
44 MetaData getMetaData();
45
46 /**
47 * Retrieve the latest raw samples.
48 *
49 * @return Vector of samples, one for each channel
50 */
51 vector<Sample> getLatestSample();
52
53 /**
54 * Retrieve the values of all supported calibration registers.
55 *
56 * @return Map of calibration register values
57 */
58 RegisterMap getCalibrationData();
59
60 /**
61 * Set new values for some or all calibration registers.
62 *
63 * @note This command is only available during manufacturing!
64 *
65 * @param regs Map of new calibration register values
66 *
67 * @return 0 if OK
68 * @return 1 if any parameters are invalid
69 * @return 2 if the device is not in factory configuration mode
70 */
71 int setCalibrationData(in RegisterMap regs);
72
73 };
74
75 }
76
77 #endif
pdumodel::Ade
Interface for ADE chips directly connected to main controller.
Definition: Ade.idl:15
pdumodel::Ade::MetaData::voltageDivider
double voltageDivider
Divider for converting raw readings to Volts.
Definition: Ade.idl:22
pdumodel::Ade::Sample::va
long va
Apparent power.
Definition: Ade.idl:31
pdumodel::Ade::Sample::vrms
long vrms
RMS voltage.
Definition: Ade.idl:28
pdumodel::Ade::MetaData::adeType
string adeType
ADE chip model.
Definition: Ade.idl:19
pdumodel::Ade::Sample
Raw sample data for a single channel.
Definition: Ade.idl:27
pdumodel::Ade::MetaData
ADE metadata.
Definition: Ade.idl:18
pdumodel::Ade::Sample::watt
long watt
Active power.
Definition: Ade.idl:30
pdumodel::Ade::RegisterMap
map< string, long > RegisterMap
Map of ADE register values.
Definition: Ade.idl:37
pdumodel::Ade::Sample::vah
long vah
Apparent energy (for this sample)
Definition: Ade.idl:33
pdumodel::Ade::Sample::wh
long wh
Active energy (for this sample)
Definition: Ade.idl:32
pdumodel::Ade::MetaData::channels
int channels
Number of channels.
Definition: Ade.idl:20
pdumodel
PDU Model.
Definition: Ade.idl:12
pdumodel::Ade::MetaData::currentDivider
double currentDivider
Divider for converting raw readings to Amperes.
Definition: Ade.idl:21
pdumodel::Ade::MetaData::energyDivider
double energyDivider
Divider for converting raw readings to Wh/VAh.
Definition: Ade.idl:23
pdumodel::Ade::Sample::irms
long irms
RMS current.
Definition: Ade.idl:29