[APRS] Fix string conversion in examples

This commit is contained in:
jgromes 2024-09-11 21:05:01 +02:00
parent 8aedf53272
commit 400382b1e7
3 changed files with 24 additions and 8 deletions

View file

@ -66,15 +66,20 @@ void loop() {
Serial.print(F("[APRS] Sending position ... "));
// send a location without message or timestamp
int state = aprs.sendPosition("N0CALL", 0, "4911.67N", "01635.96E");
char destination[] = "N0CALL";
char latitude[] = "4911.67N";
char longitude[] = "01635.96E";
int state = aprs.sendPosition(destination, 0, latitude, longitude);
delay(500);
// send a location with message and without timestamp
state |= aprs.sendPosition("N0CALL", 0, "4911.67N", "01635.96E", "I'm here!");
char message[] = "I'm here!";
state |= aprs.sendPosition(destination, 0, latitude, longitude, message);
delay(500);
// send a location with message and timestamp
state |= aprs.sendPosition("N0CALL", 0, "4911.67N", "01635.96E", "I'm here!", "093045z");
char timestamp[] = "093045z";
state |= aprs.sendPosition(destination, 0, latitude, longitude, message, timestamp);
delay(500);
if(state == RADIOLIB_ERR_NONE) {

View file

@ -108,15 +108,20 @@ void loop() {
Serial.print(F("[APRS] Sending position ... "));
// send a location without message or timestamp
int state = aprs.sendPosition("N0CALL", 0, "4911.67N", "01635.96E");
char destination[] = "N0CALL";
char latitude[] = "4911.67N";
char longitude[] = "01635.96E";
int state = aprs.sendPosition(destination, 0, latitude, longitude);
delay(500);
// send a location with message and without timestamp
state |= aprs.sendPosition("N0CALL", 0, "4911.67N", "01635.96E", "I'm here!");
char message[] = "I'm here!";
state |= aprs.sendPosition(destination, 0, latitude, longitude, message);
delay(500);
// send a location with message and timestamp
state |= aprs.sendPosition("N0CALL", 0, "4911.67N", "01635.96E", "I'm here!", "093045z");
char timestamp[] = "093045z";
state |= aprs.sendPosition(destination, 0, latitude, longitude, message, timestamp);
delay(500);
if(state == RADIOLIB_ERR_NONE) {

View file

@ -62,7 +62,8 @@ void setup() {
// symbol: '>' (car)
// callsign "N7LEM"
// SSID 1
state = aprs.begin('>', "N7LEM", 1);
char source[] = "N7LEM";
state = aprs.begin('>', source, 1);
if(state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
@ -77,7 +78,12 @@ void loop() {
// send a location with message and timestamp
// SSID is set to 1, as APRS over LoRa uses WIDE1-1 path by default
int state = aprs.sendPosition("GPS", 1, "4911.67N", "01635.96E", "I'm here!", "093045z");
char destination[] = "GPS";
char latitude[] = "4911.67N";
char longitude[] = "01635.96E";
char message[] = "I'm here!";
char timestamp[] = "093045z";
int state = aprs.sendPosition(destination, 1, latitude, longitude, message, timestamp);
delay(500);
// you can also send Mic-E encoded messages