Skip to content

Commit

Permalink
Merge pull request #766 from SignalK/sk_metadata_fix
Browse files Browse the repository at this point in the history
SKMetadata fix
  • Loading branch information
mairas authored Oct 8, 2024
2 parents 408d9cf + f1ba243 commit 68960db
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/sensesp/signalk/signalk_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ template <typename T>
SKOutputNumeric<T>::SKOutputNumeric(String sk_path, String config_path,
SKMetadata* meta)
: SKOutput<T>(sk_path, config_path, meta) {
if (this->meta_ == NULL && !this->sk_path_.isEmpty()) {
if (this->meta_ == nullptr && !this->sk_path_.isEmpty()) {
ESP_LOGW(
__FILENAME__,
"WARNING - No metadata for %s. Numeric values should specify units",
Expand Down
4 changes: 2 additions & 2 deletions src/sensesp/signalk/signalk_output.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SKOutput : public SKEmitter, public SymmetricTransform<T> {
* Signal K specification)
*/
SKOutput(String sk_path, String config_path = "", SKMetadata* meta = nullptr)
: SKOutput(sk_path, config_path, std::make_shared<SKMetadata>(*meta)) {}
: SKOutput(sk_path, config_path, std::shared_ptr<SKMetadata>(meta)) {}

SKOutput(String sk_path, String config_path, std::shared_ptr<SKMetadata> meta)
: SKEmitter(sk_path), SymmetricTransform<T>(config_path), meta_{meta} {
Expand Down Expand Up @@ -112,7 +112,7 @@ template <typename T>
class SKOutputNumeric : public SKOutput<T> {
public:
SKOutputNumeric(String sk_path, String config_path = "",
SKMetadata* meta = NULL);
SKMetadata* meta = nullptr);

SKOutputNumeric(String sk_path, SKMetadata* meta)
: SKOutputNumeric(sk_path, "", meta) {}
Expand Down
1 change: 0 additions & 1 deletion src/sensesp/system/stream_producer.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class StreamLineProducer : public ValueProducer<String> {
// Include the newline character in the output
buf_[buf_pos++] = c;
buf_[buf_pos] = '\0';
ESP_LOGV("StreamLineProducer", "About to emit line: %s", buf_);
this->emit(buf_);
buf_pos = 0;
} else {
Expand Down

0 comments on commit 68960db

Please sign in to comment.