<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: ble.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.BLEEvent</code>
 */
class BLEEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * Whether this event was generated from a central or peripheral
     *
     * Generated from protobuf field <code>.OS.PB.BLERoleType BLERole = 5;</code>
     */
    protected $BLERole = 0;
    /**
     * The BLE Address of the device that connected
     *
     * Generated from protobuf field <code>bytes BTAddress = 6;</code>
     */
    protected $BTAddress = '';
    /**
     * The type of address of the device that connected
     *
     * Generated from protobuf field <code>.OS.PB.BTAddressType BTAddressType = 7;</code>
     */
    protected $BTAddressType = 0;
    /**
     * BeSecure or OneSpace Protobuf Serial 32bit serial number
     *
     * Generated from protobuf field <code>uint32 SerialNumber = 10;</code>
     */
    protected $SerialNumber = 0;
    /**
     * BeSecure Fcode, typically 0x27
     *
     * Generated from protobuf field <code>uint32 FunctionCode = 11;</code>
     */
    protected $FunctionCode = 0;
    /**
     * BeSecure Payload bytes
     *
     * Generated from protobuf field <code>bytes Payload = 12;</code>
     */
    protected $Payload = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $BLERole
     *           Whether this event was generated from a central or peripheral
     *     @type string $BTAddress
     *           The BLE Address of the device that connected
     *     @type int $BTAddressType
     *           The type of address of the device that connected
     *     @type int $SerialNumber
     *           BeSecure or OneSpace Protobuf Serial 32bit serial number
     *     @type int $FunctionCode
     *           BeSecure Fcode, typically 0x27
     *     @type string $Payload
     *           BeSecure Payload bytes
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Ble::initOnce();
        parent::__construct($data);
    }

    /**
     * Whether this event was generated from a central or peripheral
     *
     * Generated from protobuf field <code>.OS.PB.BLERoleType BLERole = 5;</code>
     * @return int
     */
    public function getBLERole()
    {
        return $this->BLERole;
    }

    /**
     * Whether this event was generated from a central or peripheral
     *
     * Generated from protobuf field <code>.OS.PB.BLERoleType BLERole = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setBLERole($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\BLERoleType::class);
        $this->BLERole = $var;

        return $this;
    }

    /**
     * The BLE Address of the device that connected
     *
     * Generated from protobuf field <code>bytes BTAddress = 6;</code>
     * @return string
     */
    public function getBTAddress()
    {
        return $this->BTAddress;
    }

    /**
     * The BLE Address of the device that connected
     *
     * Generated from protobuf field <code>bytes BTAddress = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setBTAddress($var)
    {
        GPBUtil::checkString($var, False);
        $this->BTAddress = $var;

        return $this;
    }

    /**
     * The type of address of the device that connected
     *
     * Generated from protobuf field <code>.OS.PB.BTAddressType BTAddressType = 7;</code>
     * @return int
     */
    public function getBTAddressType()
    {
        return $this->BTAddressType;
    }

    /**
     * The type of address of the device that connected
     *
     * Generated from protobuf field <code>.OS.PB.BTAddressType BTAddressType = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setBTAddressType($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\BTAddressType::class);
        $this->BTAddressType = $var;

        return $this;
    }

    /**
     * BeSecure or OneSpace Protobuf Serial 32bit serial number
     *
     * Generated from protobuf field <code>uint32 SerialNumber = 10;</code>
     * @return int
     */
    public function getSerialNumber()
    {
        return $this->SerialNumber;
    }

    /**
     * BeSecure or OneSpace Protobuf Serial 32bit serial number
     *
     * Generated from protobuf field <code>uint32 SerialNumber = 10;</code>
     * @param int $var
     * @return $this
     */
    public function setSerialNumber($var)
    {
        GPBUtil::checkUint32($var);
        $this->SerialNumber = $var;

        return $this;
    }

    /**
     * BeSecure Fcode, typically 0x27
     *
     * Generated from protobuf field <code>uint32 FunctionCode = 11;</code>
     * @return int
     */
    public function getFunctionCode()
    {
        return $this->FunctionCode;
    }

    /**
     * BeSecure Fcode, typically 0x27
     *
     * Generated from protobuf field <code>uint32 FunctionCode = 11;</code>
     * @param int $var
     * @return $this
     */
    public function setFunctionCode($var)
    {
        GPBUtil::checkUint32($var);
        $this->FunctionCode = $var;

        return $this;
    }

    /**
     * BeSecure Payload bytes
     *
     * Generated from protobuf field <code>bytes Payload = 12;</code>
     * @return string
     */
    public function getPayload()
    {
        return $this->Payload;
    }

    /**
     * BeSecure Payload bytes
     *
     * Generated from protobuf field <code>bytes Payload = 12;</code>
     * @param string $var
     * @return $this
     */
    public function setPayload($var)
    {
        GPBUtil::checkString($var, False);
        $this->Payload = $var;

        return $this;
    }

}

