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

namespace OS\PB;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 ** \@brief   Configures the Wiegand Interface and keypad functionality, if any.
 *
 * Generated from protobuf message <code>OS.PB.WiegandConfig</code>
 */
class WiegandConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Default: Enabled. Whether the Wiegand interface is enabled or disabled.
     *
     * Generated from protobuf field <code>.OS.PB.Toggle State = 1;</code>
     */
    protected $State = 0;
    /**
     * Default: 50ms. How long to wait after the last bit was received before checking the wiegand raw code.
     *
     * Generated from protobuf field <code>uint32 WaitPeriodMs = 2;</code>
     */
    protected $WaitPeriodMs = 0;
    /**
     * Default: Disabled. If Enabled, then D0 and D1 data is swapped, meaning D0 becomes D1 and D1 becomes D0. This is useful if D0/D1 were reversed during installation.
     *
     * Generated from protobuf field <code>.OS.PB.Toggle SwapDataLines = 3;</code>
     */
    protected $SwapDataLines = 0;
    /**
     * Default: 4s. Prevents duplicate Wiegand Raw Code events being generated if the same Wiegand Raw Code was received.
     *
     * Generated from protobuf field <code>uint32 SameRawCodeTimeout = 4;</code>
     */
    protected $SameRawCodeTimeout = 0;
    /**
     * refer above 
     *
     * Generated from protobuf field <code>.OS.PB.WiegandConfig.KeypadModes KeypadMode = 8;</code>
     */
    protected $KeypadMode = 0;
    /**
     * Default 6: Valid only if keypad mode is not disabled, allows a certain number of digits permitted. 
     *
     * Generated from protobuf field <code>uint32 KeypadDigits = 9;</code>
     */
    protected $KeypadDigits = 0;
    /**
     * Default 4s: Timeout in seconds to reset keys already entered. 0 for no change from previous value
     *
     * Generated from protobuf field <code>uint32 KeypadResetTimeout = 10;</code>
     */
    protected $KeypadResetTimeout = 0;
    /**
     * refer above
     *
     * Generated from protobuf field <code>.OS.PB.WiegandConfig.LineModes LineMode = 13;</code>
     */
    protected $LineMode = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $State
     *           Default: Enabled. Whether the Wiegand interface is enabled or disabled.
     *     @type int $WaitPeriodMs
     *           Default: 50ms. How long to wait after the last bit was received before checking the wiegand raw code.
     *     @type int $SwapDataLines
     *           Default: Disabled. If Enabled, then D0 and D1 data is swapped, meaning D0 becomes D1 and D1 becomes D0. This is useful if D0/D1 were reversed during installation.
     *     @type int $SameRawCodeTimeout
     *           Default: 4s. Prevents duplicate Wiegand Raw Code events being generated if the same Wiegand Raw Code was received.
     *     @type int $KeypadMode
     *           refer above 
     *     @type int $KeypadDigits
     *           Default 6: Valid only if keypad mode is not disabled, allows a certain number of digits permitted. 
     *     @type int $KeypadResetTimeout
     *           Default 4s: Timeout in seconds to reset keys already entered. 0 for no change from previous value
     *     @type int $LineMode
     *           refer above
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Wiegand::initOnce();
        parent::__construct($data);
    }

    /**
     * Default: Enabled. Whether the Wiegand interface is enabled or disabled.
     *
     * Generated from protobuf field <code>.OS.PB.Toggle State = 1;</code>
     * @return int
     */
    public function getState()
    {
        return $this->State;
    }

    /**
     * Default: Enabled. Whether the Wiegand interface is enabled or disabled.
     *
     * Generated from protobuf field <code>.OS.PB.Toggle State = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\Toggle::class);
        $this->State = $var;

        return $this;
    }

    /**
     * Default: 50ms. How long to wait after the last bit was received before checking the wiegand raw code.
     *
     * Generated from protobuf field <code>uint32 WaitPeriodMs = 2;</code>
     * @return int
     */
    public function getWaitPeriodMs()
    {
        return $this->WaitPeriodMs;
    }

    /**
     * Default: 50ms. How long to wait after the last bit was received before checking the wiegand raw code.
     *
     * Generated from protobuf field <code>uint32 WaitPeriodMs = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setWaitPeriodMs($var)
    {
        GPBUtil::checkUint32($var);
        $this->WaitPeriodMs = $var;

        return $this;
    }

    /**
     * Default: Disabled. If Enabled, then D0 and D1 data is swapped, meaning D0 becomes D1 and D1 becomes D0. This is useful if D0/D1 were reversed during installation.
     *
     * Generated from protobuf field <code>.OS.PB.Toggle SwapDataLines = 3;</code>
     * @return int
     */
    public function getSwapDataLines()
    {
        return $this->SwapDataLines;
    }

    /**
     * Default: Disabled. If Enabled, then D0 and D1 data is swapped, meaning D0 becomes D1 and D1 becomes D0. This is useful if D0/D1 were reversed during installation.
     *
     * Generated from protobuf field <code>.OS.PB.Toggle SwapDataLines = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setSwapDataLines($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\Toggle::class);
        $this->SwapDataLines = $var;

        return $this;
    }

    /**
     * Default: 4s. Prevents duplicate Wiegand Raw Code events being generated if the same Wiegand Raw Code was received.
     *
     * Generated from protobuf field <code>uint32 SameRawCodeTimeout = 4;</code>
     * @return int
     */
    public function getSameRawCodeTimeout()
    {
        return $this->SameRawCodeTimeout;
    }

    /**
     * Default: 4s. Prevents duplicate Wiegand Raw Code events being generated if the same Wiegand Raw Code was received.
     *
     * Generated from protobuf field <code>uint32 SameRawCodeTimeout = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setSameRawCodeTimeout($var)
    {
        GPBUtil::checkUint32($var);
        $this->SameRawCodeTimeout = $var;

        return $this;
    }

    /**
     * refer above 
     *
     * Generated from protobuf field <code>.OS.PB.WiegandConfig.KeypadModes KeypadMode = 8;</code>
     * @return int
     */
    public function getKeypadMode()
    {
        return $this->KeypadMode;
    }

    /**
     * refer above 
     *
     * Generated from protobuf field <code>.OS.PB.WiegandConfig.KeypadModes KeypadMode = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setKeypadMode($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\WiegandConfig\KeypadModes::class);
        $this->KeypadMode = $var;

        return $this;
    }

    /**
     * Default 6: Valid only if keypad mode is not disabled, allows a certain number of digits permitted. 
     *
     * Generated from protobuf field <code>uint32 KeypadDigits = 9;</code>
     * @return int
     */
    public function getKeypadDigits()
    {
        return $this->KeypadDigits;
    }

    /**
     * Default 6: Valid only if keypad mode is not disabled, allows a certain number of digits permitted. 
     *
     * Generated from protobuf field <code>uint32 KeypadDigits = 9;</code>
     * @param int $var
     * @return $this
     */
    public function setKeypadDigits($var)
    {
        GPBUtil::checkUint32($var);
        $this->KeypadDigits = $var;

        return $this;
    }

    /**
     * Default 4s: Timeout in seconds to reset keys already entered. 0 for no change from previous value
     *
     * Generated from protobuf field <code>uint32 KeypadResetTimeout = 10;</code>
     * @return int
     */
    public function getKeypadResetTimeout()
    {
        return $this->KeypadResetTimeout;
    }

    /**
     * Default 4s: Timeout in seconds to reset keys already entered. 0 for no change from previous value
     *
     * Generated from protobuf field <code>uint32 KeypadResetTimeout = 10;</code>
     * @param int $var
     * @return $this
     */
    public function setKeypadResetTimeout($var)
    {
        GPBUtil::checkUint32($var);
        $this->KeypadResetTimeout = $var;

        return $this;
    }

    /**
     * refer above
     *
     * Generated from protobuf field <code>.OS.PB.WiegandConfig.LineModes LineMode = 13;</code>
     * @return int
     */
    public function getLineMode()
    {
        return $this->LineMode;
    }

    /**
     * refer above
     *
     * Generated from protobuf field <code>.OS.PB.WiegandConfig.LineModes LineMode = 13;</code>
     * @param int $var
     * @return $this
     */
    public function setLineMode($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\WiegandConfig\LineModes::class);
        $this->LineMode = $var;

        return $this;
    }

}

