Skip to content

Commit 825206f

Browse files
committed
Dynamically change NTRIP server name using platform prefix
1 parent f15afa2 commit 825206f

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,7 @@ void beginFuelGauge()
444444
//Begin accelerometer if available
445445
void beginAccelerometer()
446446
{
447-
//if (accel.begin() == false)
448-
if (1)
447+
if (accel.begin() == false)
449448
{
450449
online.accelerometer = false;
451450

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ uint32_t sdUsedSpaceMB = 0;
135135

136136
WiFiClient caster;
137137
#endif
138-
const char * ntrip_server_name = "SparkFun_RTK_Surveyor";
139138

140139
unsigned long lastServerSent_ms = 0; //Time of last data pushed to caster
141140
unsigned long lastServerReport_ms = 0; //Time of last report of caster bytes sent

Firmware/RTK_Surveyor/States.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ void updateSystemState()
302302
const int SERVER_BUFFER_SIZE = 512;
303303
char serverBuffer[SERVER_BUFFER_SIZE];
304304

305-
snprintf(serverBuffer, SERVER_BUFFER_SIZE, "SOURCE %s /%s\r\nSource-Agent: NTRIP %s/v%d.%d\r\n\r\n",
306-
settings.mountPointPW, settings.mountPoint, ntrip_server_name, FIRMWARE_VERSION_MAJOR, FIRMWARE_VERSION_MINOR);
305+
snprintf(serverBuffer, SERVER_BUFFER_SIZE, "SOURCE %s /%s\r\nSource-Agent: NTRIP SparkFun_RTK_%s/v%d.%d\r\n\r\n",
306+
settings.mountPointPW, settings.mountPoint, platformPrefix, FIRMWARE_VERSION_MAJOR, FIRMWARE_VERSION_MINOR);
307307

308308
//Serial.printf("Sending credentials:\n%s\n\r", serverBuffer);
309309
caster.write(serverBuffer, strlen(serverBuffer));
@@ -476,8 +476,8 @@ void updateSystemState()
476476
const int SERVER_BUFFER_SIZE = 512;
477477
char serverBuffer[SERVER_BUFFER_SIZE];
478478

479-
snprintf(serverBuffer, SERVER_BUFFER_SIZE, "SOURCE %s /%s\r\nSource-Agent: NTRIP %s/v%d.%d\r\n\r\n",
480-
settings.mountPointPW, settings.mountPoint, ntrip_server_name, FIRMWARE_VERSION_MAJOR, FIRMWARE_VERSION_MINOR);
479+
snprintf(serverBuffer, SERVER_BUFFER_SIZE, "SOURCE %s /%s\r\nSource-Agent: NTRIP SparkFun_RTK_%s/v%d.%d\r\n\r\n",
480+
settings.mountPointPW, settings.mountPoint, platformPrefix, FIRMWARE_VERSION_MAJOR, FIRMWARE_VERSION_MINOR);
481481

482482
//Serial.printf("Sending credentials:\n%s\n\r", serverBuffer);
483483
caster.write(serverBuffer, strlen(serverBuffer));

0 commit comments

Comments
 (0)