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 LhxSensor.idl.
use strict;
package Raritan::RPC::lhxmodel::Sensor::NumThresholds;
sub encode {
my ($in) = @_;
my $encoded = {};
$encoded->{'lowerCriticalIsEnabled'} = ($in->{'lowerCriticalIsEnabled'}) ? JSON::true : JSON::false;
$encoded->{'lowerCritical'} = 1 * $in->{'lowerCritical'};
$encoded->{'lowerWarningIsEnabled'} = ($in->{'lowerWarningIsEnabled'}) ? JSON::true : JSON::false;
$encoded->{'lowerWarning'} = 1 * $in->{'lowerWarning'};
$encoded->{'upperWarningIsEnabled'} = ($in->{'upperWarningIsEnabled'}) ? JSON::true : JSON::false;
$encoded->{'upperWarning'} = 1 * $in->{'upperWarning'};
$encoded->{'upperCriticalIsEnabled'} = ($in->{'upperCriticalIsEnabled'}) ? JSON::true : JSON::false;
$encoded->{'upperCritical'} = 1 * $in->{'upperCritical'};
$encoded->{'hysteresis'} = 1 * $in->{'hysteresis'};
return $encoded;
}
sub decode {
my ($agent, $in) = @_;
my $decoded = {};
$decoded->{'lowerCriticalIsEnabled'} = ($in->{'lowerCriticalIsEnabled'}) ? 1 : 0;
$decoded->{'lowerCritical'} = $in->{'lowerCritical'};
$decoded->{'lowerWarningIsEnabled'} = ($in->{'lowerWarningIsEnabled'}) ? 1 : 0;
$decoded->{'lowerWarning'} = $in->{'lowerWarning'};
$decoded->{'upperWarningIsEnabled'} = ($in->{'upperWarningIsEnabled'}) ? 1 : 0;
$decoded->{'upperWarning'} = $in->{'upperWarning'};
$decoded->{'upperCriticalIsEnabled'} = ($in->{'upperCriticalIsEnabled'}) ? 1 : 0;
$decoded->{'upperCritical'} = $in->{'upperCritical'};
$decoded->{'hysteresis'} = $in->{'hysteresis'};
return $decoded;
}
1;
|