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

use strict;

package Raritan::RPC::peripheral::ModbusCfg::SerialSettings;


sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'baud'} = 1 * $in->{'baud'};
    $encoded->{'parity'} = 1 * $in->{'parity'};
    $encoded->{'dataBits'} = 1 * $in->{'dataBits'};
    $encoded->{'stopBits'} = 1 * $in->{'stopBits'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'baud'} = $in->{'baud'};
    $decoded->{'parity'} = $in->{'parity'};
    $decoded->{'dataBits'} = $in->{'dataBits'};
    $decoded->{'stopBits'} = $in->{'stopBits'};
    return $decoded;
}

1;
