An Obervable class that listens for Signal K stream deltas and notifies any observers of value changes. This serves as a base class for code that needs to listen to the stream, with the most common descendant being SKValueListener.
More...
#include <sensesp/signalk/signalk_listener.h>
|
| | SKListener (const String &sk_path, int listen_delay, const String &config_path="") |
| String & | get_sk_path () |
| int | get_listen_delay () |
| virtual void | parse_value (const JsonObject &json) |
| | Observable () |
| | Observable (Observable &&other) |
| | Move constructor.
|
| void | notify () |
| int | attach (std::function< void()> observer) |
| | Attach an observer callback.
|
| void | detach (int id) |
| | Remove a previously attached observer by its ID.
|
| | FileSystemSaveable (const String &config_path) |
| virtual bool | load () override |
| | Load and populate the object from a persistent storage.
|
| virtual bool | save () override |
| | Save the object to a persistent storage.
|
| virtual bool | clear () override |
| | Delete the data from a persistent storage.
|
| bool | find_config_file (const String &config_path, String &filename) |
| | Saveable (const String &config_path) |
| virtual bool | refresh () |
| | Refresh the object. This may or may not access the persistent storage but is not expected to overwrite the object's state.
|
| const String & | get_config_path () const |
An Obervable class that listens for Signal K stream deltas and notifies any observers of value changes. This serves as a base class for code that needs to listen to the stream, with the most common descendant being SKValueListener.
- See also
- SKValueListener
Definition at line 22 of file signalk_listener.h.
◆ SKListener()
| sensesp::SKListener::SKListener |
( |
const String & | sk_path, |
|
|
int | listen_delay, |
|
|
const String & | config_path = "" ) |
The constructor
- Parameters
-
| sk_path | The Signal K path that identifies this particular subscription to value |
| listen_delay | How often you want the SK Server to send the data you're subscribing to |
| config_path | The optional configuration path that allows an end user to change the configuration of this object. See the Configurable class for more information. |
Definition at line 13 of file signalk_listener.cpp.
◆ get_listen_delay()
| int sensesp::SKListener::get_listen_delay |
( |
| ) |
|
|
inline |
◆ get_listeners()
| const std::vector< SKListener * > & sensesp::SKListener::get_listeners |
( |
| ) |
|
|
inlinestatic |
◆ get_sk_path()
| String & sensesp::SKListener::get_sk_path |
( |
| ) |
|
|
inline |
Returns the current Signal K path. An empty string is returned if this particular source is not configured or intended to return actual data.
Definition at line 42 of file signalk_listener.h.
◆ parse_value()
| virtual void sensesp::SKListener::parse_value |
( |
const JsonObject & | json | ) |
|
|
inlinevirtual |
◆ release_semaphore()
| void sensesp::SKListener::release_semaphore |
( |
| ) |
|
|
static |
◆ take_semaphore()
| bool sensesp::SKListener::take_semaphore |
( |
uint64_t | timeout_ms = 0 | ) |
|
|
static |
◆ sk_path
| String sensesp::SKListener::sk_path {} |
|
protected |
The documentation for this class was generated from the following files: