Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 83 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ futures = "^0.3"
futures-core = "^0.3"
futures-util = "^0.3"
futures-timer = "^3.0.1"
serialport = { version = "^3.2", default-features = false }

[dependencies.tokio]
version = "^1.15.0"
Expand Down
21 changes: 21 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@ impl Default for RFM69Config {
}
}

#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(default)]
pub struct MMDVMConfig {
pub port: String,
pub inverted: bool,
pub level: f32
}

impl Default for MMDVMConfig {
fn default() -> MMDVMConfig {
MMDVMConfig {
port: String::from("/dev/ttyAMA0"),
inverted: false,
level: 50.0
}
}
}

#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(default)]
pub struct AudioConfig {
Expand Down Expand Up @@ -172,6 +190,7 @@ pub enum Transmitter {
Raspager,
Raspager2,
RFM69,
MMDVM
}

impl Default for Transmitter {
Expand All @@ -189,6 +208,7 @@ impl fmt::Display for Transmitter {
Transmitter::Raspager => "Raspager1",
Transmitter::Raspager2 => "Raspager2",
Transmitter::RFM69 => "RFM69",
Transmitter::MMDVM => "MMDVM"
};
write!(f, "{}", name)
}
Expand All @@ -204,6 +224,7 @@ pub struct Config {
pub c9000: C9000Config,
pub audio: AudioConfig,
pub rfm69: RFM69Config,
pub mmdvm: MMDVMConfig
}

pub fn get() -> Config {
Expand Down
29 changes: 29 additions & 0 deletions src/frontend/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h3>Configuration</h3>
<!-- <option value="Raspager2">Raspager 2</option>-->
<option>C9000</option>
<option>RFM69</option>
<option>MMDVM</option>
</select>
</div>
<div v-if="config.master.standalone_mode !== true">
Expand Down Expand Up @@ -265,6 +266,34 @@ <h3>PTT Config</h3>
</div>
</div>

<div class="box" v-if="config.transmitter == 'MMDVM'">
<div class="box-header">
<h3>MMDVM Config</h3>
</div>
<div class="box-content">
<div class="form-row">
<div class="form-group">
<label for="mmdvm-port">Serial Port</label>
<input type="text" id="mmdvm-port"
v-model="config.mmdvm.port">
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="mmdvm-level">POCSAG TX Level: {{config.mmdvm.level}}</label>
<input type="range" id="mmdvm-level"
v-model.number="config.mmdvm.level"
step="1" min="0" max="100">
</div>
<div class="form-group">
<label for="mmdvm-inverted">Inverted</label>
<input type="checkbox" id="mmdvm-inverted"
v-model="config.mmdvm.inverted">
</div>
</div>
</div>
</div>

<div class="box">
<div class="box-header">
<h3>Send Message</h3>
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/assets/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ var vm = new Vue({
master: {},
audio: {},
c9000: {},
raspager: {}
raspager: {},
mmdvm: {}
},
telemetry: {
node: {},
Expand Down
3 changes: 3 additions & 0 deletions src/transmitter/mmdvm/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mod transmitter;

pub use self::transmitter::MMDVMTransmitter;
Loading