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

use strict;

package Raritan::RPC::net::WlanSettings;

use Raritan::RPC::net::EapAuthSettings;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'enableHT'} = ($in->{'enableHT'}) ? JSON::true : JSON::false;
    $encoded->{'ssid'} = "$in->{'ssid'}";
    $encoded->{'bssid'} = "$in->{'bssid'}";
    $encoded->{'secProtocol'} = 1 * $in->{'secProtocol'};
    $encoded->{'authType'} = 1 * $in->{'authType'};
    $encoded->{'psk'} = "$in->{'psk'}";
    $encoded->{'clearPsk'} = ($in->{'clearPsk'}) ? JSON::true : JSON::false;
    $encoded->{'eap'} = Raritan::RPC::net::EapAuthSettings::encode($in->{'eap'});
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'enableHT'} = ($in->{'enableHT'}) ? 1 : 0;
    $decoded->{'ssid'} = $in->{'ssid'};
    $decoded->{'bssid'} = $in->{'bssid'};
    $decoded->{'secProtocol'} = $in->{'secProtocol'};
    $decoded->{'authType'} = $in->{'authType'};
    $decoded->{'psk'} = $in->{'psk'};
    $decoded->{'clearPsk'} = ($in->{'clearPsk'}) ? 1 : 0;
    $decoded->{'eap'} = Raritan::RPC::net::EapAuthSettings::decode($agent, $in->{'eap'});
    return $decoded;
}

1;
