summaryrefslogtreecommitdiff
path: root/ao-tools/lib/cc-telemetry.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-03-09 20:39:31 -0800
committerKeith Packard <keithp@keithp.com>2013-03-09 20:39:31 -0800
commit9b460d38bc2685bca7f530b7749c0e0381f6264c (patch)
tree8eb7463a9ad0c63b3e6df3ae7d3692ee27214d78 /ao-tools/lib/cc-telemetry.h
parent0803da851e2e061affc172fdde6301652d1be755 (diff)
ao-tools/lib: Add cc_telemetry_unparse
This takes a telemetry structure and generates a string version Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/lib/cc-telemetry.h')
-rw-r--r--ao-tools/lib/cc-telemetry.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/ao-tools/lib/cc-telemetry.h b/ao-tools/lib/cc-telemetry.h
index e849cd3b..9a5be49f 100644
--- a/ao-tools/lib/cc-telemetry.h
+++ b/ao-tools/lib/cc-telemetry.h
@@ -237,7 +237,19 @@ union ao_telemetry_all {
struct ao_telemetry_baro baro;
};
+#define CC_TELEMETRY_HEADER "TELEM"
+
+/* "TELEM " 1 byte length 32 data bytes 1 rssi 1 status 1 checksum 1 null */
+
+#define CC_TELEMETRY_BUFSIZE (6 + (1 + 32 + 3) * 2 + 1)
+
int
cc_telemetry_parse(const char *input_line, union ao_telemetry_all *telemetry);
+uint8_t
+cc_telemetry_cksum(const union ao_telemetry_all *telemetry);
+
+void
+cc_telemetry_unparse(const union ao_telemetry_all *telemetry, char output_line[CC_TELEMETRY_BUFSIZE]);
+
#endif