Skip to content

Commit df7d5c1

Browse files
committed
Add endpoint for counting size of a transfer
1 parent ec5b17f commit df7d5c1

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

Firmware/RTK_Everywhere/menuCommands.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
char otaOutcome[21] = {0}; // Modified by otaUpdate(), used to respond to rtkRemoteFirmwareVersion commands
2+
int systemWriteLength = 0; // Modified by systemWrite(), used to calculate the size of LIST command for CLI
23

34
void menuCommands()
45
{

Firmware/RTK_Everywhere/settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ typedef enum
478478
PRINT_ENDPOINT_BLUETOOTH,
479479
PRINT_ENDPOINT_BLUETOOTH_COMMAND,
480480
PRINT_ENDPOINT_ALL,
481+
PRINT_ENDPOINT_COUNT,
481482
} PrintEndpoint;
482483
PrintEndpoint printEndpoint = PRINT_ENDPOINT_SERIAL; // Controls where the configuration menu gets piped to
483484

Firmware/RTK_Everywhere/support.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ void systemWrite(const uint8_t *buffer, uint16_t length)
6060
{
6161
bluetoothCommandWrite(buffer, length);
6262
}
63+
64+
// We're just adding up the size of the list, don't pass along to serial port
65+
else if (printEndpoint == PRINT_ENDPOINT_COUNT)
66+
{
67+
systemWriteLength += length;
68+
}
6369
}
6470

6571
// Forward GNSS data to the USB serial port
@@ -1202,4 +1208,3 @@ void WeekToWToUnixEpoch(uint64_t *unixEpoch, uint16_t GPSWeek, uint32_t GPSToW)
12021208
*unixEpoch += GPSToW; // 518400
12031209
*unixEpoch += 315964800;
12041210
}
1205-

0 commit comments

Comments
 (0)