<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: device.proto

namespace OS\PB;

use UnexpectedValueException;

/**
 ** \@brief   Device Interfaces hardware enums
 *
 * Protobuf type <code>OS.PB.DeviceInterface</code>
 */
class DeviceInterface
{
    /**
     * Generated from protobuf enum <code>DeviceInterface_NotSet = 0;</code>
     */
    const DeviceInterface_NotSet = 0;
    /**
     * Relay - output only
     *
     * Generated from protobuf enum <code>DeviceInterface_Relay = 1;</code>
     */
    const DeviceInterface_Relay = 1;
    /**
     * Wiegand interface - Inputs D0, D1. Outputs Red, Green, Buz
     *
     * Generated from protobuf enum <code>DeviceInterface_Wiegand = 2;</code>
     */
    const DeviceInterface_Wiegand = 2;
    /**
     * Digital Input with EOL sensing
     *
     * Generated from protobuf enum <code>DeviceInterface_Input = 3;</code>
     */
    const DeviceInterface_Input = 3;
    /**
     * RF receiver IC with DataOut and RSSI analog output for Sherlo Remotes
     *
     * Generated from protobuf enum <code>DeviceInterface_CodeHop = 4;</code>
     */
    const DeviceInterface_CodeHop = 4;
    /**
     * I2C interface with 5V for some kind of expansion (solar charger for example)
     *
     * Generated from protobuf enum <code>DeviceInterface_Expansion = 5;</code>
     */
    const DeviceInterface_Expansion = 5;
    /**
     * LEDs that can be controlled like RGB etc
     *
     * Generated from protobuf enum <code>DeviceInterface_LED = 6;</code>
     */
    const DeviceInterface_LED = 6;
    /**
     * The power input or output, such as solar or PSU
     *
     * Generated from protobuf enum <code>DeviceInterface_Power = 7;</code>
     */
    const DeviceInterface_Power = 7;
    /**
     * Networkable: Half Duplex common mode bus up to 1Mbit
     *
     * Generated from protobuf enum <code>DeviceInterface_RS485 = 8;</code>
     */
    const DeviceInterface_RS485 = 8;
    /**
     * Networkable: BlueTooth standard 1Mbps or long range coded
     *
     * Generated from protobuf enum <code>DeviceInterface_BLE = 9;</code>
     */
    const DeviceInterface_BLE = 9;
    /**
     *DeviceInterface_BLELongRange    = 10; // DEPRECATED in making BLE common for both
     *
     * Generated from protobuf enum <code>DeviceInterface_Output = 10;</code>
     */
    const DeviceInterface_Output = 10;
    /**
     * Networkable: IPv4 over LTE/GSM
     *
     * Generated from protobuf enum <code>DeviceInterface_Modem = 11;</code>
     */
    const DeviceInterface_Modem = 11;
    /**
     * Networkable: IPv4 or IPv6
     *
     * Generated from protobuf enum <code>DeviceInterface_Ethernet = 12;</code>
     */
    const DeviceInterface_Ethernet = 12;
    /**
     * Networkable: IPv4 or IPv6 over WiFi 2.4GHz or 5GHz
     *
     * Generated from protobuf enum <code>DeviceInterface_WiFi = 13;</code>
     */
    const DeviceInterface_WiFi = 13;
    /**
     * DeviceInterface_WiFi5G          = 14; // DEPRECATED IPv4 or IPv6 - specific to 5GHz WiFi
     *
     * Generated from protobuf enum <code>DeviceInterface_RF868 = 15;</code>
     */
    const DeviceInterface_RF868 = 15;

    private static $valueToName = [
        self::DeviceInterface_NotSet => 'DeviceInterface_NotSet',
        self::DeviceInterface_Relay => 'DeviceInterface_Relay',
        self::DeviceInterface_Wiegand => 'DeviceInterface_Wiegand',
        self::DeviceInterface_Input => 'DeviceInterface_Input',
        self::DeviceInterface_CodeHop => 'DeviceInterface_CodeHop',
        self::DeviceInterface_Expansion => 'DeviceInterface_Expansion',
        self::DeviceInterface_LED => 'DeviceInterface_LED',
        self::DeviceInterface_Power => 'DeviceInterface_Power',
        self::DeviceInterface_RS485 => 'DeviceInterface_RS485',
        self::DeviceInterface_BLE => 'DeviceInterface_BLE',
        self::DeviceInterface_Output => 'DeviceInterface_Output',
        self::DeviceInterface_Modem => 'DeviceInterface_Modem',
        self::DeviceInterface_Ethernet => 'DeviceInterface_Ethernet',
        self::DeviceInterface_WiFi => 'DeviceInterface_WiFi',
        self::DeviceInterface_RF868 => 'DeviceInterface_RF868',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

