SensESP 3.5.1-alpha
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
signalk_metadata.h
Go to the documentation of this file.
1#ifndef SENSESP_SIGNALK_SIGNALK_METADATA_H_
2#define SENSESP_SIGNALK_SIGNALK_METADATA_H_
3
4#include <ArduinoJson.h>
5#include <cmath>
6#include <vector>
7
8namespace sensesp {
9
15enum class SKAlarmState {
17 kNormal,
18 kAlert,
19 kWarn,
20 kAlarm,
22};
23
34 float lower;
35 float upper;
36 String message;
38
46 float upper = NAN)
48};
49
67 public:
69 String units_;
72 float timeout_;
74 String example_;
80 std::vector<SKMetadataZone> zones_;
81
101 SKMetadata(const String& units, const String& display_name = "",
102 const String& description = "", const String& short_name = "",
103 float timeout = -1.0, bool supports_put = false);
104
107
115 virtual void add_entry(const String& sk_path, JsonArray& meta);
116
117 protected:
118 static const char* alarm_state_to_string(SKAlarmState state);
119};
120
121} // namespace sensesp
122
123#endif
Holds Signal K meta data that is associated with the sk_path an SKEmitter class may optionally send t...
std::vector< SKMetadataZone > zones_
Alarm zones, emitted in the order they were added.
float display_scale_upper_
NAN = not set; displayScale is emitted only when both bounds are set.
virtual void add_entry(const String &sk_path, JsonArray &meta)
float display_scale_lower_
NAN = not set; displayScale is emitted only when both bounds are set.
static const char * alarm_state_to_string(SKAlarmState state)
SKMetadata()
Default constructor creates a blank Metadata structure.
SKAlarmState
Alarm state values for Signal K Zone metadata.
Represents a single Signal K alarm zone within metadata.
float lower
Lower bound of the zone; NAN if not set.
float upper
Upper bound of the zone; NAN if not set.
SKMetadataZone(SKAlarmState state, const String &message, float lower, float upper=NAN)