Skip to content

Commit e621b0c

Browse files
committed
Allow for remote query of entire properties list
1 parent 9b3d9c6 commit e621b0c

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

Firmware/LoRaSerial_Firmware/Commands.ino

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,9 +707,13 @@ void trimCommand()
707707
//Show current settings in user friendly way
708708
void displayParameters()
709709
{
710-
for (uint8_t x = 0 ; x <= 25 ; x++)
710+
for (uint8_t x = 0 ; x <= 26 ; x++)
711711
{
712-
systemPrint("S");
712+
if (printerEndpoint == PRINT_TO_RF)
713+
systemPrint("R"); //If someone is asking for our settings over RF, respond with 'R' style settings
714+
else
715+
systemPrint("S");
716+
713717
systemPrint(x);
714718
systemPrint(":");
715719

Firmware/LoRaSerial_Firmware/LoRaSerial_Firmware.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ const int trainWithDefaultsButtonTime = 10000; //ms press and hold before enteri
134134
//uint8_t serialReceiveBuffer[512]; //Conserve RAM due to limitations
135135
uint8_t serialReceiveBuffer[32]; //Conserve RAM due to limitations
136136
#else
137-
uint8_t serialReceiveBuffer[1024 * 4]; //Buffer up to 1s of bytes at 4k
138-
uint8_t serialTransmitBuffer[1024 * 4]; //Buffer up to 1s of bytes at 4k
137+
uint8_t serialReceiveBuffer[1024 * 4]; //Bytes received from UART waiting to be RF transmitted. Buffer up to 1s of bytes at 4k
138+
uint8_t serialTransmitBuffer[1024 * 4]; //Bytes received from RF waiting to be printed out UART. Buffer up to 1s of bytes at 4k
139139
#endif
140140

141141
uint16_t txHead = 0;

Firmware/LoRaSerial_Firmware/States.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ void updateRadioState()
190190
sendCommandDataPacket();
191191
}
192192

193-
printerEndpoint = PRINT_TO_SERIAL; //Once the response is received, we need to print it to serial
193+
if(availableTXCommandBytes() == 0)
194+
printerEndpoint = PRINT_TO_SERIAL; //Once the response is received, we need to print it to serial
194195

195196
changeState(RADIO_LINKED_TRANSMITTING);
196197
}

Firmware/LoRaSerial_Firmware/System.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,12 @@ uint8_t charToHex(char a, char b)
250250
b = toupper(b);
251251

252252
if ('0' <= a && a <= '9') a -= '0';
253-
if ('A' <= a && a <= 'F') a = a - 'A' + 10;
253+
else if ('A' <= a && a <= 'F') a = a - 'A' + 10;
254+
else return 0;
254255

255256
if ('0' <= b && b <= '9') b -= '0';
256-
if ('A' <= b && b <= 'F') b = b - 'A' + 10;
257+
else if ('A' <= b && b <= 'F') b = b - 'A' + 10;
258+
else return 0;
257259

258260
return((a << 4) | b);
259261
}

0 commit comments

Comments
 (0)