Skip to content

Commit 21cda94

Browse files
committed
Update example 15 to use setSocketReadCallbackPlus for binary compatibility
1 parent 2f9d637 commit 21cda94

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/SARA-R5_Example15_GNSS_NTRIP_Caster_With_Callbacks/SARA-R5_Callbacks.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
22

33
// processSocketData is provided to the SARA-R5 library via a
4-
// callback setter -- setSocketReadCallback. (See setup())
5-
void processSocketData(int socket, String theData)
4+
// callback setter -- setSocketReadCallbackPlus. (See setup())
5+
void processSocketData(int socket, const char *theData, int dataLength, IPAddress remoteAddress, int remotePort)
66
{
77
Serial.print(F("processSocketData: Data received on socket "));
88
Serial.print(socket);
99
Serial.print(F(". Length is "));
10-
Serial.print(theData.length());
10+
Serial.print(dataLength);
1111

1212
if (connectionOpen)
1313
{
1414
Serial.println(F(". Pushing it to the GNSS..."));
15-
myGNSS.pushRawData((uint8_t *)theData.c_str(), theData.length());
15+
myGNSS.pushRawData((uint8_t *)theData, (size_t)dataLength);
1616

1717
lastReceivedRTCM_ms = millis(); // Update lastReceivedRTCM_ms
1818
}

examples/SARA-R5_Example15_GNSS_NTRIP_Caster_With_Callbacks/SARA-R5_Example15_GNSS_NTRIP_Caster_With_Callbacks.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void setup()
183183

184184
// Set a callback to process the socket data
185185
// This will push the RTCM data to the GNSS
186-
mySARA.setSocketReadCallback(&processSocketData);
186+
mySARA.setSocketReadCallbackPlus(&processSocketData);
187187

188188
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
189189

0 commit comments

Comments
 (0)