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

namespace OS\PB;

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

/**
 ** \@brief DFU Asynchronous writing of blocks
 *  \@details To speed up the DFU Process, we use actions and events as they are asynchronous 
 *           The correlation id that was used for DFURequest Initiate must be used for the DFUWriteAction,
 *           which will also be set in DFUProgressEvent's CorrelationId
 *
 * Generated from protobuf message <code>OS.PB.DFUAction</code>
 */
class DFUAction extends \Google\Protobuf\Internal\Message
{
    /**
     * Based on BlockSize, where Data must be written to in the image. Index numbers can be skipped
     *
     * Generated from protobuf field <code>uint32 BlockIndex = 1;</code>
     */
    protected $BlockIndex = 0;
    /**
     * The actual data to be written. Data must be BlockSize aligned. Data must be left padded, but right padding can be omitted
     *
     * Generated from protobuf field <code>bytes Data = 3;</code>
     */
    protected $Data = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $BlockIndex
     *           Based on BlockSize, where Data must be written to in the image. Index numbers can be skipped
     *     @type string $Data
     *           The actual data to be written. Data must be BlockSize aligned. Data must be left padded, but right padding can be omitted
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Dfu::initOnce();
        parent::__construct($data);
    }

    /**
     * Based on BlockSize, where Data must be written to in the image. Index numbers can be skipped
     *
     * Generated from protobuf field <code>uint32 BlockIndex = 1;</code>
     * @return int
     */
    public function getBlockIndex()
    {
        return $this->BlockIndex;
    }

    /**
     * Based on BlockSize, where Data must be written to in the image. Index numbers can be skipped
     *
     * Generated from protobuf field <code>uint32 BlockIndex = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setBlockIndex($var)
    {
        GPBUtil::checkUint32($var);
        $this->BlockIndex = $var;

        return $this;
    }

    /**
     * The actual data to be written. Data must be BlockSize aligned. Data must be left padded, but right padding can be omitted
     *
     * Generated from protobuf field <code>bytes Data = 3;</code>
     * @return string
     */
    public function getData()
    {
        return $this->Data;
    }

    /**
     * The actual data to be written. Data must be BlockSize aligned. Data must be left padded, but right padding can be omitted
     *
     * Generated from protobuf field <code>bytes Data = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setData($var)
    {
        GPBUtil::checkString($var, False);
        $this->Data = $var;

        return $this;
    }

}

