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

A class that produces Signal K output to be forwarded to the Signal K server (if the system is connected to one). Signal K is reported via the as_signalK() method. More...

#include <sensesp/signalk/signalk_emitter.h>

Inheritance diagram for sensesp::SKEmitter:
[legend]

Public Member Functions

 SKEmitter (const String &sk_path)
 
virtual void as_signalk_json (JsonDocument &doc)
 
virtual SKMetadataget_metadata ()
 
virtual void add_metadata (JsonArray &meta)
 
String & get_sk_path ()
 
void set_sk_path (const String &path)
 
- Public Member Functions inherited from sensesp::Observable
 Observable ()
 
 Observable (Observable &&other)
 Move constructor.
 
void notify ()
 
void attach (std::function< void()> observer)
 

Static Public Member Functions

static const std::vector< SKEmitter * > & get_sources ()
 

Protected Attributes

String sk_path_ {}
 

Detailed Description

A class that produces Signal K output to be forwarded to the Signal K server (if the system is connected to one). Signal K is reported via the as_signalK() method.

Definition at line 20 of file signalk_emitter.h.

Constructor & Destructor Documentation

◆ SKEmitter()

sensesp::SKEmitter::SKEmitter ( const String & sk_path)

The constructor

Parameters
sk_pathThe Signal K path that identifies this particular output

Definition at line 7 of file signalk_emitter.cpp.

Member Function Documentation

◆ add_metadata()

void sensesp::SKEmitter::add_metadata ( JsonArray & meta)
virtual

Adds this emitter's Signal K meta data to the specified meta object. The default implementation calls the add_entry() method of the SKMetadata class returned by get_metadata(). If get_metadata() returns NULL, this method does nothing.

See also
get_metdata()

Definition at line 11 of file signalk_emitter.cpp.

Here is the call graph for this function:

◆ as_signalk_json()

◆ get_metadata()

virtual SKMetadata * sensesp::SKEmitter::get_metadata ( )
inlinevirtual

Returns a Metadata structure that describes the sk_path this SKEmitter is associated with. If this emitter has no metadata, NULL is returned.

See also
add_metadata()

Reimplemented in sensesp::SKOutput< T >, and sensesp::SKOutput< String >.

Definition at line 45 of file signalk_emitter.h.

Here is the caller graph for this function:

◆ get_sk_path()

String & sensesp::SKEmitter::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 62 of file signalk_emitter.h.

Here is the caller graph for this function:

◆ get_sources()

static const std::vector< SKEmitter * > & sensesp::SKEmitter::get_sources ( )
inlinestatic

Definition at line 66 of file signalk_emitter.h.

Here is the caller graph for this function:

◆ set_sk_path()

void sensesp::SKEmitter::set_sk_path ( const String & path)
inline

Definition at line 64 of file signalk_emitter.h.

Here is the caller graph for this function:

Member Data Documentation

◆ sk_path_

String sensesp::SKEmitter::sk_path_ {}
protected

Definition at line 69 of file signalk_emitter.h.


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