mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-04-26 05:49:51 +00:00
142 lines
3.6 KiB
PHP
Vendored
142 lines
3.6 KiB
PHP
Vendored
<?php
|
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
# source: api/device.proto
|
|
|
|
namespace Chirpstack\Api;
|
|
|
|
use Google\Protobuf\Internal\GPBType;
|
|
use Google\Protobuf\Internal\RepeatedField;
|
|
use Google\Protobuf\Internal\GPBUtil;
|
|
|
|
/**
|
|
* Generated from protobuf message <code>api.DeviceStatus</code>
|
|
*/
|
|
class DeviceStatus extends \Google\Protobuf\Internal\Message
|
|
{
|
|
/**
|
|
* The device margin status
|
|
* -32..32: The demodulation SNR ration in dB
|
|
*
|
|
* Generated from protobuf field <code>int32 margin = 1;</code>
|
|
*/
|
|
protected $margin = 0;
|
|
/**
|
|
* Device is connected to an external power source.
|
|
*
|
|
* Generated from protobuf field <code>bool external_power_source = 2;</code>
|
|
*/
|
|
protected $external_power_source = false;
|
|
/**
|
|
* Device battery level as a percentage.
|
|
* -1 when the battery level is not available.
|
|
*
|
|
* Generated from protobuf field <code>float battery_level = 3;</code>
|
|
*/
|
|
protected $battery_level = 0.0;
|
|
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @param array $data {
|
|
* Optional. Data for populating the Message object.
|
|
*
|
|
* @type int $margin
|
|
* The device margin status
|
|
* -32..32: The demodulation SNR ration in dB
|
|
* @type bool $external_power_source
|
|
* Device is connected to an external power source.
|
|
* @type float $battery_level
|
|
* Device battery level as a percentage.
|
|
* -1 when the battery level is not available.
|
|
* }
|
|
*/
|
|
public function __construct($data = NULL) {
|
|
\GPBMetadata\Chirpstack\Api\Device::initOnce();
|
|
parent::__construct($data);
|
|
}
|
|
|
|
/**
|
|
* The device margin status
|
|
* -32..32: The demodulation SNR ration in dB
|
|
*
|
|
* Generated from protobuf field <code>int32 margin = 1;</code>
|
|
* @return int
|
|
*/
|
|
public function getMargin()
|
|
{
|
|
return $this->margin;
|
|
}
|
|
|
|
/**
|
|
* The device margin status
|
|
* -32..32: The demodulation SNR ration in dB
|
|
*
|
|
* Generated from protobuf field <code>int32 margin = 1;</code>
|
|
* @param int $var
|
|
* @return $this
|
|
*/
|
|
public function setMargin($var)
|
|
{
|
|
GPBUtil::checkInt32($var);
|
|
$this->margin = $var;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Device is connected to an external power source.
|
|
*
|
|
* Generated from protobuf field <code>bool external_power_source = 2;</code>
|
|
* @return bool
|
|
*/
|
|
public function getExternalPowerSource()
|
|
{
|
|
return $this->external_power_source;
|
|
}
|
|
|
|
/**
|
|
* Device is connected to an external power source.
|
|
*
|
|
* Generated from protobuf field <code>bool external_power_source = 2;</code>
|
|
* @param bool $var
|
|
* @return $this
|
|
*/
|
|
public function setExternalPowerSource($var)
|
|
{
|
|
GPBUtil::checkBool($var);
|
|
$this->external_power_source = $var;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Device battery level as a percentage.
|
|
* -1 when the battery level is not available.
|
|
*
|
|
* Generated from protobuf field <code>float battery_level = 3;</code>
|
|
* @return float
|
|
*/
|
|
public function getBatteryLevel()
|
|
{
|
|
return $this->battery_level;
|
|
}
|
|
|
|
/**
|
|
* Device battery level as a percentage.
|
|
* -1 when the battery level is not available.
|
|
*
|
|
* Generated from protobuf field <code>float battery_level = 3;</code>
|
|
* @param float $var
|
|
* @return $this
|
|
*/
|
|
public function setBatteryLevel($var)
|
|
{
|
|
GPBUtil::checkFloat($var);
|
|
$this->battery_level = $var;
|
|
|
|
return $this;
|
|
}
|
|
|
|
}
|
|
|