SensESP 2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::SKListener Class Reference

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>

Inheritance diagram for sensesp::SKListener:
[legend]

Public Member Functions

 SKListener (String sk_path, int listen_delay, String config_path="")
 
Stringget_sk_path ()
 
int get_listen_delay ()
 
virtual void parse_value (const JsonObject &json)
 
- Public Member Functions inherited from sensesp::Observable
 Observable ()
 
 Observable (Observable &&other)
 Move constructor.
 
void notify ()
 
void attach (std::function< void()> observer)
 
- Public Member Functions inherited from sensesp::Configurable
 Configurable (String config_path="", String description="", int sort_order=1000)
 
String get_description ()
 
void set_description (String description)
 Set the description of the Configurable.
 
int get_sort_order ()
 
void set_sort_order (int sort_order)
 
virtual void save_configuration ()
 

Static Public Member Functions

static const std::vector< SKListener * > & get_listeners ()
 
static bool take_semaphore (unsigned long int timeout_ms=0)
 
static void release_semaphore ()
 

Protected Attributes

String sk_path
 
- Protected Attributes inherited from sensesp::Configurable
String description_ = ""
 
int sort_order_ = 1000
 

Additional Inherited Members

- Public Attributes inherited from sensesp::Configurable
const String config_path_
 
- Protected Member Functions inherited from sensesp::Configurable
virtual void load_configuration ()
 

Detailed Description

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 28 of file signalk_listener.h.

Constructor & Destructor Documentation

◆ SKListener()

sensesp::SKListener::SKListener ( String  sk_path,
int  listen_delay,
String  config_path = "" 
)

The constructor

Parameters
sk_pathThe Signal K path that identifies this particular subscription to value
listen_delayHow often you want the SK Server to send the data you're subscribing to
config_pathThe 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 9 of file signalk_listener.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ get_listen_delay()

int sensesp::SKListener::get_listen_delay ( )
inline

Definition at line 49 of file signalk_listener.h.

◆ get_listeners()

static const std::vector< SKListener * > & sensesp::SKListener::get_listeners ( )
inlinestatic

Definition at line 53 of file signalk_listener.h.

◆ 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 47 of file signalk_listener.h.

◆ parse_value()

virtual void sensesp::SKListener::parse_value ( const JsonObject json)
inlinevirtual

Reimplemented in sensesp::SKValueListener< T >.

Definition at line 51 of file signalk_listener.h.

◆ release_semaphore()

void sensesp::SKListener::release_semaphore ( )
static

Definition at line 23 of file signalk_listener.cpp.

Here is the caller graph for this function:

◆ take_semaphore()

bool sensesp::SKListener::take_semaphore ( unsigned long int  timeout_ms = 0)
static

Definition at line 15 of file signalk_listener.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ sk_path

String sensesp::SKListener::sk_path
protected

Definition at line 59 of file signalk_listener.h.


The documentation for this class was generated from the following files: