Skip to content

Commit 4788cac

Browse files
committed
Process CLI commands first, then decide where to report them
1 parent 7dcf8af commit 4788cac

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

Firmware/RTK_Everywhere/Bluetooth.ino

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -284,23 +284,19 @@ int bluetoothCommandAvailable()
284284
}
285285

286286
// Pass a command string to the BLE Serial interface
287-
void bluetoothProcessCommand(char *rxData)
287+
void bluetoothSendCommand(char *rxData)
288288
{
289289
#ifdef COMPILE_BT
290290
// Direct output to Bluetooth Command
291291
PrintEndpoint originalPrintEndpoint = printEndpoint;
292292

293-
printEndpoint = PRINT_ENDPOINT_BLUETOOTH_COMMAND;
294-
if (settings.debugCLI == true)
295-
printEndpoint = PRINT_ENDPOINT_ALL;
296-
else
297-
printEndpoint = PRINT_ENDPOINT_BLUETOOTH_COMMAND;
293+
printEndpoint = PRINT_ENDPOINT_ALL;
298294

299-
processCommand(rxData); // Send command proccesor output to BLE
295+
systemPrint(rxData); // Send command output to BLE, SPP, and Serial
300296
printEndpoint = originalPrintEndpoint;
301297

302298
#else // COMPILE_BT
303-
processCommand(rxData); // Send command proccesor output to Serial
299+
systemPrint(rxData); // Send command output to Serial
304300
#endif // COMPILE_BT
305301
}
306302

@@ -564,9 +560,9 @@ void bluetoothStart()
564560
memcpy(record.uuid.uuid.uuid128, UUID_IAP2, sizeof(UUID_IAP2));
565561
record.service_name_length = strlen(sdp_service_name) + 1;
566562
record.service_name = (char *)sdp_service_name;
567-
//record.service_name_length = strlen(deviceName) + 1; // Doesn't seem to help the failed connects
568-
//record.service_name = (char *)deviceName;
569-
//record.rfcomm_channel_number = 1; // Doesn't seem to help the failed connects
563+
// record.service_name_length = strlen(deviceName) + 1; // Doesn't seem to help the failed connects
564+
// record.service_name = (char *)deviceName;
565+
// record.rfcomm_channel_number = 1; // Doesn't seem to help the failed connects
570566
esp_sdp_create_record((esp_bluetooth_sdp_record_t *)&record);
571567
}
572568
}

Firmware/RTK_Everywhere/Tasks.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2610,7 +2610,7 @@ void bluetoothCommandTask(void *pvParameters)
26102610
if (rxSpot > 2 && rxData[rxSpot - 1] == '\n' && rxData[rxSpot - 2] == '\r')
26112611
{
26122612
rxData[rxSpot - 2] = '\0'; // Remove \r\n
2613-
bluetoothProcessCommand(rxData);
2613+
processCommand(rxData);
26142614
rxSpot = 0; // Reset
26152615
}
26162616
}

0 commit comments

Comments
 (0)