Skip to content

Commit 6c3269a

Browse files
committed
Update LoraSendAndReceive example to show only binary data
1 parent 0161ef0 commit 6c3269a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

examples/LoraSendAndReceive/LoraSendAndReceive.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LoRaModem modem;
1111
// Uncomment if using the Murata chip as a module
1212
// LoRaModem modem(Serial1);
1313

14-
#include "arduino_secrets.h"
14+
#include "arduino_secrets.h"
1515
// Please enter your sensitive data in the Secret tab or arduino_secrets.h
1616
String appEui = SECRET_APP_EUI;
1717
String appKey = SECRET_APP_KEY;
@@ -76,15 +76,15 @@ void loop() {
7676
Serial.println("No downlink message received at this time.");
7777
return;
7878
}
79-
String rcv;
80-
rcv.reserve(64);
79+
char rcv[64];
80+
int i = 0;
8181
while (modem.available()) {
82-
rcv += (char)modem.read();
82+
rcv[i++] = (char)modem.read();
8383
}
84-
Serial.print("Received: " + rcv + " - ");
85-
for (unsigned int i = 0; i < rcv.length(); i++) {
86-
Serial.print(rcv[i] >> 4, HEX);
87-
Serial.print(rcv[i] & 0xF, HEX);
84+
Serial.print("Received: ");
85+
for (unsigned int j = 0; j < i; j++) {
86+
Serial.print(rcv[j] >> 4, HEX);
87+
Serial.print(rcv[j] & 0xF, HEX);
8888
Serial.print(" ");
8989
}
9090
Serial.println();

0 commit comments

Comments
 (0)