Skip to content

Commit 45cd680

Browse files
committed
First rough approximation of ICHANNEL.
1 parent 9b9744b commit 45cd680

23 files changed

+260
-105
lines changed

src/atest.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,9 @@ int main (int argc, char *argv[])
620620
my_audio_config.adev[0].bits_per_sample = format.wbitspersample;
621621
my_audio_config.adev[0].num_channels = format.nchannels;
622622

623-
my_audio_config.achan[0].medium = MEDIUM_RADIO;
623+
my_audio_config.chan_medium[0] = MEDIUM_RADIO;
624624
if (format.nchannels == 2) {
625-
my_audio_config.achan[1].medium = MEDIUM_RADIO;
625+
my_audio_config.chan_medium[1] = MEDIUM_RADIO;
626626
}
627627

628628
text_color_set(DW_COLOR_INFO);

src/audio.h

+16-9
Original file line numberDiff line numberDiff line change
@@ -119,32 +119,39 @@ struct audio_s {
119119
/* I put it here, rather than with the rest of the link layer */
120120
/* parameters because it is really a part of the HDLC layer */
121121
/* and is part of the KISS TNC functionality rather than our data link layer. */
122+
/* Future: not used yet. */
123+
122124

123125
char timestamp_format[40]; /* -T option */
124126
/* Precede received & transmitted frames with timestamp. */
125127
/* Command line option uses "strftime" format string. */
126128

127129

128-
/* Properties for each channel, common to receive and transmit. */
129-
/* Can be different for each radio channel. */
130130

131131
/* originally a "channel" was always connected to an internal modem. */
132132
/* In version 1.6, this is generalized so that a channel (as seen by client application) */
133133
/* can be connected to something else. Initially, this will allow application */
134134
/* access to the IGate. Later we might have network TNCs or other internal functions. */
135135

136+
// Properties for all channels.
136137

137-
struct achan_param_s {
138-
139-
// Originally there was a boolean, called "valid", to indicate that the
140-
// channel is valid. This has been replaced with the new "medium" which
141-
// will allow channels to correspond to things other than internal modems.
142-
143-
enum medium_e medium; // MEDIUM_NONE for invalid.
138+
enum medium_e chan_medium[MAX_TOTAL_CHANS];
139+
// MEDIUM_NONE for invalid.
144140
// MEDIUM_RADIO for internal modem. (only possibility earlier)
145141
// MEDIUM_IGATE allows application access to IGate.
142+
// MEDIUM_NETTNC for external TNC via TCP.
146143

144+
int igate_vchannel; /* Virtual channel mapped to APRS-IS. */
145+
/* -1 for none. */
146+
/* Redundant but it makes things quicker and simpler */
147+
/* than always searching thru above. */
148+
149+
/* Properties for each radio channel, common to receive and transmit. */
150+
/* Can be different for each radio channel. */
151+
152+
struct achan_param_s {
147153

154+
// What else should be moved out of structure and enlarged when NETTNC is implemented. ???
148155
char mycall[AX25_MAX_ADDR_LEN]; /* Call associated with this radio channel. */
149156
/* Could all be the same or different. */
150157

src/ax25_pad.c

+7
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,13 @@ packet_t ax25_from_text (char *monitor, int strict)
511511

512512
// printf ("DEBUG: get digi loop, num addr = %d, address = '%s'\n", k, pa);// FIXME
513513

514+
// Hack for q construct, from APRS-IS, so it does not cause panic later.
515+
516+
if ( ! strict && pa[0] == 'q' && pa[1] == 'A') {
517+
pa[0] = 'Q';
518+
pa[2] = toupper(pa[2]);
519+
}
520+
514521
if ( ! ax25_parse_addr (k, pa, strict, atemp, &ssid_temp, &heard_temp)) {
515522
text_color_set(DW_COLOR_ERROR);
516523
dw_printf ("Failed to create packet from text. Bad digipeater address\n");

src/beacon.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ void beacon_init (struct audio_s *pmodem, struct misc_config_s *pconfig, struct
163163

164164
if (chan < 0) chan = 0; /* For IGate, use channel 0 call. */
165165

166-
if (g_modem_config_p->achan[chan].medium == MEDIUM_RADIO ||
167-
g_modem_config_p->achan[chan].medium == MEDIUM_NETTNC) {
166+
if (g_modem_config_p->chan_medium[chan] == MEDIUM_RADIO ||
167+
g_modem_config_p->chan_medium[chan] == MEDIUM_NETTNC) {
168168

169169
if (strlen(g_modem_config_p->achan[chan].mycall) > 0 &&
170170
strcasecmp(g_modem_config_p->achan[chan].mycall, "N0CALL") != 0 &&

src/cdigipeater.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void cdigipeater (int from_chan, packet_t pp)
132132
// Connected mode is allowed only for channels with internal modem.
133133
// It probably wouldn't matter for digipeating but let's keep that rule simple and consistent.
134134

135-
if ( from_chan < 0 || from_chan >= MAX_CHANS || save_audio_config_p->achan[from_chan].medium != MEDIUM_RADIO) {
135+
if ( from_chan < 0 || from_chan >= MAX_CHANS || save_audio_config_p->chan_medium[from_chan] != MEDIUM_RADIO) {
136136
text_color_set(DW_COLOR_ERROR);
137137
dw_printf ("cdigipeater: Did not expect to receive on invalid channel %d.\n", from_chan);
138138
return;

0 commit comments

Comments
 (0)