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

namespace OS\PB;

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

/**
 ** \@brief Basic configuration for networkable interfaces
 *         To be included as part of the interface's config (eg: RS485Config)
 *
 * Generated from protobuf message <code>OS.PB.DeviceNetworkConfig</code>
 */
class DeviceNetworkConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Default: True. This device will watch for advertisement packet types and generate DeviceDiscoveryEvent if detected as new.
     *
     * Generated from protobuf field <code>bool ObserverRole = 1;</code>
     */
    protected $ObserverRole = false;
    /**
     * Default: 86400 seconds. How long until the device re-discovers a device that is advertising.
     *
     * Generated from protobuf field <code>uint32 DiscoveryIgnoreDuration = 2;</code>
     */
    protected $DiscoveryIgnoreDuration = 0;
    /**
     * Default: 15 seconds. How often an advertisement will be sent out or keep connections alive if no data has been sent.
     *
     * Generated from protobuf field <code>uint32 KeepAlive = 3;</code>
     */
    protected $KeepAlive = 0;
    /**
     * Default: 60 seconds. How long until a device disconnected event is generated when using ObserverRole
     *
     * Generated from protobuf field <code>uint32 OfflineTimeout = 4;</code>
     */
    protected $OfflineTimeout = 0;
    /**
     * Default: 1, 5, 30, 60, 300. How long to hold off before reattempting a connectiion
     *
     * Generated from protobuf field <code>repeated uint32 ReconnectHoldOffs = 5;</code>
     */
    private $ReconnectHoldOffs;
    /**
     * Default: 1000ms. How long to wait until resending a packet, which increases the redelivery counter. 
     *
     * Generated from protobuf field <code>uint32 ResponseTimeoutMs = 6;</code>
     */
    protected $ResponseTimeoutMs = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $ObserverRole
     *           Default: True. This device will watch for advertisement packet types and generate DeviceDiscoveryEvent if detected as new.
     *     @type int $DiscoveryIgnoreDuration
     *           Default: 86400 seconds. How long until the device re-discovers a device that is advertising.
     *     @type int $KeepAlive
     *           Default: 15 seconds. How often an advertisement will be sent out or keep connections alive if no data has been sent.
     *     @type int $OfflineTimeout
     *           Default: 60 seconds. How long until a device disconnected event is generated when using ObserverRole
     *     @type int[] $ReconnectHoldOffs
     *           Default: 1, 5, 30, 60, 300. How long to hold off before reattempting a connectiion
     *     @type int $ResponseTimeoutMs
     *           Default: 1000ms. How long to wait until resending a packet, which increases the redelivery counter. 
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Device::initOnce();
        parent::__construct($data);
    }

    /**
     * Default: True. This device will watch for advertisement packet types and generate DeviceDiscoveryEvent if detected as new.
     *
     * Generated from protobuf field <code>bool ObserverRole = 1;</code>
     * @return bool
     */
    public function getObserverRole()
    {
        return $this->ObserverRole;
    }

    /**
     * Default: True. This device will watch for advertisement packet types and generate DeviceDiscoveryEvent if detected as new.
     *
     * Generated from protobuf field <code>bool ObserverRole = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setObserverRole($var)
    {
        GPBUtil::checkBool($var);
        $this->ObserverRole = $var;

        return $this;
    }

    /**
     * Default: 86400 seconds. How long until the device re-discovers a device that is advertising.
     *
     * Generated from protobuf field <code>uint32 DiscoveryIgnoreDuration = 2;</code>
     * @return int
     */
    public function getDiscoveryIgnoreDuration()
    {
        return $this->DiscoveryIgnoreDuration;
    }

    /**
     * Default: 86400 seconds. How long until the device re-discovers a device that is advertising.
     *
     * Generated from protobuf field <code>uint32 DiscoveryIgnoreDuration = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setDiscoveryIgnoreDuration($var)
    {
        GPBUtil::checkUint32($var);
        $this->DiscoveryIgnoreDuration = $var;

        return $this;
    }

    /**
     * Default: 15 seconds. How often an advertisement will be sent out or keep connections alive if no data has been sent.
     *
     * Generated from protobuf field <code>uint32 KeepAlive = 3;</code>
     * @return int
     */
    public function getKeepAlive()
    {
        return $this->KeepAlive;
    }

    /**
     * Default: 15 seconds. How often an advertisement will be sent out or keep connections alive if no data has been sent.
     *
     * Generated from protobuf field <code>uint32 KeepAlive = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setKeepAlive($var)
    {
        GPBUtil::checkUint32($var);
        $this->KeepAlive = $var;

        return $this;
    }

    /**
     * Default: 60 seconds. How long until a device disconnected event is generated when using ObserverRole
     *
     * Generated from protobuf field <code>uint32 OfflineTimeout = 4;</code>
     * @return int
     */
    public function getOfflineTimeout()
    {
        return $this->OfflineTimeout;
    }

    /**
     * Default: 60 seconds. How long until a device disconnected event is generated when using ObserverRole
     *
     * Generated from protobuf field <code>uint32 OfflineTimeout = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setOfflineTimeout($var)
    {
        GPBUtil::checkUint32($var);
        $this->OfflineTimeout = $var;

        return $this;
    }

    /**
     * Default: 1, 5, 30, 60, 300. How long to hold off before reattempting a connectiion
     *
     * Generated from protobuf field <code>repeated uint32 ReconnectHoldOffs = 5;</code>
     * @return RepeatedField<int>
     */
    public function getReconnectHoldOffs()
    {
        return $this->ReconnectHoldOffs;
    }

    /**
     * Default: 1, 5, 30, 60, 300. How long to hold off before reattempting a connectiion
     *
     * Generated from protobuf field <code>repeated uint32 ReconnectHoldOffs = 5;</code>
     * @param int[] $var
     * @return $this
     */
    public function setReconnectHoldOffs($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::UINT32);
        $this->ReconnectHoldOffs = $arr;

        return $this;
    }

    /**
     * Default: 1000ms. How long to wait until resending a packet, which increases the redelivery counter. 
     *
     * Generated from protobuf field <code>uint32 ResponseTimeoutMs = 6;</code>
     * @return int
     */
    public function getResponseTimeoutMs()
    {
        return $this->ResponseTimeoutMs;
    }

    /**
     * Default: 1000ms. How long to wait until resending a packet, which increases the redelivery counter. 
     *
     * Generated from protobuf field <code>uint32 ResponseTimeoutMs = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setResponseTimeoutMs($var)
    {
        GPBUtil::checkUint32($var);
        $this->ResponseTimeoutMs = $var;

        return $this;
    }

}

