Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
balloon-tx-monolith
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephen D
balloon-tx-monolith
Commits
cd289fbe
Commit
cd289fbe
authored
1 year ago
by
Stephen D
Browse files
Options
Downloads
Patches
Plain Diff
allow turning off the APRS control
parent
e1f97e91
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
config.toml.example
+7
-2
7 additions, 2 deletions
config.toml.example
src/config.rs
+9
-3
9 additions, 3 deletions
src/config.rs
src/control.rs
+11
-9
11 additions, 9 deletions
src/control.rs
with
27 additions
and
14 deletions
config.toml.example
+
7
−
2
View file @
cd289fbe
...
...
@@ -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'"
This diff is collapsed.
Click to expand it.
src/config.rs
+
9
−
3
View file @
cd289fbe
...
...
@@ -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
()
?
;
...
...
This diff is collapsed.
Click to expand it.
src/control.rs
+
11
−
9
View file @
cd289fbe
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment