Skip to content
Snippets Groups Projects
Commit cd289fbe authored by Stephen D's avatar Stephen D
Browse files

allow turning off the APRS control

parent e1f97e91
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,11 @@ paths = [
# must be 6 characters or less
callsign = "NOCALL"
# Comment this section out if you're not using
# APRS for control
[control]
kiss = "localhost:8001"
# used for authenticating incoming
# APRS packets. Note that this is a
# signature, *not* encryption
......@@ -20,7 +25,7 @@ callsign = "NOCALL"
secret = "changeme"
# command to burst the balloon
burst_command = "echo 'boom!'"
burst_command = ">&2 echo 'boom!'"
# command to cut down the payload
cutdown_command = "echo 'snip'"
cutdown_command = ">&2 echo 'snip'"
......@@ -4,14 +4,20 @@ use anyhow::{bail, Context};
use serde::Deserialize;
#[derive(Deserialize, Clone)]
pub struct Config {
pub paths: Vec<PathBuf>,
pub callsign: String,
pub struct ControlConfig {
pub secret: String,
pub burst_command: String,
pub cutdown_command: String,
}
#[derive(Deserialize, Clone)]
pub struct Config {
pub paths: Vec<PathBuf>,
pub callsign: String,
pub control: Option<ControlConfig>,
}
impl Config {
pub fn load() -> anyhow::Result<Self> {
let file_contents = read_conf_file()?;
......
......@@ -60,15 +60,17 @@ impl Controller {
// used to request HD images, as well as
// to initiate burst/cutdown
fn aprs_thread(config: Config, tx: Sender<u8>) {
let mut handler = CommandHandler::new(
config.callsign,
config.secret,
config.burst_command,
config.cutdown_command,
tx,
);
handler.process_forever();
if let Some(ctrl) = config.control {
let mut handler = CommandHandler::new(
config.callsign,
ctrl.secret,
ctrl.burst_command,
ctrl.cutdown_command,
tx,
);
handler.process_forever();
}
}
// manages our transceiver
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment