package kr.co.icontrols.iotplatform.AWS;

import java.util.Objects;

public class AmazonWifiInfo {
    private static String[] NETWORK_TYPES = {"Open", "WEP", "WPA", "WPA2", "WPA2-Enterprise", "Other"};
    private String ssid;
    private byte[] bssid;
    private int rssi;
    private int networkType;
    private int index;
    private boolean connected;

    public String getNetworkTypeName() {
        return NETWORK_TYPES[networkType];
    }

    public AmazonWifiInfo(String ssid, byte[] bssid, int rssi, int networkType, int index, boolean connected) {
        this.ssid = ssid;
        this.bssid = bssid;
        this.rssi = rssi;
        this.networkType = networkType;
        this.index = index;
        this.connected = connected;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) return false;
        AmazonWifiInfo amazonWifiInfo = (AmazonWifiInfo) obj;
        return Objects.equals(amazonWifiInfo.getSsid(), ssid);
    }

    public static String[] getNetworkTypes() {
        return NETWORK_TYPES;
    }

    public static void setNetworkTypes(String[] networkTypes) {
        NETWORK_TYPES = networkTypes;
    }

    public String getSsid() {
        return ssid;
    }

    public void setSsid(String ssid) {
        this.ssid = ssid;
    }

    public byte[] getBssid() {
        return bssid;
    }

    public void setBssid(byte[] bssid) {
        this.bssid = bssid;
    }

    public int getRssi() {
        return rssi;
    }

    public void setRssi(int rssi) {
        this.rssi = rssi;
    }

    public int getNetworkType() {
        return networkType;
    }

    public void setNetworkType(int networkType) {
        this.networkType = networkType;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public boolean isConnected() {
        return connected;
    }

    public void setConnected(boolean connected) {
        this.connected = connected;
    }
}
