diff --git a/src/golay/golay.c b/src/golay/golay.c index 3f1d8e8..9b8aca8 100644 --- a/src/golay/golay.c +++ b/src/golay/golay.c @@ -240,6 +240,7 @@ static const uint16_t preamble_values[] = { }; static const uint32_t start_code = 713; +static const uint32_t activation_code = 2563; /* Rep. 900-2 Table VI */ static const uint16_t word1s[50] = { @@ -660,9 +661,20 @@ static int queue_batch(gsc_t *gsc, const char *address, int force_type, const ch } } - /* encode comma after message and store */ - PDEBUG(DGOLAY, DEBUG_DEBUG, "Encoding 'comma' sequence after message.\n"); - queue_comma(gsc, 121 * 8, 1); + if (type == TYPE_VOICE) { + /* encode activation code and store */ + PDEBUG(DGOLAY, DEBUG_DEBUG, "Encoding activation code.\n"); + golay = calc_golay(activation_code); + queue_comma(gsc, 28, golay & 1); + queue_dup(gsc, golay, 23); + golay ^= 0x7fffff; + queue_bit(gsc, (golay & 1) ^ 1); + queue_dup(gsc, golay, 23); + } else { + /* encode comma after message and store */ + PDEBUG(DGOLAY, DEBUG_DEBUG, "Encoding 'comma' sequence after message.\n"); + queue_comma(gsc, 121 * 8, 1); + } /* check overflow */ if (gsc->bit_overflow) {