@@ -116,7 +116,8 @@ static struct audio_s *save_audio_config_p;
116
116
static struct {
117
117
packet_t packet_p ;
118
118
alevel_t alevel ;
119
- int is_fx25 ; // 1 for FX.25, 0 for regular AX.25.
119
+ float speed_error ;
120
+ fec_type_t fec_type ; // Type of FEC: none(0), fx25, il2p
120
121
retry_t retries ; // For the old "fix bits" strategy, this is the
121
122
// number of bits that were modified to get a good CRC.
122
123
// It would be 0 to something around 4.
@@ -306,14 +307,14 @@ void multi_modem_process_sample (int chan, int audio_sample)
306
307
* display of audio level line.
307
308
* Use -2 to indicate DTMF message.)
308
309
* retries - Level of correction used.
309
- * is_fx25 - 1 for FX.25, 0 for normal AX.25.
310
+ * fec_type - none(0), fx25, il2p
310
311
*
311
312
* Description: Add to list of candidates. Best one will be picked later.
312
313
*
313
314
*--------------------------------------------------------------------*/
314
315
315
316
316
- void multi_modem_process_rec_frame (int chan , int subchan , int slice , unsigned char * fbuf , int flen , alevel_t alevel , retry_t retries , int is_fx25 )
317
+ void multi_modem_process_rec_frame (int chan , int subchan , int slice , unsigned char * fbuf , int flen , alevel_t alevel , retry_t retries , fec_type_t fec_type )
317
318
{
318
319
packet_t pp ;
319
320
@@ -346,12 +347,12 @@ void multi_modem_process_rec_frame (int chan, int subchan, int slice, unsigned c
346
347
pp = ax25_from_frame (fbuf , flen , alevel );
347
348
}
348
349
349
- multi_modem_process_rec_packet (chan , subchan , slice , pp , alevel , retries , is_fx25 );
350
+ multi_modem_process_rec_packet (chan , subchan , slice , pp , alevel , retries , fec_type );
350
351
}
351
352
352
353
// TODO: Eliminate function above and move code elsewhere?
353
354
354
- void multi_modem_process_rec_packet (int chan , int subchan , int slice , packet_t pp , alevel_t alevel , retry_t retries , int is_fx25 )
355
+ void multi_modem_process_rec_packet (int chan , int subchan , int slice , packet_t pp , alevel_t alevel , retry_t retries , fec_type_t fec_type )
355
356
{
356
357
if (pp == NULL ) {
357
358
text_color_set (DW_COLOR_ERROR );
@@ -386,7 +387,7 @@ void multi_modem_process_rec_packet (int chan, int subchan, int slice, packet_t
386
387
ax25_delete (pp );
387
388
}
388
389
else {
389
- dlq_rec_frame (chan , subchan , slice , pp , alevel , is_fx25 , retries , "" );
390
+ dlq_rec_frame (chan , subchan , slice , pp , alevel , fec_type , retries , "" );
390
391
}
391
392
return ;
392
393
}
@@ -406,7 +407,7 @@ void multi_modem_process_rec_packet (int chan, int subchan, int slice, packet_t
406
407
407
408
candidate [chan ][subchan ][slice ].packet_p = pp ;
408
409
candidate [chan ][subchan ][slice ].alevel = alevel ;
409
- candidate [chan ][subchan ][slice ].is_fx25 = is_fx25 ;
410
+ candidate [chan ][subchan ][slice ].fec_type = fec_type ;
410
411
candidate [chan ][subchan ][slice ].retries = retries ;
411
412
candidate [chan ][subchan ][slice ].age = 0 ;
412
413
candidate [chan ][subchan ][slice ].crc = ax25_m_m_crc (pp );
@@ -443,6 +444,9 @@ static void pick_best_candidate (int chan)
443
444
int best_n , best_score ;
444
445
char spectrum [MAX_SUBCHANS * MAX_SLICERS + 1 ];
445
446
int n , j , k ;
447
+ if (save_audio_config_p -> achan [chan ].num_slicers < 1 ) {
448
+ save_audio_config_p -> achan [chan ].num_slicers = 1 ;
449
+ }
446
450
int num_bars = save_audio_config_p -> achan [chan ].num_slicers * save_audio_config_p -> achan [chan ].num_subchan ;
447
451
448
452
memset (spectrum , 0 , sizeof (spectrum ));
@@ -456,15 +460,15 @@ static void pick_best_candidate (int chan)
456
460
if (candidate [chan ][j ][k ].packet_p == NULL ) {
457
461
spectrum [n ] = '_' ;
458
462
}
459
- else if (candidate [chan ][j ][k ].is_fx25 ) {
463
+ else if (candidate [chan ][j ][k ].fec_type != fec_type_none ) { // FX.25 or IL2P
460
464
// FIXME: using retries both as an enum and later int too.
461
465
if ((int )(candidate [chan ][j ][k ].retries ) <= 9 ) {
462
466
spectrum [n ] = '0' + candidate [chan ][j ][k ].retries ;
463
467
}
464
468
else {
465
469
spectrum [n ] = '+' ;
466
470
}
467
- }
471
+ } // AX.25 below
468
472
else if (candidate [chan ][j ][k ].retries == RETRY_NONE ) {
469
473
spectrum [n ] = '|' ;
470
474
}
@@ -481,8 +485,8 @@ static void pick_best_candidate (int chan)
481
485
candidate [chan ][j ][k ].score = 0 ;
482
486
}
483
487
else {
484
- if (candidate [chan ][j ][k ].is_fx25 ) {
485
- candidate [chan ][j ][k ].score = 9000 - 100 * candidate [chan ][j ][k ].retries ;
488
+ if (candidate [chan ][j ][k ].fec_type != fec_type_none ) {
489
+ candidate [chan ][j ][k ].score = 9000 - 100 * candidate [chan ][j ][k ].retries ; // has FEC
486
490
}
487
491
else {
488
492
/* Originally, this produced 0 for the PASSALL case. */
@@ -550,9 +554,9 @@ static void pick_best_candidate (int chan)
550
554
candidate [chan ][j ][k ].packet_p );
551
555
}
552
556
else {
553
- dw_printf ("%d.%d.%d: ptr=%p, is_fx25 =%d, retry=%d, age=%3d, crc=%04x, score=%d %s\n" , chan , j , k ,
557
+ dw_printf ("%d.%d.%d: ptr=%p, fec_type =%d, retry=%d, age=%3d, crc=%04x, score=%d %s\n" , chan , j , k ,
554
558
candidate [chan ][j ][k ].packet_p ,
555
- candidate [chan ][j ][k ].is_fx25 ,
559
+ ( int )( candidate [chan ][j ][k ].fec_type ) ,
556
560
(int )(candidate [chan ][j ][k ].retries ),
557
561
candidate [chan ][j ][k ].age ,
558
562
candidate [chan ][j ][k ].crc ,
@@ -611,7 +615,7 @@ static void pick_best_candidate (int chan)
611
615
dlq_rec_frame (chan , j , k ,
612
616
candidate [chan ][j ][k ].packet_p ,
613
617
candidate [chan ][j ][k ].alevel ,
614
- candidate [chan ][j ][k ].is_fx25 ,
618
+ candidate [chan ][j ][k ].fec_type ,
615
619
(int )(candidate [chan ][j ][k ].retries ),
616
620
spectrum );
617
621
0 commit comments