api.DeviceStatus
*/
class DeviceStatus extends \Google\Protobuf\Internal\Message
{
/**
* The device margin status
* -32..32: The demodulation SNR ration in dB
*
* Generated from protobuf field int32 margin = 1;
*/
protected $margin = 0;
/**
* Device is connected to an external power source.
*
* Generated from protobuf field bool external_power_source = 2;
*/
protected $external_power_source = false;
/**
* Device battery level as a percentage.
* -1 when the battery level is not available.
*
* Generated from protobuf field float battery_level = 3;
*/
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 int32 margin = 1;
* @return int
*/
public function getMargin()
{
return $this->margin;
}
/**
* The device margin status
* -32..32: The demodulation SNR ration in dB
*
* Generated from protobuf field int32 margin = 1;
* @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 bool external_power_source = 2;
* @return bool
*/
public function getExternalPowerSource()
{
return $this->external_power_source;
}
/**
* Device is connected to an external power source.
*
* Generated from protobuf field bool external_power_source = 2;
* @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 float battery_level = 3;
* @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 float battery_level = 3;
* @param float $var
* @return $this
*/
public function setBatteryLevel($var)
{
GPBUtil::checkFloat($var);
$this->battery_level = $var;
return $this;
}
}