Files
cdba/status.h
Bjorn Andersson 81e46878ed cdba-server: Allow external status command
While the CDB Assist and QcomLT Debugboard is measuring voltage and
current on the DC jack directly in the backend, other backends and
further measurements can be performed using custom tooling.

Introduce support for invoking an external "status-cmd" to produce such
status updates.

The status command should on its stdout produce json-formatted status
updates following the same format as the cdba-server:

  {"ts":%d.%03d, "name": {["mv"|"ma"]: %u}(, "name2": {["mv"|"ma"]: %u})*}

with the ts aquired using clock_gettime(CLOCK_MONOTONIC) and provided in
seconds and milliseconds since the first measurement.

Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
2023-11-27 21:19:57 -06:00

22 lines
339 B
C

#ifndef __STATUS_H__
#define __STATUS_H__
#include <stdlib.h>
enum status_unit {
STATUS_EOF,
STATUS_MV,
STATUS_MA,
STATUS_GPIO,
};
struct status_value {
enum status_unit unit;
unsigned int value;
};
void status_send_values(const char *id, struct status_value *values);
void status_send_raw(const char *data, size_t len);
#endif