diff libtest/tw5writer.c @ 539:0daaae66b3f6

libtest: add TW-TS-005 write helper function
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 22 Sep 2024 00:21:16 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libtest/tw5writer.c	Sun Sep 22 00:21:16 2024 +0000
@@ -0,0 +1,16 @@
+/*
+ * Here we implement our emit_hex_frame() function.
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include "tw5writer.h"
+
+void emit_hex_frame(FILE *outf, const uint8_t *frame, unsigned nbytes)
+{
+	unsigned n;
+
+	for (n = 0; n < nbytes; n++)
+		fprintf(outf, "%02X", frame[n]);
+	putc('\n', outf);
+}