1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright 2020 Raritan Inc. All rights reserved.
#
# This file was generated by IdlC from Pdu.idl.
use strict;
package Raritan::RPC::pdumodel::Pdu_1_2_1::MetaData;
use Raritan::RPC::pdumodel::Nameplate;
sub encode {
my ($in) = @_;
my $encoded = {};
$encoded->{'nameplate'} = Raritan::RPC::pdumodel::Nameplate::encode($in->{'nameplate'});
$encoded->{'ctrlBoardSerial'} = "$in->{'ctrlBoardSerial'}";
$encoded->{'hwRevision'} = "$in->{'hwRevision'}";
$encoded->{'fwRevision'} = "$in->{'fwRevision'}";
$encoded->{'macAddress'} = "$in->{'macAddress'}";
$encoded->{'hasSwitchableOutlets'} = ($in->{'hasSwitchableOutlets'}) ? JSON::true : JSON::false;
$encoded->{'hasMeteredOutlets'} = ($in->{'hasMeteredOutlets'}) ? JSON::true : JSON::false;
$encoded->{'isInlineMeter'} = ($in->{'isInlineMeter'}) ? JSON::true : JSON::false;
return $encoded;
}
sub decode {
my ($agent, $in) = @_;
my $decoded = {};
$decoded->{'nameplate'} = Raritan::RPC::pdumodel::Nameplate::decode($agent, $in->{'nameplate'});
$decoded->{'ctrlBoardSerial'} = $in->{'ctrlBoardSerial'};
$decoded->{'hwRevision'} = $in->{'hwRevision'};
$decoded->{'fwRevision'} = $in->{'fwRevision'};
$decoded->{'macAddress'} = $in->{'macAddress'};
$decoded->{'hasSwitchableOutlets'} = ($in->{'hasSwitchableOutlets'}) ? 1 : 0;
$decoded->{'hasMeteredOutlets'} = ($in->{'hasMeteredOutlets'}) ? 1 : 0;
$decoded->{'isInlineMeter'} = ($in->{'isInlineMeter'}) ? 1 : 0;
return $decoded;
}
1;
|