summaryrefslogtreecommitdiff
path: root/src/core/ao_config.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-12-07 17:18:32 -0800
committerKeith Packard <keithp@keithp.com>2012-12-07 17:18:32 -0800
commitb28323ce91d23db5e1c3cbd1309c72aafcfbe235 (patch)
treeb982d32f7b073c470d082e13fc814b7adc36aeff /src/core/ao_config.c
parentf8a704268f0978a39b9c7983e049ef55914f7280 (diff)
altos: Make APRS interval configurable
This provides a separate configuration value for APRS, allowing the interval between APRS reports to vary. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/core/ao_config.c')
-rw-r--r--src/core/ao_config.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/core/ao_config.c b/src/core/ao_config.c
index 63158158..0aac16a6 100644
--- a/src/core/ao_config.c
+++ b/src/core/ao_config.c
@@ -139,6 +139,8 @@ _ao_config_get(void)
if (minor < 12)
memset(&ao_config.pyro, '\0', sizeof (ao_config.pyro));
#endif
+ if (minor < 13)
+ ao_config.aprs_interval = 0;
ao_config.minor = AO_CONFIG_MINOR;
ao_config_dirty = 1;
}
@@ -498,6 +500,27 @@ ao_config_key_set(void) __reentrant
}
#endif
+#if HAS_APRS
+
+void
+ao_config_aprs_show(void)
+{
+ printf ("APRS interval: %d\n", ao_config.aprs_interval);
+}
+
+void
+ao_config_aprs_set(void)
+{
+ ao_cmd_decimal();
+ if (ao_cmd_status != ao_cmd_success)
+ return;
+ _ao_config_edit_start();
+ ao_config.aprs_interval = ao_cmd_lex_i;
+ _ao_config_edit_finish();
+}
+
+#endif /* HAS_APRS */
+
struct ao_config_var {
__code char *str;
void (*set)(void) __reentrant;
@@ -554,6 +577,10 @@ __code struct ao_config_var ao_config_vars[] = {
{ "P <n,?>\0Configure pyro channels",
ao_pyro_set, ao_pyro_show },
#endif
+#if HAS_APRS
+ { "A <secs>\0APRS packet interval (0 disable)",
+ ao_config_aprs_set, ao_config_aprs_show },
+#endif
{ "s\0Show",
ao_config_show, 0 },
#if HAS_EEPROM