# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright 2023 Raritan Inc. All rights reserved.
#
# This file was generated by IdlC from GatewaySensorManager.idl.

use strict;

package Raritan::RPC::peripheral::GatewaySensorManager::NumericValueEncoding;

use constant typeId => "peripheral.GatewaySensorManager.NumericValueEncoding:1.0.0";
use Raritan::RPC::peripheral::GatewaySensorManager::ValueEncoding;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::peripheral::GatewaySensorManager::ValueEncoding::encode($in);
    $encoded->{'scalingFactor'} = 1 * $in->{'scalingFactor'};
    $encoded->{'offset'} = 1 * $in->{'offset'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::peripheral::GatewaySensorManager::ValueEncoding::decode($agent, $in);
    $decoded->{'scalingFactor'} = $in->{'scalingFactor'};
    $decoded->{'offset'} = $in->{'offset'};
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('peripheral.GatewaySensorManager.NumericValueEncoding', 1, 0, 0, 'Raritan::RPC::peripheral::GatewaySensorManager::NumericValueEncoding');
1;
