Skip to content

Commit

Permalink
Added ability to disable APRS-IS updating (via internet)
Browse files Browse the repository at this point in the history
  • Loading branch information
d2inco committed Sep 25, 2018
1 parent 57aa4a8 commit 07333a7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ extern bool tnc_debug;
extern bool fh_debug;

// LOCAL VARS
bool aprsis_enable; // APRS-IS Enable/Disable
string aprsis_server; // APRS-IS server name/IP
unsigned short int aprsis_port; // APRS-IS port number
string aprsis_proxy; // HTTP proxy to use for APRS-IS
Expand All @@ -28,6 +29,14 @@ bool send_aprsis_http(const char* source, int source_ssid, const char* destinati
stringstream buff;
string aprsis_postdata; // we'll build this in a string since stringstream seems to drop newlines


if (aprsis_enable == 0) {
if (tnc_debug || curl_debug) {
printf("APRS-IS disabled. Not sending.\n");
}
return 1;
}

// first, build the TNC2 packet
buff << "user " << aprsis_user << " pass " << aprsis_pass << " vers PiCrumbs " << VERSION;
aprsis_postdata = buff.str();
Expand Down
2 changes: 2 additions & 0 deletions init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ extern unsigned char gpio_hf_en; // gpio pin for hf enable
extern unsigned char gpio_vhf_en; // gpio pin for vhf enable
extern string predict_path; // path to PREDICT program
extern bool gpio_enable; // can we use gpio pins
extern bool aprsis_enable; // APRS-IS enable
extern string aprsis_server; // APRS-IS server name/IP
extern unsigned short int aprsis_port; // APRS-IS port number
extern string aprsis_proxy; // HTTP proxy to use for APRS-IS
Expand Down Expand Up @@ -262,6 +263,7 @@ void init(int argc, char* argv[]) { // read config, set up serial ports, etc
unsigned short int hamlib_model = readconfig.GetInteger("radio", "model", 1); // dummy rig as default
if (hamlib_enable) radio_retune = readconfig.GetBoolean("radio", "retune", "false"); // don't try to retune if hamlib is not enabled
// aprs-is config
aprsis_enable = readconfig.GetBoolean("aprsis", "enable", "false");
aprsis_server = readconfig.Get("aprsis", "server", "rotate.aprs2.net");
aprsis_port = readconfig.GetInteger("aprsis", "port", 8080);
aprsis_proxy = readconfig.Get("aprsis", "proxy", "");
Expand Down
3 changes: 2 additions & 1 deletion picrumbs.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ path =

; APRS-IS settings
[aprsis]
enable = false
; server: name or ip address of an aprs-is server that supports http
server = rotate.aprs2.net
; port: http port of this server, usually 8080.
Expand Down Expand Up @@ -133,4 +134,4 @@ proto = 4
; psk_freq: psk63 audio frequency
psk_freq = 2100
; psk_vol: psk63 volume (in percent)
psk_vol = 100
psk_vol = 100

0 comments on commit 07333a7

Please sign in to comment.