SensESP 2.7.2
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 (String sk_path)
 
virtual String as_signalk ()
 
virtual SKMetadataget_metadata ()
 
virtual void add_metadata (JsonArray &meta)
 
Stringget_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 21 of file signalk_emitter.h.

Constructor & Destructor Documentation

◆ SKEmitter()

sensesp::SKEmitter::SKEmitter ( 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()

virtual String sensesp::SKEmitter::as_signalk ( )
inlinevirtual

Returns the data to be reported to the server as a Signal K json string.

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

Definition at line 34 of file signalk_emitter.h.

◆ 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 42 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 59 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 63 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 61 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 66 of file signalk_emitter.h.


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