|
SensESP 3.1.1
Universal Signal K sensor toolkit ESP32
|
Holds Signal K meta data that is associated with the sk_path an SKEmitter class may optionally send to the server. According to the official Signal K specification: "All keys in the Signal K specification must have a <tt>description</tt>, and where the key is a numeric value it must have <tt>units</tt>". Thus, any paths that you output that are not already part of the official Signal K specification should have these two fields defined as metadata. More...
#include <sensesp/signalk/signalk_metadata.h>
Public Member Functions | |
| SKMetadata (const String &units, const String &display_name="", const String &description="", const String &short_name="", float timeout=-1.0) | |
| SKMetadata () | |
| Default constructor creates a blank Metadata structure. | |
| virtual void | add_entry (const String &sk_path, JsonArray &meta) |
Public Attributes | |
| String | display_name_ |
| String | units_ |
| String | description_ |
| String | short_name_ |
| float | timeout_ |
Holds Signal K meta data that is associated with the sk_path an SKEmitter class may optionally send to the server. According to the official Signal K specification: "All keys in the Signal K specification must have a <tt>description</tt>, and where the key is a numeric value it must have <tt>units</tt>". Thus, any paths that you output that are not already part of the official Signal K specification should have these two fields defined as metadata.
Note that this structure is a subset of the complete meta model. These are the most common properties. More complex strctures can be created by creating a descendant class of SKMetadata and overriding add_entry()
Definition at line 24 of file signalk_metadata.h.
| sensesp::SKMetadata::SKMetadata | ( | const String & | units, |
| const String & | display_name = "", | ||
| const String & | description = "", | ||
| const String & | short_name = "", | ||
| float | timeout = -1.0 ) |
| units | The unit of measurement the value represents. See https://github.com/SignalK/specification/blob/master/schemas/definitions.json#L87 |
| display_name | This is used on or near any display or gauge which shows the data. |
| description | This is the description for the Signal K path and must always be the same as the description property within the Signal K Schema for that path. |
| short_name | Human readable name for the particular instance of this value. The short version may be used by consumers where space is at a premium |
| timeout | Tells the consumer how long it should consider the value valid. This value is specified in seconds. Specify -1.0 if you do not want to specify a timeout. |
Definition at line 5 of file signalk_metadata.cpp.
|
inline |
Default constructor creates a blank Metadata structure.
Definition at line 52 of file signalk_metadata.h.
|
virtual |
Adds an entry to the specified meta array that represents this metadata definition. The default implementation adds a single object that contains the member fields of this class as individual properties.
| [in] | sk_path | The Signal K path this metadata represents |
| [out] | meta | The array the metadata entry is supposed to be added to |
Definition at line 14 of file signalk_metadata.cpp.
| String sensesp::SKMetadata::description_ |
Definition at line 28 of file signalk_metadata.h.
| String sensesp::SKMetadata::display_name_ |
Definition at line 26 of file signalk_metadata.h.
| String sensesp::SKMetadata::short_name_ |
Definition at line 29 of file signalk_metadata.h.
| float sensesp::SKMetadata::timeout_ |
Definition at line 30 of file signalk_metadata.h.
| String sensesp::SKMetadata::units_ |
Definition at line 27 of file signalk_metadata.h.