Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"net.rssi" diagnostic data #1397

Merged
merged 3 commits into from
Oct 5, 2017
Merged

Conversation

sergeuz
Copy link
Member

@sergeuz sergeuz commented Sep 26, 2017

Problem

The system should expose RSSI diagnostic info on platforms that have a wireless network module.

Solution

Add net.rssi diagnostic data source.

Example App

#include "application.h"

namespace {

const Serial1LogHandler logHandler(115200, LOG_LEVEL_WARN, {
    { "app", LOG_LEVEL_ALL }
});

bool logDiagData(void* appender, const uint8_t* data, size_t size) {
    Log.write(LOG_LEVEL_INFO, (const char*)data, size);
    return true;
}

} // namespace

void setup() {
    uint16_t id = DIAG_ID_NETWORK_RSSI;
    system_format_diag_data(&id, 1, 0, logDiagData, nullptr, nullptr);
    Log.print("\r\n");
}

void loop() {
}

References


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@sergeuz sergeuz added this to the 0.8.0 milestone Sep 26, 2017
Copy link
Contributor

@m-mcgowan m-mcgowan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. When is the DiagnosticSource added to the diagnostic service?

@sergeuz
Copy link
Member Author

sergeuz commented Oct 3, 2017

The registration happens in the constructor of AbstractDiagnosticData: https://github.com/spark/firmware/blob/feature/diagnostics/wiring/inc/spark_wiring_diagnostics.h#L170

@m-mcgowan m-mcgowan merged commit 2729ab7 into feature/diagnostics Oct 5, 2017
@mrlambchop mrlambchop deleted the feature/diag_rssi branch October 26, 2023 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants