# HG changeset patch # User Mychaela Falconia # Date 1726964476 0 # Node ID 0daaae66b3f693d74653714c5de8ee6780f9f97c # Parent 4d596bfdf8d95771c22b489e8fe3e03619b53f24 libtest: add TW-TS-005 write helper function diff -r 4d596bfdf8d9 -r 0daaae66b3f6 libtest/Makefile --- a/libtest/Makefile Sat Sep 21 23:58:27 2024 +0000 +++ b/libtest/Makefile Sun Sep 22 00:21:16 2024 +0000 @@ -1,5 +1,5 @@ OBJS= binreader.o parse_dlcap.o pcmwrite.o roberead.o robewrite.o tw5reader.o\ - wavrdhelp.o wavreader.o wavwriter.o + tw5writer.o wavrdhelp.o wavreader.o wavwriter.o LIB= libtest.a include ../config.defs diff -r 4d596bfdf8d9 -r 0daaae66b3f6 libtest/tw5writer.c --- /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 +#include +#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); +} diff -r 4d596bfdf8d9 -r 0daaae66b3f6 libtest/tw5writer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libtest/tw5writer.h Sun Sep 22 00:21:16 2024 +0000 @@ -0,0 +1,7 @@ +/* + * This header file declares the interface to our writer function for + * hexadecimal RTP frame sequence files in TW-TS-005 format. It is + * a simple function that emits an array of bytes as a hexadecimal line. + */ + +void emit_hex_frame(FILE *outf, const uint8_t *frame, unsigned nbytes);