package net.northking.cctp.upperComputer.driver.harmony.hdc;

/**
 * HDC设备连接方式
 */
public enum HDCConnectType {
    /**
     * TCP网络协议连接
     */
    TCP,

    /**
     * USB通用串口方式连接
     */
    USB,

    /**
     * 传统串口方式连接
     */
    UART,

    /**
     * 未知方式连接，需要进行程序补充
     */
    UNKNOWN;

    public static HDCConnectType getConnectType(String type) {
        HDCConnectType hdcConnectType = null;
        switch (type.toUpperCase()) {
            case "TCP" :
                hdcConnectType = TCP;
                break;
            case "USB" :
                hdcConnectType = USB;
                break;
            case "UART" :
                hdcConnectType = UART;
                break;
            default :
                hdcConnectType = UNKNOWN;
                break;
        }
        return hdcConnectType;
    }
}
