<?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.DeviceNetworkEvent</code>
 */
class DeviceNetworkEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * (Optional) The device Id of the networked device
     *
     * Generated from protobuf field <code>uint64 DeviceId = 1;</code>
     */
    protected $DeviceId = 0;
    /**
     * The Interface the device was connected on or discovered on
     *
     * Generated from protobuf field <code>.OS.PB.DeviceInterface Interface = 2;</code>
     */
    protected $Interface = 0;
    /**
     * On DeviceConnectionMismatch, returns the expected DeviceId in the routing config
     *
     * Generated from protobuf field <code>uint64 ExpectedDeviceId = 3;</code>
     */
    protected $ExpectedDeviceId = 0;
    /**
     * (Optional) The SourceSerial from the advertising packet. The physical device unique id programmed at factory.
     *
     * Generated from protobuf field <code>uint32 SerialAddress = 8;</code>
     */
    protected $SerialAddress = 0;
    /**
     * Wireless interfaces only and DeviceDiscoveredEvent only: If a new device is discovered, its RSSI is reported here.    
     *
     * Generated from protobuf field <code>sint32 RSSI = 11;</code>
     */
    protected $RSSI = 0;
    /**
     * When a device connects to another device that is part of Cloud Routing config, it gets the FWVersion for cloud to know
     *
     * Generated from protobuf field <code>string AppFirmwareVersion = 15;</code>
     */
    protected $AppFirmwareVersion = '';
    protected $AddressType;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $DeviceId
     *           (Optional) The device Id of the networked device
     *     @type int $Interface
     *           The Interface the device was connected on or discovered on
     *     @type int|string $ExpectedDeviceId
     *           On DeviceConnectionMismatch, returns the expected DeviceId in the routing config
     *     @type int $SerialAddress
     *           (Optional) The SourceSerial from the advertising packet. The physical device unique id programmed at factory.
     *     @type int $RSSI
     *           Wireless interfaces only and DeviceDiscoveredEvent only: If a new device is discovered, its RSSI is reported here.    
     *     @type string $AppFirmwareVersion
     *           When a device connects to another device that is part of Cloud Routing config, it gets the FWVersion for cloud to know
     *     @type string $BTAddress
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Device::initOnce();
        parent::__construct($data);
    }

    /**
     * (Optional) The device Id of the networked device
     *
     * Generated from protobuf field <code>uint64 DeviceId = 1;</code>
     * @return int|string
     */
    public function getDeviceId()
    {
        return $this->DeviceId;
    }

    /**
     * (Optional) The device Id of the networked device
     *
     * 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;
    }

    /**
     * The Interface the device was connected on or discovered on
     *
     * Generated from protobuf field <code>.OS.PB.DeviceInterface Interface = 2;</code>
     * @return int
     */
    public function getInterface()
    {
        return $this->Interface;
    }

    /**
     * The Interface the device was connected on or discovered on
     *
     * 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;
    }

    /**
     * On DeviceConnectionMismatch, returns the expected DeviceId in the routing config
     *
     * Generated from protobuf field <code>uint64 ExpectedDeviceId = 3;</code>
     * @return int|string
     */
    public function getExpectedDeviceId()
    {
        return $this->ExpectedDeviceId;
    }

    /**
     * On DeviceConnectionMismatch, returns the expected DeviceId in the routing config
     *
     * Generated from protobuf field <code>uint64 ExpectedDeviceId = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setExpectedDeviceId($var)
    {
        GPBUtil::checkUint64($var);
        $this->ExpectedDeviceId = $var;

        return $this;
    }

    /**
     * (Optional) The SourceSerial from the advertising packet. The physical device unique id programmed at factory.
     *
     * Generated from protobuf field <code>uint32 SerialAddress = 8;</code>
     * @return int
     */
    public function getSerialAddress()
    {
        return $this->SerialAddress;
    }

    /**
     * (Optional) The SourceSerial from the advertising packet. The physical device unique id programmed at factory.
     *
     * Generated from protobuf field <code>uint32 SerialAddress = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setSerialAddress($var)
    {
        GPBUtil::checkUint32($var);
        $this->SerialAddress = $var;

        return $this;
    }

    /**
     * Wireless interfaces only and DeviceDiscoveredEvent only: If a new device is discovered, its RSSI is reported here.    
     *
     * Generated from protobuf field <code>sint32 RSSI = 11;</code>
     * @return int
     */
    public function getRSSI()
    {
        return $this->RSSI;
    }

    /**
     * Wireless interfaces only and DeviceDiscoveredEvent only: If a new device is discovered, its RSSI is reported here.    
     *
     * Generated from protobuf field <code>sint32 RSSI = 11;</code>
     * @param int $var
     * @return $this
     */
    public function setRSSI($var)
    {
        GPBUtil::checkInt32($var);
        $this->RSSI = $var;

        return $this;
    }

    /**
     * When a device connects to another device that is part of Cloud Routing config, it gets the FWVersion for cloud to know
     *
     * Generated from protobuf field <code>string AppFirmwareVersion = 15;</code>
     * @return string
     */
    public function getAppFirmwareVersion()
    {
        return $this->AppFirmwareVersion;
    }

    /**
     * When a device connects to another device that is part of Cloud Routing config, it gets the FWVersion for cloud to know
     *
     * Generated from protobuf field <code>string AppFirmwareVersion = 15;</code>
     * @param string $var
     * @return $this
     */
    public function setAppFirmwareVersion($var)
    {
        GPBUtil::checkString($var, True);
        $this->AppFirmwareVersion = $var;

        return $this;
    }

    /**
     * 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);
    }

    /**
     * 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");
    }

}

