Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor RadioLib Task, change beacon config, fix aprs-is filter printout #305

Merged
merged 5 commits into from
Jun 8, 2023
Merged
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
21 changes: 20 additions & 1 deletion .github/workflows/build_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,26 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: Run PlatformIO Check
run: pio check --fail-on-defect high -e lora_board
run: pio check --fail-on-defect high --fail-on-defect medium --fail-on-defect low -e lora_board

cppcheck-docker:
name: Run cppcheck in Docker
runs-on: ubuntu-latest
env:
CPPCHECK_ARGS: --enable=all --std=c++20 --inline-suppr -I lib/BoardFinder -I lib/ConfigurationManagement -I lib/Display -I lib/LoRa -I lib/LoRa_APRS -I lib/NTPClient -I lib/PowerManagement -I lib/System -I lib/TimeLib -i lib/Display -i lib/LoRa -i lib/NTPClient -i lib/TimeLib src lib
steps:
- name: checkout code
uses: actions/checkout@v3
- run: docker pull facthunder/cppcheck:latest
- name: Run cppcheck and print result
run: docker run --rm -v ${PWD}:/src facthunder/cppcheck:latest /bin/bash -c "cppcheck $CPPCHECK_ARGS"
- name: Run cppcheck and create html
run: docker run --rm -v ${PWD}:/src facthunder/cppcheck:latest /bin/bash -c "cppcheck --xml $CPPCHECK_ARGS 2> report.xml && cppcheck-htmlreport --file=report.xml --report-dir=output"
- name: Upload report
uses: actions/upload-artifact@v3
with:
name: Cppcheck Report
path: output

hw_testing:
name: Hardware Testing
Expand Down
6 changes: 3 additions & 3 deletions data/is-cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"longitude": 0.000000
},
"use_gps": false,
"timeout": 15
"timeout": 15,
"send_on_hf": false
},
"aprs_is": {
"active": true,
Expand All @@ -40,8 +41,7 @@
"filter": ""
},
"digi": {
"active": false,
"beacon": false
"active": false
},
"lora": {
"frequency_rx": 433775000,
Expand Down
2 changes: 1 addition & 1 deletion lib/PowerManagement/power_management.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#include "power_management.h"

PowerManagement::PowerManagement() {
PowerManagement::PowerManagement() : axp() {
}

bool PowerManagement::begin(TwoWire &port) {
Expand Down
4 changes: 2 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ lib_deps =
knolleary/PubSubClient@^2.8
mikalhart/TinyGPSPlus @ 1.0.3
shaggydog/OneButton @ 1.5.0
jgromes/RadioLib @ 5.7.0
jgromes/RadioLib @ 6.0.0
check_tool = cppcheck
check_flags =
cppcheck: --std=c++14 --suppress=*:*.pio\* --inline-suppr --suppress=unusedFunction -DCPPCHECK --force lib -ilib/TimeLib
cppcheck: --std=c++20 --suppress=*:*.pio\* --inline-suppr --suppress=unusedFunction -DCPPCHECK --force lib -ilib/TimeLib
check_skip_packages = yes
test_build_src = yes
# activate for OTA Update, use the CALLSIGN from is-cfg.json as upload_port:
Expand Down
10 changes: 6 additions & 4 deletions src/TaskAprsIs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ bool AprsIsTask::loop(System &system) {
return false;
}

std::shared_ptr<APRSMessage> msg = _aprs_is.getAPRSMessage();
if (msg) {
_toModem.addElement(msg);
{
std::shared_ptr<APRSMessage> msg = _aprs_is.getAPRSMessage();
if (msg) {
_toModem.addElement(msg);
}
}

if (!_toAprsIs.empty()) {
Expand All @@ -44,7 +46,7 @@ bool AprsIsTask::loop(System &system) {
}

bool AprsIsTask::connect(System &system) {
system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, getName(), "connecting to APRS-IS server: %s on port: %d, with filter: '%s'", system.getUserConfig()->aprs_is.server.c_str(), system.getUserConfig()->aprs_is.port, system.getUserConfig()->aprs_is.filter);
system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, getName(), "connecting to APRS-IS server: %s on port: %d, with filter: '%s'", system.getUserConfig()->aprs_is.server.c_str(), system.getUserConfig()->aprs_is.port, system.getUserConfig()->aprs_is.filter.c_str());
APRS_IS::ConnectionStatus status = APRS_IS::ConnectionStatus::ERROR_CONNECTION;
if (system.getUserConfig()->aprs_is.filter.isEmpty()) {
status = _aprs_is.connect(system.getUserConfig()->aprs_is.server, system.getUserConfig()->aprs_is.port);
Expand Down
2 changes: 1 addition & 1 deletion src/TaskBeacon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ bool BeaconTask::sendBeacon(System &system) {
_toAprsIs.addElement(_beaconMsg);
}

if (system.getUserConfig()->digi.beacon) {
if (system.getUserConfig()->beacon.send_on_hf) {
_toModem.addElement(_beaconMsg);
}

Expand Down
2 changes: 1 addition & 1 deletion src/TaskMQTT.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class MQTTTask : public Task {
public:
MQTTTask(TaskQueue<std::shared_ptr<APRSMessage>> &toMQTT);
explicit MQTTTask(TaskQueue<std::shared_ptr<APRSMessage>> &toMQTT);
virtual ~MQTTTask();

virtual bool setup(System &system) override;
Expand Down
Loading