Update upstream source from tag 'upstream/0.0.0.74_rc2'

Update to upstream version '0.0.0.74~rc2'
with Debian dir e16052124d
This commit is contained in:
Hibby 2024-12-28 12:31:41 +00:00
commit c45e25f646
12 changed files with 62 additions and 1579 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
.pc/

View File

@ -73,6 +73,7 @@ void displayLevel(int max);
BOOL WriteCOMBlock(HANDLE fd, char * Block, int BytesToWrite);
VOID processargs(int argc, char * argv[]);
void PollReceivedSamples();
void closeTraceLog();
HANDLE OpenCOMPort(char * Port, int speed, BOOL SetDTR, BOOL SetRTS, BOOL Quiet, int Stopbits);

View File

@ -224,7 +224,7 @@ void SampleSink(int LR, short Sample)
{
// Need to upsample to 48K. Try just duplicating sample
uint32_t * ptr = &DMABuffer[2 * Number];
uint16_t * ptr = &DMABuffer[2 * Number];
*(&ptr[1]) = *(ptr);
*(&ptr[2]) = *(ptr);
@ -388,7 +388,7 @@ extern UCHAR * pixelPointer;
#endif
extern int blnBusyStatus;
BusyDet = 5;
int BusyDet = 5;
#define PLOTWATERFALL
@ -522,6 +522,12 @@ void SMUpdateBusyDetector(int LR, float * Real, float *Imag)
Low = tx_freq[chan] - txbpf[chan] / 2;
High = tx_freq[chan] + txbpf[chan] / 2;
if (Low < 100)
continue;
if (High > 3300)
continue;
// Low = tx_freq[chan] - 0.5*rx_shift[chan];
// High = tx_freq[chan] + 0.5*rx_shift[chan];

View File

@ -32,7 +32,7 @@ extern unsigned int PKTLEDTimer;
//#define min(x, y) ((x) < (y) ? (x) : (y))
void SendFrametoHost(unsigned char *data, unsigned dlen);
void ProcessPktFrame(int snd_ch, UCHAR * Data, int frameLen);
void CheckandAdjustRXLevel(int maxlevel, int minlevel, BOOL Force);
void mySetPixel(unsigned char x, unsigned char y, unsigned int Colour);
void clearDisplay();

View File

@ -4,8 +4,8 @@
// My port of UZ7HO's Soundmodem
//
#define VersionString "0.0.0.73"
#define VersionBytes {0, 0, 0, 73}
#define VersionString "0.0.0.74 Beta 2"
#define VersionBytes {0, 0, 0, 74}
//#define LOGTX
//#define LOGRX
@ -197,7 +197,8 @@
// Use ARDOP Busy detector (Beta 3)
// Various fixes to AGW interface (Beta 4)
//.74 Fix filter bandwidths Nov 24
// Fixes for gcc 14 Beta 2
// As far as I can see txtail is only there to make sure all bits get through the tx filter,
// so it shouldn't really matter what is sent. Code worked in characters, so resolution of txtail
@ -668,11 +669,11 @@ extern int SendSize;
#define QPSK_SM 0
#define QPSK_V26 1
#define MODEM_8P4800_BPF 3200
#define MODEM_8P4800_TXBPF 3400
#define MODEM_8P4800_BPF 2800 // Baud 1600
#define MODEM_8P4800_TXBPF 2800
#define MODEM_8P4800_LPF 1000
#define MODEM_8P4800_BPF_TAP 64
#define MODEM_8P4800_LPF_TAP 8
#define MODEM_8P4800_BPF_TAP 256
#define MODEM_8P4800_LPF_TAP 128
//
#define MODEM_MP400_BPF 775
#define MODEM_MP400_TXBPF 850
@ -684,7 +685,7 @@ extern int SendSize;
#define MODEM_DW2400_TXBPF 2500
#define MODEM_DW2400_LPF 900
#define MODEM_DW2400_BPF_TAP 256 //256
#define MODEM_DW2400_LPF_TAP 32 //128
#define MODEM_DW2400_LPF_TAP 128 //128
//
#define MODEM_Q2400_BPF 2400
#define MODEM_Q2400_TXBPF 2500
@ -692,20 +693,20 @@ extern int SendSize;
#define MODEM_Q2400_BPF_TAP 256 //256
#define MODEM_Q2400_LPF_TAP 128 //128
//
#define MODEM_Q3600_BPF 3600
#define MODEM_Q3600_TXBPF 3000
#define MODEM_Q3600_BPF 2800 // 1800 baud
#define MODEM_Q3600_TXBPF 2800
#define MODEM_Q3600_LPF 1350
#define MODEM_Q3600_BPF_TAP 256
#define MODEM_Q3600_LPF_TAP 128
//
#define MODEM_Q4800_BPF 4800
#define MODEM_Q4800_TXBPF 5000
#define MODEM_Q4800_BPF 2800 // 2400 baud
#define MODEM_Q4800_TXBPF 2800
#define MODEM_Q4800_LPF 1800
#define MODEM_Q4800_BPF_TAP 256
#define MODEM_Q4800_LPF_TAP 128
//
#define MODEM_P2400_BPF 4800
#define MODEM_P2400_TXBPF 5000
#define MODEM_P2400_BPF 2800 // 2400 baud
#define MODEM_P2400_TXBPF 2800
#define MODEM_P2400_LPF 1800
#define MODEM_P2400_BPF_TAP 256
#define MODEM_P2400_LPF_TAP 128
@ -746,8 +747,8 @@ extern int SendSize;
#define MODEM_1200_BPF_TAP 256
#define MODEM_1200_LPF_TAP 128
//
#define MODEM_2400_BPF 3200
#define MODEM_2400_TXBPF 3200
#define MODEM_2400_BPF 2800 // 2400 baud
#define MODEM_2400_TXBPF 2800
#define MODEM_2400_LPF 1400
#define MODEM_2400_BPF_TAP 256
#define MODEM_2400_LPF_TAP 128

2
ax25.c
View File

@ -1758,7 +1758,7 @@ int number_digi(char * path)
get_monitor_path(Byte * path, char * mycall, char * corrcall, char * digi)
void get_monitor_path(Byte * path, char * mycall, char * corrcall, char * digi)
{
Byte * digiptr = digi;

View File

@ -497,7 +497,7 @@ void chk_dcd1(int snd_ch, int buf_size)
for (int k = 0; k < KISS.buffer[snd_ch].Count; k++)
{
if (AGWServ)
AGW_Raw_monitor(snd_ch, Strings(&KISS.buffer[snd_ch], n));
AGW_Raw_monitor(snd_ch, Strings(&KISS.buffer[snd_ch], k));
// Need to add copy as clear will free original

View File

@ -374,7 +374,7 @@ void delete_I_FRM(TAX25Port * AX25Sess, int nr)
void delete_I_FRM_port(TAX25Port * AX25Sess)
{
string * frame;
string path = { 0 };
char path[] = "";
string data= { 0 };
Byte pid, nr, ns, f_type, f_id, rpt, cr, pf;
@ -386,7 +386,7 @@ void delete_I_FRM_port(TAX25Port * AX25Sess)
optimize = TRUE;
frame = Strings(&AX25Sess->frame_buf, i);
decode_frame(frame->Data, frame->Length, &path, &data, &pid, &nr, &ns, &f_type, &f_id, &rpt, &pf, &cr);
decode_frame(frame->Data, frame->Length, &path[0], &data, &pid, &nr, &ns, &f_type, &f_id, &rpt, &pf, &cr);
if (f_id == I_I)
{

View File

@ -21,6 +21,8 @@ typedef struct TStringList_T
} TStringList;
#include <stddef.h>
#include <ctype.h>
#include <stdlib.h>
#include "dw9600.h"
#define stringAdd(s1, s2, c) mystringAdd(s1, s2, c, __FILE__, __LINE__)
@ -48,8 +50,13 @@ extern short tx_bitrate[5];
extern unsigned short * DMABuffer;
extern int SampleNo;
string * il2p_send_frame(int chan, packet_t pp, int max_fec, int polarity);
int fx25_send_frame(int chan, unsigned char *fbuf, int flen, int fx_mode);
int multi_modem_process_rec_frame(int chan, int subchan, int slice, unsigned char *fbuf, int flen, int alevel, int retries, int is_fx25);
void ProcessRXFrames(int snd_ch);
unsigned short get_fcs(unsigned char * Data, unsigned short len);
void il2p_rec_bit(int chan, int subchan, int slice, int dbit);
void Debugprintf(const char * format, ...);
//
// This file is part of Dire Wolf, an amateur radio packet TNC.
@ -171,10 +178,8 @@ static int composite_dcd[MAX_CHANS][MAX_SUBCHANS + 1];
int was_init[4] = { 0, 0, 0, 0 };
struct audio_s *g_audio_p;
extern struct audio_s pa[4];
void hdlc_rec_init(struct audio_s *pa)
{
int ch;
@ -184,7 +189,7 @@ void hdlc_rec_init(struct audio_s *pa)
//dw_printf ("hdlc_rec_init (%p) \n", pa);
assert(pa != NULL);
g_audio_p = &pa;
memset(composite_dcd, 0, sizeof(composite_dcd));
@ -336,7 +341,7 @@ static void eas_rec_bit(int chan, int subchan, int slice, int raw, int future_us
dw_printf("frame_buf %d = %s\n", slice, H->frame_buf);
#endif
alevel_t alevel = demod_get_audio_level(chan, subchan);
multi_modem_process_rec_frame(chan, subchan, slice, H->frame_buf, H->frame_len, alevel, 0, 0);
multi_modem_process_rec_frame(chan, subchan, slice, H->frame_buf, H->frame_len, 0, 0, 0);
H->eas_gathering = 0;
}
@ -1597,7 +1602,7 @@ static int try_decode(rrbb_t block, int chan, int subchan, int slice, alevel_t a
assert(rrbb_get_chan(block) == chan);
assert(rrbb_get_subchan(block) == subchan);
multi_modem_process_rec_frame(chan, subchan, slice, H2.frame_buf, H2.frame_len - 2, alevel, retry_conf.retry, 0); /* len-2 to remove FCS. */
multi_modem_process_rec_frame(chan, subchan, slice, H2.frame_buf, H2.frame_len - 2, 0, retry_conf.retry, 0); /* len-2 to remove FCS. */
return 1; /* success */
}
@ -1607,7 +1612,7 @@ static int try_decode(rrbb_t block, int chan, int subchan, int slice, alevel_t a
//text_color_set(DW_COLOR_ERROR);
//dw_printf ("ATTEMPTING PASSALL PROCESSING\n");
multi_modem_process_rec_frame(chan, subchan, slice, H2.frame_buf, H2.frame_len - 2, alevel, RETRY_MAX, 0); /* len-2 to remove FCS. */
multi_modem_process_rec_frame(chan, subchan, slice, H2.frame_buf, H2.frame_len - 2, 0, RETRY_MAX, 0); /* len-2 to remove FCS. */
return 1; /* success */
}
else {
@ -3423,40 +3428,6 @@ static int number_of_bits_sent[MAX_CHANS]; // Count number of bits sent by "hdlc
static int ax25_only_hdlc_send_frame(int chan, unsigned char *fbuf, int flen, int bad_fcs);
int layer2_send_frame(int chan, packet_t pp, int bad_fcs, struct audio_s *audio_config_p)
{
if (audio_config_p->achan[chan].layer2_xmit == LAYER2_IL2P) {
int n = il2p_send_frame(chan, pp, audio_config_p->achan[chan].il2p_max_fec,
audio_config_p->achan[chan].il2p_invert_polarity);
if (n > 0) {
return (n);
}
text_color_set(DW_COLOR_ERROR);
dw_printf("Unable to send IL2p frame. Falling back to regular AX.25.\n");
// Not sure if we should fall back to AX.25 or not here.
}
else if (audio_config_p->achan[chan].layer2_xmit == LAYER2_FX25)
{
unsigned char fbuf[AX25_MAX_PACKET_LEN + 2];
int flen = ax25_pack(pp, fbuf);
int n = fx25_send_frame(chan, fbuf, flen, audio_config_p->achan[chan].fx25_strength);
if (n > 0) {
return (n);
}
text_color_set(DW_COLOR_ERROR);
dw_printf("Unable to send FX.25. Falling back to regular AX.25.\n");
// Definitely need to fall back to AX.25 here because
// the FX.25 frame length is so limited.
}
unsigned char fbuf[AX25_MAX_PACKET_LEN + 2];
int flen = ax25_pack(pp, fbuf);
return (ax25_only_hdlc_send_frame(chan, fbuf, flen, bad_fcs));
}
static int ax25_only_hdlc_send_frame(int chan, unsigned char *fbuf, int flen, int bad_fcs)
{
int j, fcs;

81
il2p.c
View File

@ -226,7 +226,6 @@ void FREE_RS(struct rs *rs);
// Maybe these should be in a different file, separated from the internal stuff.
void fx25_init(int debug_level);
int fx25_send_frame(int chan, unsigned char *fbuf, int flen, int fx_mode);
void fx25_rec_bit(int chan, int subchan, int slice, int dbit);
int fx25_rec_busy(int chan);
@ -398,7 +397,8 @@ typedef enum cmdres_e { cr_00 = 2, cr_cmd = 1, cr_res = 0, cr_11 = 3 } cmdres_t;
extern packet_t ax25_new(void);
#ifdef AX25_PAD_C /* Keep this hidden - implementation could change. */
int set_addrs(packet_t pp, char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int num_addr, cmdres_t cr);
/*
@ -441,8 +441,6 @@ static inline int ax25_get_num_control(packet_t this_p)
return (1); /* U xxxx xx11 */
}
/*
* APRS always has one protocol octet of 0xF0 meaning no level 3
* protocol but the more general case is 0, 1 or 2 protocol ID octets.
@ -514,7 +512,7 @@ static inline int ax25_get_num_info(packet_t this_p)
return (len);
}
#endif
typedef enum ax25_modulo_e { modulo_unknown = 0, modulo_8 = 8, modulo_128 = 128 } ax25_modulo_t;
@ -1448,79 +1446,6 @@ int ax25_get_ssid(packet_t this_p, int n)
static inline int ax25_get_pid_offset(packet_t this_p)
{
return (ax25_get_control_offset(this_p) + ax25_get_num_control(this_p));
}
static int ax25_get_num_pid(packet_t this_p)
{
int c;
int pid;
c = this_p->frame_data[ax25_get_control_offset(this_p)];
if ((c & 0x01) == 0 || /* I xxxx xxx0 */
c == 0x03 || c == 0x13) { /* UI 000x 0011 */
pid = this_p->frame_data[ax25_get_pid_offset(this_p)];
if (pid == AX25_PID_ESCAPE_CHARACTER) {
return (2); /* pid 1111 1111 means another follows. */
}
return (1);
}
return (0);
}
inline int ax25_get_control_offset(packet_t this_p)
{
return (this_p->num_addr * 7);
}
inline int ax25_get_num_control(packet_t this_p)
{
int c;
c = this_p->frame_data[ax25_get_control_offset(this_p)];
if ((c & 0x01) == 0) { /* I xxxx xxx0 */
return ((this_p->modulo == 128) ? 2 : 1);
}
if ((c & 0x03) == 1) { /* S xxxx xx01 */
return ((this_p->modulo == 128) ? 2 : 1);
}
return (1); /* U xxxx xx11 */
}
int ax25_get_info_offset(packet_t this_p)
{
int offset = ax25_get_control_offset(this_p) + ax25_get_num_control(this_p) + ax25_get_num_pid(this_p);
return (offset);
}
int ax25_get_num_info(packet_t this_p)
{
int len;
/* assuming AX.25 frame. */
len = this_p->frame_len - this_p->num_addr * 7 - ax25_get_num_control(this_p) - ax25_get_num_pid(this_p);
if (len < 0) {
len = 0; /* print error? */
}
return (len);
}
/*------------------------------------------------------------------------------
*

View File

@ -30,6 +30,17 @@ void make_core_LPF(UCHAR snd_ch, short width);
void dw9600ProcessSample(int snd_ch, short Sample);
void init_RUH48(int snd_ch);
void init_RUH96(int snd_ch);
void CheckPSKWindows();
void Demodulator(int snd_ch, int rcvr_nr, float * src_buf, int last, int xcenter);
void sendSamplestoUDP(short * Samples, int nSamples, int Port);
void RSIDProcessSamples(short * Samples, int nSamples);
void ARDOPProcessNewSamples(int chan, short * Samples, int nSamples);
void doWaterfall(int snd_ch);
void displayWaterfall();
void timer_event();
void decode_frame(Byte * frame, int len, Byte * path, string * data, Byte * pid, Byte * nr, Byte * ns, Byte * f_type, Byte * f_id, Byte * rpt, Byte * pf, Byte * cr);
void get_monitor_path(Byte * path, char * mycall, char * corrcall, char * digi);
void ProcessRXFrames(int snd_ch);
char modes_name[modes_count][21] =
{
@ -827,10 +838,10 @@ void runModems()
if (thread[2]) WaitForSingleObject(&thread[2], 2000);
if (thread[3]) WaitForSingleObject(&thread[3], 2000);
#else
if (thread[0]) pthread_join(thread[0], &res);
if (thread[1]) pthread_join(thread[1], &res);
if (thread[2]) pthread_join(thread[2], &res);
if (thread[3]) pthread_join(thread[3], &res);
if (thread[0]) pthread_join(thread[0], NULL);
if (thread[1]) pthread_join(thread[1], NULL);
if (thread[2]) pthread_join(thread[2], NULL);
if (thread[3]) pthread_join(thread[3], NULL);
#endif
}
}

File diff suppressed because it is too large Load Diff