Skip to content

Commit

Permalink
Minor cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
wb2osz committed Aug 8, 2023
1 parent dfc063f commit 2434e5f
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 30 deletions.
3 changes: 2 additions & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -5775,8 +5775,9 @@ static int beacon_options(char *cmd, struct beacon_s *b, int line, struct audio_
else if (strcasecmp(keyword, "POWER") == 0) {
b->power = atoi(value);
}
else if (strcasecmp(keyword, "HEIGHT") == 0) {
else if (strcasecmp(keyword, "HEIGHT") == 0) { // This is in feet.
b->height = atoi(value);
// TODO: ability to add units suffix, e.g. 10m
}
else if (strcasecmp(keyword, "GAIN") == 0) {
b->gain = atoi(value);
Expand Down
6 changes: 3 additions & 3 deletions src/direwolf.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ int main (int argc, char *argv[])

text_color_init(t_opt);
text_color_set(DW_COLOR_INFO);
//dw_printf ("Dire Wolf version %d.%d (%s) Beta Test 4\n", MAJOR_VERSION, MINOR_VERSION, __DATE__);
dw_printf ("Dire Wolf DEVELOPMENT version %d.%d %s (%s)\n", MAJOR_VERSION, MINOR_VERSION, "G", __DATE__);
dw_printf ("Dire Wolf version %d.%d (%s) BETA TEST 4\n", MAJOR_VERSION, MINOR_VERSION, __DATE__);
//dw_printf ("Dire Wolf DEVELOPMENT version %d.%d %s (%s)\n", MAJOR_VERSION, MINOR_VERSION, "G", __DATE__);
//dw_printf ("Dire Wolf version %d.%d\n", MAJOR_VERSION, MINOR_VERSION);


Expand Down Expand Up @@ -387,7 +387,7 @@ int main (int argc, char *argv[])
dw_printf ("\n");
dw_printf ("Dire Wolf requires only privileges available to ordinary users.\n");
dw_printf ("Running this as root is an unnecessary security risk.\n");
SLEEP_SEC(1);
//SLEEP_SEC(1);
}
}
#endif
Expand Down
22 changes: 0 additions & 22 deletions src/igate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,6 @@ static void * satgate_delay_thread (void *arg)
*
*--------------------------------------------------------------------*/

#warning - clean up

// It is unforunate that the : data type indicator (DTI) was overloaded with
// so many different meanings. Simply looking at the DTI is not adequate for
Expand Down Expand Up @@ -1825,9 +1824,6 @@ static void maybe_xmit_packet_from_igate (char *message, int to_chan)
*gt = '\0';
}

// FIXME NO!
///////ax25_get_addr_with_ssid (pp3, AX25_SOURCE, src);

/*
* Drop if path contains:
* NOGATE or RFONLY - means IGate should not pass them.
Expand Down Expand Up @@ -2472,24 +2468,6 @@ void ig_to_tx_remember (packet_t pp, int chan, int bydigi)
}


#warning remove

static int is_message_overload (char *infop)
{
if (*infop != ':') return (0);
if (strlen(infop) < 16) return (0);
if (strncmp(infop+10, ":PARM.", 6) == 0) return (1);
if (strncmp(infop+10, ":UNIT.", 6) == 0) return (1);
if (strncmp(infop+10, ":EQNS.", 6) == 0) return (1);
if (strncmp(infop+10, ":BITS.", 6) == 0) return (1);
if (strncmp(infop+1, "BLN", 3) == 0) return (1);
if (strncmp(infop+1, "NWS", 3) == 0) return (1);
if (strncmp(infop+1, "SKY", 3) == 0) return (1);
if (strncmp(infop+1, "CWA", 3) == 0) return (1);
if (strncmp(infop+1, "BOM", 3) == 0) return (1);
return (0);
}


static int ig_to_tx_allow (packet_t pp, int chan)
{
Expand Down
2 changes: 1 addition & 1 deletion src/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ void log_write (int chan, decode_aprs_t *A, packet_t pp, alevel_t alevel, retry_

now = time(NULL); // Get current time.
(void)gmtime_r (&now, &tm);

// FIXME: https://github.com/wb2osz/direwolf/issues/473

if (g_daily_names) {

Expand Down
5 changes: 5 additions & 0 deletions src/pfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,11 @@ static int filt_s (pfstate_t *pf)
* what they are for other digipeaters.
* I think the best solution is to simply ignore the hop count.
*
* Release 1.7: I got overly ambitious and now realize this is just giving people too much
* "rope to hang themselves," drop messages unexpectedly, and accidentally break messaging.
* Change documentation to mention only the time limit.
* The other functionality will be undocumented and maybe disappear over time.
*
*------------------------------------------------------------------------------*/

static int filt_i (pfstate_t *pf)
Expand Down
8 changes: 5 additions & 3 deletions src/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static void * recv_adev_thread (void *arg)
int eof;

/* This audio device can have one (mono) or two (stereo) channels. */
/* Find number of the first channel. */
/* Find number of the first channel and number of channels. */

int first_chan = ADEVFIRSTCHAN(a);
int num_chan = save_pa->adev[a].num_channels;
Expand All @@ -234,6 +234,8 @@ static void * recv_adev_thread (void *arg)
if (audio_sample >= 256 * 256)
eof = 1;

// Future? provide more flexible mapping.
// i.e. for each valid channel where audio_source[] is first_chan+c.
multi_modem_process_sample(first_chan + c, audio_sample);


Expand Down Expand Up @@ -262,14 +264,14 @@ static void * recv_adev_thread (void *arg)
aprs_tt_button (first_chan + c, tt);
}
}
}
} // for c is just 0 or 0 then 1

/* When a complete frame is accumulated, */
/* dlq_rec_frame, is called. */

/* recv_process, below, drains the queue. */

}
} // while !eof on audio stream

// What should we do now?
// Seimply terminate the application?
Expand Down
3 changes: 3 additions & 0 deletions systemd/direwolf.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[Unit]
Description=Direwolf Sound Card-based AX.25 TNC
After=sound.target
After=network.target

[Service]
EnvironmentFile=/etc/sysconfig/direwolf
Expand All @@ -22,3 +23,5 @@ ReadWritePaths=/var/log/direwolf
[Install]
WantedBy=multi-user.target
DefaultInstance=1

# alternate version: https://www.f4fxl.org/start-direwolf-at-boot-the-systemd-way/

0 comments on commit 2434e5f

Please sign in to comment.