diff libgsmhr1/sid_reset.c @ 495:aee13079db3c

libgsmhr1: implement SID reset
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 17 Jun 2024 23:25:19 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgsmhr1/sid_reset.c	Mon Jun 17 23:25:19 2024 +0000
@@ -0,0 +1,15 @@
+/*
+ * The function in this module implements reset of HRv1 SID codeword,
+ * for rejuvenating SID frames that may have been corrupted, but were still
+ * accepted as valid SID.
+ */
+
+#include <stdint.h>
+#include <string.h>
+#include "tw_gsmhr.h"
+
+void gsmhr_ts101318_set_sid_codeword(uint8_t *payload)
+{
+	payload[4] |= 0x7F;
+	memset(payload + 5, 0xFF, 9);
+}