This commit is contained in:
Peter Buchegger 2021-12-19 22:27:29 +01:00
parent 6f2fd7e959
commit a87c3ddb76
4 changed files with 32 additions and 31 deletions

View file

@ -1,23 +1,21 @@
{
"debug": false,
"enhance_precision": true,
"beacons":
[
"beacons": [
{
"callsign": "NOCALL-7",
"path": "WIDE1-1",
"message": "LoRa Tracker",
"timeout": 1,
"symbol": "[",
"overlay": "/"
}
],
"button":
{
"button": {
"tx": true,
"alt_message": true
},
"smart_beacon":
{
"smart_beacon": {
"active": true,
"turn_min": 25,
"slow_rate": 300,
@ -27,8 +25,7 @@
"min_tx_dist": 100,
"min_bcn": 5
},
"lora":
{
"lora": {
"frequency_rx": 433775000,
"frequency_tx": 433775000,
"power": 20,
@ -36,8 +33,7 @@
"signal_bandwidth": 125000,
"coding_rate4": 5
},
"ptt_output":
{
"ptt_output": {
"active": false,
"io_pin": 4,
"start_delay": 0,

View file

@ -197,6 +197,7 @@ void loop() {
String dao;
msg.setSource(beacon.callsign);
msg.setPath(beacon.path);
msg.setDestination("APLT00-1");
if (!Config.enhance_precision) {

View file

@ -43,6 +43,8 @@ Configuration ConfigurationManagement::readConfiguration() {
if (v.containsKey("callsign"))
beacon.callsign = v["callsign"].as<String>();
if (v.containsKey("path"))
beacon.path = v["path"].as<String>();
if (v.containsKey("message"))
beacon.message = v["message"].as<String>();
beacon.timeout = v["timeout"] | 1;
@ -95,6 +97,7 @@ void ConfigurationManagement::writeConfiguration(Configuration conf) {
for (Configuration::Beacon beacon : conf.beacons) {
JsonObject v = beacons.createNestedObject();
v["callsign"] = beacon.callsign;
v["path"] = beacon.path;
v["message"] = beacon.message;
v["timeout"] = beacon.timeout;
v["symbol"] = beacon.symbol;

View file

@ -1,8 +1,8 @@
#ifndef CONFIGURATION_H_
#define CONFIGURATION_H_
#include <list>
#include <iterator>
#include <list>
#include <Arduino.h>
@ -10,10 +10,11 @@ class Configuration {
public:
class Beacon {
public:
Beacon() : callsign("NOCALL-10"), message("LoRa Tracker, Info: github.com/lora-aprs/LoRa_APRS_Tracker"), timeout(1), symbol("["), overlay("/") {
Beacon() : callsign("NOCALL-10"), path("WIDE1-1"), message("LoRa Tracker"), timeout(1), symbol("["), overlay("/") {
}
String callsign;
String path;
String message;
int timeout;
String symbol;
@ -69,7 +70,7 @@ public:
int alt_message;
};
Configuration() : debug(false), enhance_precision(true), current_beacon_index(0) {};
Configuration() : debug(false), enhance_precision(true), current_beacon_index(0){};
bool debug;
bool enhance_precision;