<?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;

/**
 * Generated from protobuf message <code>OS.PB.DeviceRoute</code>
 */
class DeviceRoute extends \Google\Protobuf\Internal\Message
{
    /**
     * The fields below are required for both Direct and Indirect routes
     *
     * Generated from protobuf field <code>uint64 DeviceId = 1;</code>
     */
    protected $DeviceId = 0;
    /**
     * Which interface this route is to talk on, cannot be NotSet or on interfaces which are not networkable
     *
     * Generated from protobuf field <code>.OS.PB.DeviceInterface Interface = 2;</code>
     */
    protected $Interface = 0;
    /**
     * Usually 0 for the first interface, but if a device contains two or more of the same interface, then this must be specified
     *
     * Generated from protobuf field <code>uint32 InterfaceIndex = 3;</code>
     */
    protected $InterfaceIndex = 0;
    /**
     * See above enums
     *
     * Generated from protobuf field <code>.OS.PB.DeviceRouteFlags Flags = 5;</code>
     */
    protected $Flags = 0;
    /**
     * The Serial Address of the device to connect to  
     *
     * Generated from protobuf field <code>uint32 SerialAddress = 10;</code>
     */
    protected $SerialAddress = 0;
    protected $AddressType;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $DeviceId
     *           The fields below are required for both Direct and Indirect routes
     *     @type int $Interface
     *           Which interface this route is to talk on, cannot be NotSet or on interfaces which are not networkable
     *     @type int $InterfaceIndex
     *           Usually 0 for the first interface, but if a device contains two or more of the same interface, then this must be specified
     *     @type int $Flags
     *           See above enums
     *     @type int $SerialAddress
     *           The Serial Address of the device to connect to  
     *     @type \OS\PB\DeviceMQTTAddress $MQTTAddress
     *           MQTT connection to a broker 
     *     @type string $BTAddress
     *           Fixed (Public) BT Address assigned by Manufacturer (eg: NordicSemi)
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Device::initOnce();
        parent::__construct($data);
    }

    /**
     * The fields below are required for both Direct and Indirect routes
     *
     * Generated from protobuf field <code>uint64 DeviceId = 1;</code>
     * @return int|string
     */
    public function getDeviceId()
    {
        return $this->DeviceId;
    }

    /**
     * The fields below are required for both Direct and Indirect routes
     *
     * Generated from protobuf field <code>uint64 DeviceId = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setDeviceId($var)
    {
        GPBUtil::checkUint64($var);
        $this->DeviceId = $var;

        return $this;
    }

    /**
     * Which interface this route is to talk on, cannot be NotSet or on interfaces which are not networkable
     *
     * Generated from protobuf field <code>.OS.PB.DeviceInterface Interface = 2;</code>
     * @return int
     */
    public function getInterface()
    {
        return $this->Interface;
    }

    /**
     * Which interface this route is to talk on, cannot be NotSet or on interfaces which are not networkable
     *
     * Generated from protobuf field <code>.OS.PB.DeviceInterface Interface = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setInterface($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\DeviceInterface::class);
        $this->Interface = $var;

        return $this;
    }

    /**
     * Usually 0 for the first interface, but if a device contains two or more of the same interface, then this must be specified
     *
     * Generated from protobuf field <code>uint32 InterfaceIndex = 3;</code>
     * @return int
     */
    public function getInterfaceIndex()
    {
        return $this->InterfaceIndex;
    }

    /**
     * Usually 0 for the first interface, but if a device contains two or more of the same interface, then this must be specified
     *
     * Generated from protobuf field <code>uint32 InterfaceIndex = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setInterfaceIndex($var)
    {
        GPBUtil::checkUint32($var);
        $this->InterfaceIndex = $var;

        return $this;
    }

    /**
     * See above enums
     *
     * Generated from protobuf field <code>.OS.PB.DeviceRouteFlags Flags = 5;</code>
     * @return int
     */
    public function getFlags()
    {
        return $this->Flags;
    }

    /**
     * See above enums
     *
     * Generated from protobuf field <code>.OS.PB.DeviceRouteFlags Flags = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setFlags($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\DeviceRouteFlags::class);
        $this->Flags = $var;

        return $this;
    }

    /**
     * The Serial Address of the device to connect to  
     *
     * Generated from protobuf field <code>uint32 SerialAddress = 10;</code>
     * @return int
     */
    public function getSerialAddress()
    {
        return $this->SerialAddress;
    }

    /**
     * The Serial Address of the device to connect to  
     *
     * Generated from protobuf field <code>uint32 SerialAddress = 10;</code>
     * @param int $var
     * @return $this
     */
    public function setSerialAddress($var)
    {
        GPBUtil::checkUint32($var);
        $this->SerialAddress = $var;

        return $this;
    }

    /**
     * MQTT connection to a broker 
     *
     * Generated from protobuf field <code>.OS.PB.DeviceMQTTAddress MQTTAddress = 12;</code>
     * @return \OS\PB\DeviceMQTTAddress|null
     */
    public function getMQTTAddress()
    {
        return $this->readOneof(12);
    }

    public function hasMQTTAddress()
    {
        return $this->hasOneof(12);
    }

    /**
     * MQTT connection to a broker 
     *
     * Generated from protobuf field <code>.OS.PB.DeviceMQTTAddress MQTTAddress = 12;</code>
     * @param \OS\PB\DeviceMQTTAddress $var
     * @return $this
     */
    public function setMQTTAddress($var)
    {
        GPBUtil::checkMessage($var, \OS\PB\DeviceMQTTAddress::class);
        $this->writeOneof(12, $var);

        return $this;
    }

    /**
     * Fixed (Public) BT Address assigned by Manufacturer (eg: NordicSemi)
     *
     * Generated from protobuf field <code>bytes BTAddress = 13;</code>
     * @return string
     */
    public function getBTAddress()
    {
        return $this->readOneof(13);
    }

    public function hasBTAddress()
    {
        return $this->hasOneof(13);
    }

    /**
     * Fixed (Public) BT Address assigned by Manufacturer (eg: NordicSemi)
     *
     * Generated from protobuf field <code>bytes BTAddress = 13;</code>
     * @param string $var
     * @return $this
     */
    public function setBTAddress($var)
    {
        GPBUtil::checkString($var, False);
        $this->writeOneof(13, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getAddressType()
    {
        return $this->whichOneof("AddressType");
    }

}

