mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-04-26 05:49:51 +00:00
75 lines
1.9 KiB
PHP
Vendored
75 lines
1.9 KiB
PHP
Vendored
<?php
|
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
# source: api/device_profile.proto
|
|
|
|
namespace Chirpstack\Api;
|
|
|
|
use UnexpectedValueException;
|
|
|
|
/**
|
|
* Protobuf type <code>api.MeasurementKind</code>
|
|
*/
|
|
class MeasurementKind
|
|
{
|
|
/**
|
|
* Unknown (in which case it is not tracked).
|
|
*
|
|
* Generated from protobuf enum <code>UNKNOWN = 0;</code>
|
|
*/
|
|
const UNKNOWN = 0;
|
|
/**
|
|
* Incrementing counters that never decrease (these are not reset on each
|
|
* reading).
|
|
*
|
|
* Generated from protobuf enum <code>COUNTER = 1;</code>
|
|
*/
|
|
const COUNTER = 1;
|
|
/**
|
|
* Counters that do get reset upon reading.
|
|
*
|
|
* Generated from protobuf enum <code>ABSOLUTE = 2;</code>
|
|
*/
|
|
const ABSOLUTE = 2;
|
|
/**
|
|
* E.g. a temperature value.
|
|
*
|
|
* Generated from protobuf enum <code>GAUGE = 3;</code>
|
|
*/
|
|
const GAUGE = 3;
|
|
/**
|
|
* E.g. a firmware version, true / false value.
|
|
*
|
|
* Generated from protobuf enum <code>STRING = 4;</code>
|
|
*/
|
|
const STRING = 4;
|
|
|
|
private static $valueToName = [
|
|
self::UNKNOWN => 'UNKNOWN',
|
|
self::COUNTER => 'COUNTER',
|
|
self::ABSOLUTE => 'ABSOLUTE',
|
|
self::GAUGE => 'GAUGE',
|
|
self::STRING => 'STRING',
|
|
];
|
|
|
|
public static function name($value)
|
|
{
|
|
if (!isset(self::$valueToName[$value])) {
|
|
throw new UnexpectedValueException(sprintf(
|
|
'Enum %s has no name defined for value %s', __CLASS__, $value));
|
|
}
|
|
return self::$valueToName[$value];
|
|
}
|
|
|
|
|
|
public static function value($name)
|
|
{
|
|
$const = __CLASS__ . '::' . strtoupper($name);
|
|
if (!defined($const)) {
|
|
throw new UnexpectedValueException(sprintf(
|
|
'Enum %s has no value defined for name %s', __CLASS__, $name));
|
|
}
|
|
return constant($const);
|
|
}
|
|
}
|
|
|