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

/**
 * Generated from protobuf message <code>OS.PB.DFURequest</code>
 */
class DFURequest extends \Google\Protobuf\Internal\Message
{
    /**
     * When initiating the DFU, the following information must be set
     *
     * Generated from protobuf field <code>string HardwarePlatform = 2;</code>
     */
    protected $HardwarePlatform = '';
    /**
     * The resulting image size once upgraded, validated against the mcuboot secondary partition size
     *
     * Generated from protobuf field <code>uint32 ImageSize = 3;</code>
     */
    protected $ImageSize = 0;
    /**
     * The SHA256 hash of the image expected once written, if it doesn't match then it fails
     *
     * Generated from protobuf field <code>bytes ImageHash = 4;</code>
     */
    protected $ImageHash = '';
    /**
     * The size of each block that will be sent down
     *
     * Generated from protobuf field <code>uint32 TransferBlockSize = 5;</code>
     */
    protected $TransferBlockSize = 0;
    /**
     * The total number of blocks that will be transferred
     *
     * Generated from protobuf field <code>uint32 TransferBlocksTotal = 6;</code>
     */
    protected $TransferBlocksTotal = 0;
    /**
     * Default 60: Waits a certain amount of time to ensure no crashes occur, if one does, then the image is rolled back to previous version
     *
     * Generated from protobuf field <code>uint32 ValidationTime = 7;</code>
     */
    protected $ValidationTime = 0;
    /**
     * refer above
     *
     * Generated from protobuf field <code>.OS.PB.DFURequest.DFUProgressOptions ProgressOption = 10;</code>
     */
    protected $ProgressOption = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $HardwarePlatform
     *           When initiating the DFU, the following information must be set
     *     @type int $ImageSize
     *           The resulting image size once upgraded, validated against the mcuboot secondary partition size
     *     @type string $ImageHash
     *           The SHA256 hash of the image expected once written, if it doesn't match then it fails
     *     @type int $TransferBlockSize
     *           The size of each block that will be sent down
     *     @type int $TransferBlocksTotal
     *           The total number of blocks that will be transferred
     *     @type int $ValidationTime
     *           Default 60: Waits a certain amount of time to ensure no crashes occur, if one does, then the image is rolled back to previous version
     *     @type int $ProgressOption
     *           refer above
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Dfu::initOnce();
        parent::__construct($data);
    }

    /**
     * When initiating the DFU, the following information must be set
     *
     * Generated from protobuf field <code>string HardwarePlatform = 2;</code>
     * @return string
     */
    public function getHardwarePlatform()
    {
        return $this->HardwarePlatform;
    }

    /**
     * When initiating the DFU, the following information must be set
     *
     * Generated from protobuf field <code>string HardwarePlatform = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setHardwarePlatform($var)
    {
        GPBUtil::checkString($var, True);
        $this->HardwarePlatform = $var;

        return $this;
    }

    /**
     * The resulting image size once upgraded, validated against the mcuboot secondary partition size
     *
     * Generated from protobuf field <code>uint32 ImageSize = 3;</code>
     * @return int
     */
    public function getImageSize()
    {
        return $this->ImageSize;
    }

    /**
     * The resulting image size once upgraded, validated against the mcuboot secondary partition size
     *
     * Generated from protobuf field <code>uint32 ImageSize = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setImageSize($var)
    {
        GPBUtil::checkUint32($var);
        $this->ImageSize = $var;

        return $this;
    }

    /**
     * The SHA256 hash of the image expected once written, if it doesn't match then it fails
     *
     * Generated from protobuf field <code>bytes ImageHash = 4;</code>
     * @return string
     */
    public function getImageHash()
    {
        return $this->ImageHash;
    }

    /**
     * The SHA256 hash of the image expected once written, if it doesn't match then it fails
     *
     * Generated from protobuf field <code>bytes ImageHash = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setImageHash($var)
    {
        GPBUtil::checkString($var, False);
        $this->ImageHash = $var;

        return $this;
    }

    /**
     * The size of each block that will be sent down
     *
     * Generated from protobuf field <code>uint32 TransferBlockSize = 5;</code>
     * @return int
     */
    public function getTransferBlockSize()
    {
        return $this->TransferBlockSize;
    }

    /**
     * The size of each block that will be sent down
     *
     * Generated from protobuf field <code>uint32 TransferBlockSize = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setTransferBlockSize($var)
    {
        GPBUtil::checkUint32($var);
        $this->TransferBlockSize = $var;

        return $this;
    }

    /**
     * The total number of blocks that will be transferred
     *
     * Generated from protobuf field <code>uint32 TransferBlocksTotal = 6;</code>
     * @return int
     */
    public function getTransferBlocksTotal()
    {
        return $this->TransferBlocksTotal;
    }

    /**
     * The total number of blocks that will be transferred
     *
     * Generated from protobuf field <code>uint32 TransferBlocksTotal = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setTransferBlocksTotal($var)
    {
        GPBUtil::checkUint32($var);
        $this->TransferBlocksTotal = $var;

        return $this;
    }

    /**
     * Default 60: Waits a certain amount of time to ensure no crashes occur, if one does, then the image is rolled back to previous version
     *
     * Generated from protobuf field <code>uint32 ValidationTime = 7;</code>
     * @return int
     */
    public function getValidationTime()
    {
        return $this->ValidationTime;
    }

    /**
     * Default 60: Waits a certain amount of time to ensure no crashes occur, if one does, then the image is rolled back to previous version
     *
     * Generated from protobuf field <code>uint32 ValidationTime = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setValidationTime($var)
    {
        GPBUtil::checkUint32($var);
        $this->ValidationTime = $var;

        return $this;
    }

    /**
     * refer above
     *
     * Generated from protobuf field <code>.OS.PB.DFURequest.DFUProgressOptions ProgressOption = 10;</code>
     * @return int
     */
    public function getProgressOption()
    {
        return $this->ProgressOption;
    }

    /**
     * refer above
     *
     * Generated from protobuf field <code>.OS.PB.DFURequest.DFUProgressOptions ProgressOption = 10;</code>
     * @param int $var
     * @return $this
     */
    public function setProgressOption($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\DFURequest\DFUProgressOptions::class);
        $this->ProgressOption = $var;

        return $this;
    }

}

