Skip to content

Commit f263b08

Browse files
committed
Fix RTTY extraction
1 parent d7c5442 commit f263b08

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/horus_api.c

+9-2
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ int extract_horus_rtty(struct horus *hstates, char ascii_out[], int uw_loc) {
347347
char_dec |= hstates->rx_bits[i+j] * (1<<j);
348348
}
349349
if (hstates->verbose) {
350-
fprintf(stderr, " extract_horus_rtty i: %4d 0x%02x %c ", i, char_dec, char_dec);
350+
fprintf(stderr, " extract_horus_rtty i: %4d 0x%02x %c \n", i, char_dec, char_dec);
351351
if ((nout % 6) == 0) {
352352
fprintf(stderr, "\n");
353353
}
@@ -359,6 +359,11 @@ int extract_horus_rtty(struct horus *hstates, char ascii_out[], int uw_loc) {
359359
endpacket = 1;
360360
rx_crc = horus_l2_gen_crc16((uint8_t*)&ascii_out[5], nout-5);
361361
ptx_crc = pout + 1; /* start of tx CRC */
362+
if (hstates->verbose){
363+
fprintf(stderr, " begin endpacket\n");
364+
}
365+
// Only process up to the next 5 characters (checksum + line ending)
366+
en = i + 10*5;
362367
}
363368

364369
/* build up output array, really only need up to tx crc but
@@ -377,7 +382,9 @@ int extract_horus_rtty(struct horus *hstates, char ascii_out[], int uw_loc) {
377382
for(i=0; i<4; i++) {
378383
tx_crc <<= 4;
379384
tx_crc |= hex2int(ptx_crc[i]);
380-
//fprintf(stderr, "ptx_crc[%d] %c 0x%02X tx_crc: 0x%04X\n", i, ptx_crc[i], hex2int(ptx_crc[i]), tx_crc);
385+
if (hstates->verbose){
386+
fprintf(stderr, "ptx_crc[%d] %c 0x%02X tx_crc: 0x%04X\n", i, ptx_crc[i], hex2int(ptx_crc[i]), tx_crc);
387+
}
381388
}
382389
crc_ok = (tx_crc == rx_crc);
383390
*(ptx_crc+4) = 0; /* terminate ASCII string */

0 commit comments

Comments
 (0)