Minor cleanups.

This commit is contained in:
wb2osz 2023-08-08 17:34:06 +01:00
parent dfc063f905
commit 2434e5f13b
7 changed files with 19 additions and 30 deletions

View File

@ -5775,8 +5775,9 @@ static int beacon_options(char *cmd, struct beacon_s *b, int line, struct audio_
else if (strcasecmp(keyword, "POWER") == 0) { else if (strcasecmp(keyword, "POWER") == 0) {
b->power = atoi(value); b->power = atoi(value);
} }
else if (strcasecmp(keyword, "HEIGHT") == 0) { else if (strcasecmp(keyword, "HEIGHT") == 0) { // This is in feet.
b->height = atoi(value); b->height = atoi(value);
// TODO: ability to add units suffix, e.g. 10m
} }
else if (strcasecmp(keyword, "GAIN") == 0) { else if (strcasecmp(keyword, "GAIN") == 0) {
b->gain = atoi(value); b->gain = atoi(value);

View File

@ -300,8 +300,8 @@ int main (int argc, char *argv[])
text_color_init(t_opt); text_color_init(t_opt);
text_color_set(DW_COLOR_INFO); 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 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 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); //dw_printf ("Dire Wolf version %d.%d\n", MAJOR_VERSION, MINOR_VERSION);
@ -387,7 +387,7 @@ int main (int argc, char *argv[])
dw_printf ("\n"); dw_printf ("\n");
dw_printf ("Dire Wolf requires only privileges available to ordinary users.\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"); dw_printf ("Running this as root is an unnecessary security risk.\n");
SLEEP_SEC(1); //SLEEP_SEC(1);
} }
} }
#endif #endif

View File

@ -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 // 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 // so many different meanings. Simply looking at the DTI is not adequate for
@ -1825,9 +1824,6 @@ static void maybe_xmit_packet_from_igate (char *message, int to_chan)
*gt = '\0'; *gt = '\0';
} }
// FIXME NO!
///////ax25_get_addr_with_ssid (pp3, AX25_SOURCE, src);
/* /*
* Drop if path contains: * Drop if path contains:
* NOGATE or RFONLY - means IGate should not pass them. * NOGATE or RFONLY - means IGate should not pass them.
@ -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) static int ig_to_tx_allow (packet_t pp, int chan)
{ {

View File

@ -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. now = time(NULL); // Get current time.
(void)gmtime_r (&now, &tm); (void)gmtime_r (&now, &tm);
// FIXME: https://github.com/wb2osz/direwolf/issues/473
if (g_daily_names) { if (g_daily_names) {

View File

@ -1303,6 +1303,11 @@ static int filt_s (pfstate_t *pf)
* what they are for other digipeaters. * what they are for other digipeaters.
* I think the best solution is to simply ignore the hop count. * 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) static int filt_i (pfstate_t *pf)

View File

@ -207,7 +207,7 @@ static void * recv_adev_thread (void *arg)
int eof; int eof;
/* This audio device can have one (mono) or two (stereo) channels. */ /* 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 first_chan = ADEVFIRSTCHAN(a);
int num_chan = save_pa->adev[a].num_channels; int num_chan = save_pa->adev[a].num_channels;
@ -234,6 +234,8 @@ static void * recv_adev_thread (void *arg)
if (audio_sample >= 256 * 256) if (audio_sample >= 256 * 256)
eof = 1; 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); multi_modem_process_sample(first_chan + c, audio_sample);
@ -262,14 +264,14 @@ static void * recv_adev_thread (void *arg)
aprs_tt_button (first_chan + c, tt); aprs_tt_button (first_chan + c, tt);
} }
} }
} } // for c is just 0 or 0 then 1
/* When a complete frame is accumulated, */ /* When a complete frame is accumulated, */
/* dlq_rec_frame, is called. */ /* dlq_rec_frame, is called. */
/* recv_process, below, drains the queue. */ /* recv_process, below, drains the queue. */
} } // while !eof on audio stream
// What should we do now? // What should we do now?
// Seimply terminate the application? // Seimply terminate the application?

View File

@ -1,6 +1,7 @@
[Unit] [Unit]
Description=Direwolf Sound Card-based AX.25 TNC Description=Direwolf Sound Card-based AX.25 TNC
After=sound.target After=sound.target
After=network.target
[Service] [Service]
EnvironmentFile=/etc/sysconfig/direwolf EnvironmentFile=/etc/sysconfig/direwolf
@ -22,3 +23,5 @@ ReadWritePaths=/var/log/direwolf
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
DefaultInstance=1 DefaultInstance=1
# alternate version: https://www.f4fxl.org/start-direwolf-at-boot-the-systemd-way/