Skip to content

Commit 830fdc5

Browse files
committed
Remove bluetoothTest() and setBaudrate
1 parent dfa0584 commit 830fdc5

File tree

12 files changed

+22
-143
lines changed

12 files changed

+22
-143
lines changed

Firmware/RTK_Everywhere/Bluetooth.ino

Lines changed: 21 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ void bluetoothStart()
546546

547547
if (pin_bluetoothStatusLED != PIN_UNDEFINED)
548548
{
549-
bluetoothLedTask.detach(); // Reset BT LED blinker task rate to 2Hz
549+
bluetoothLedTask.detach(); // Reset BT LED blinker task rate to 2Hz
550550
bluetoothLedTask.attach(bluetoothLedTaskPace2Hz, tickerBluetoothLedUpdate); // Rate in seconds, callback
551551
}
552552

@@ -556,11 +556,11 @@ void bluetoothStart()
556556
{
557557
if (bluetoothCommandTaskHandle == nullptr)
558558
xTaskCreatePinnedToCore(
559-
bluetoothCommandTask, // Function to run
560-
"BluetoothCommandTask", // Just for humans
561-
4000, // Stack Size - must be ~4000
562-
nullptr, // Task input parameter
563-
0, // Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest
559+
bluetoothCommandTask, // Function to run
560+
"BluetoothCommandTask", // Just for humans
561+
4000, // Stack Size - must be ~4000
562+
nullptr, // Task input parameter
563+
0, // Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest
564564
&bluetoothCommandTaskHandle, // Task handle
565565
settings.bluetoothInterruptsCore); // Core where task should run, 0 = core, 1 = Arduino
566566
}
@@ -638,53 +638,10 @@ void bluetoothStop()
638638
bluetoothIncomingRTCM = false;
639639
}
640640

641-
// Test the bidirectional communication through UART connected to GNSS
642-
// TODO Make this not ZED centric
643-
void bluetoothTest(bool runTest)
641+
// Print the current Bluetooth radio configuration and connection status
642+
void bluetoothPrintStatus()
644643
{
645-
// Verify the ESP UART can communicate TX/RX to ZED UART1
646-
const char *bluetoothStatusText;
647-
648-
if (online.gnss == true)
649-
{
650-
if (runTest && (zedUartPassed == false))
651-
{
652-
tasksStopGnssUart(); // Stop absorbing serial via task from GNSS receiver
653-
654-
gnss->setBaudrate(115200 * 2);
655-
656-
serialGNSS->begin(115200 * 2, SERIAL_8N1, pin_GnssUart_RX,
657-
pin_GnssUart_TX); // Start UART on platform depedent pins for SPP. The GNSS will be
658-
// configured to output NMEA over its UART at the same rate.
659-
660-
#ifdef COMPILE_ZED
661-
SFE_UBLOX_GNSS_SERIAL myGNSS;
662-
if (myGNSS.begin(*serialGNSS) == true) // begin() attempts 3 connections
663-
{
664-
zedUartPassed = true;
665-
bluetoothStatusText = (settings.bluetoothRadioType == BLUETOOTH_RADIO_OFF) ? "Off" : "Online";
666-
}
667-
else
668-
bluetoothStatusText = "Offline";
669-
#endif // COMPILE_ZED
670-
671-
gnss->setBaudrate(settings.dataPortBaud);
672-
673-
serialGNSS->begin(settings.dataPortBaud, SERIAL_8N1, pin_GnssUart_RX,
674-
pin_GnssUart_TX); // Start UART on platform depedent pins for SPP. The GNSS will be
675-
// configured to output NMEA over its UART at the same rate.
676-
677-
tasksStartGnssUart(); // Return to normal operation
678-
}
679-
else
680-
bluetoothStatusText = (settings.bluetoothRadioType == BLUETOOTH_RADIO_OFF) ? "Off" : "Online";
681-
}
682-
else
683-
bluetoothStatusText = "GNSS Offline";
684-
685644
// Display Bluetooth MAC address and test results
686-
char macAddress[5];
687-
snprintf(macAddress, sizeof(macAddress), "%02X%02X", btMACAddress[4], btMACAddress[5]);
688645
systemPrint("Bluetooth ");
689646
if (settings.bluetoothRadioType == BLUETOOTH_RADIO_SPP_AND_BLE)
690647
systemPrint("SPP and Low Energy ");
@@ -695,8 +652,19 @@ void bluetoothTest(bool runTest)
695652
else if (settings.bluetoothRadioType == BLUETOOTH_RADIO_OFF)
696653
systemPrint("Off ");
697654

655+
char macAddress[5];
656+
snprintf(macAddress, sizeof(macAddress), "%02X%02X", btMACAddress[4], btMACAddress[5]);
698657
systemPrint("(");
699658
systemPrint(macAddress);
700-
systemPrint("): ");
701-
systemPrintln(bluetoothStatusText);
659+
systemPrint(")");
660+
661+
if (settings.bluetoothRadioType != BLUETOOTH_RADIO_OFF)
662+
{
663+
systemPrint(": ");
664+
if (bluetoothIsConnected() == false)
665+
systemPrint("Not ");
666+
systemPrint("Connected");
667+
}
668+
669+
systemPrintln();
702670
}

Firmware/RTK_Everywhere/GNSS.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,6 @@ class GNSS
331331
// Returns true when the configuration was saved and false upon failure
332332
virtual bool saveConfiguration();
333333

334-
// Set the baud rate on the GNSS port that interfaces between the ESP32 and the GNSS
335-
// This just sets the GNSS side
336-
// Used during Bluetooth testing
337-
// Inputs:
338-
// baudRate: The desired baudrate
339-
virtual bool setBaudrate(uint32_t baudRate);
340-
341334
// Enable all the valid constellations and bands for this platform
342335
virtual bool setConstellations();
343336

Firmware/RTK_Everywhere/GNSS_LG290P.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,6 @@ class GNSS_LG290P : GNSS
420420
// Returns true when the configuration was saved and false upon failure
421421
bool saveConfiguration();
422422

423-
bool setBaudrate(uint32_t baudRate);
424-
425423
bool setBaudRate(uint8_t uartNumber, uint32_t baudRate);
426424

427425
bool setCommBaudrate(uint32_t baud);

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,12 +1145,6 @@ bool GNSS_LG290P::setBaudRate(uint8_t uartNumber, uint32_t baudRate)
11451145
return (_lg290p->setPortBaudrate(uartNumber, baudRate, 250));
11461146
}
11471147

1148-
// Used only for Bluetooth test
1149-
bool GNSS_LG290P::setBaudrate(uint32_t baudRate)
1150-
{
1151-
return (setBaudRate(2, baudRate));
1152-
}
1153-
11541148
//----------------------------------------
11551149
// Return the baud rate of port nicknamed DATA
11561150
//----------------------------------------

Firmware/RTK_Everywhere/GNSS_Mosaic.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,13 +1006,6 @@ class GNSS_MOSAIC : GNSS
10061006
char *response = nullptr,
10071007
size_t responseSize = 0);
10081008

1009-
// Set the baud rate on the GNSS port that interfaces between the ESP32 and the GNSS
1010-
// This just sets the GNSS side
1011-
// Used during Bluetooth testing
1012-
// Inputs:
1013-
// baudRate: The desired baudrate
1014-
bool setBaudrate(uint32_t baudRate);
1015-
10161009
// Set the baud rate of mosaic-X5 COM1
10171010
// This is used during the Bluetooth test
10181011
// Inputs:

Firmware/RTK_Everywhere/GNSS_Mosaic.ino

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,18 +2198,6 @@ bool GNSS_MOSAIC::sendWithResponse(String message, const char *reply, unsigned l
21982198
return sendWithResponse(message.c_str(), reply, timeout, wait, response, responseSize);
21992199
}
22002200

2201-
//----------------------------------------
2202-
// Set the baud rate on the GNSS port that interfaces between the ESP32 and the GNSS
2203-
// This just sets the GNSS side
2204-
// Used during Bluetooth testing
2205-
// Inputs:
2206-
// baudRate: The desired baudrate
2207-
//----------------------------------------
2208-
bool GNSS_MOSAIC::setBaudrate(uint32_t baudRate)
2209-
{
2210-
return setBaudRateCOM(1, baudRate);
2211-
}
2212-
22132201
//----------------------------------------
22142202
// Set the baud rate of mosaic-X5 COM1
22152203
// This is used during the Bluetooth test

Firmware/RTK_Everywhere/GNSS_None.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -529,16 +529,6 @@ class GNSS_None : public GNSS
529529
return false;
530530
}
531531

532-
// Set the baud rate on the GNSS port that interfaces between the ESP32 and the GNSS
533-
// This just sets the GNSS side
534-
// Used during Bluetooth testing
535-
// Inputs:
536-
// baudRate: The desired baudrate
537-
bool setBaudrate(uint32_t baudRate)
538-
{
539-
return true;
540-
}
541-
542532
bool setBaudRate(uint8_t uartNumber, uint32_t baudRate)
543533
{
544534
return false;

Firmware/RTK_Everywhere/GNSS_UM980.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,6 @@ class GNSS_UM980 : GNSS
431431
// Returns true when the configuration was saved and false upon failure
432432
bool saveConfiguration();
433433

434-
// Set the baud rate on the GNSS port that interfaces between the ESP32 and the GNSS
435-
// This just sets the GNSS side
436-
// Used during Bluetooth testing
437-
// Inputs:
438-
// baudRate: The desired baudrate
439-
bool setBaudrate(uint32_t baudRate);
440-
441434
// Enable all the valid constellations and bands for this platform
442435
bool setConstellations();
443436

Firmware/RTK_Everywhere/GNSS_UM980.ino

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,19 +1559,6 @@ bool GNSS_UM980::saveConfiguration()
15591559
return false;
15601560
}
15611561

1562-
//----------------------------------------
1563-
// Set the baud rate on the GNSS port that interfaces between the ESP32 and the GNSS
1564-
// This just sets the GNSS side
1565-
// Used during Bluetooth testing
1566-
//----------------------------------------
1567-
bool GNSS_UM980::setBaudrate(uint32_t baudRate)
1568-
{
1569-
if (online.gnss)
1570-
// Set the baud rate on COM3 of the UM980
1571-
return setBaudRateCOM3(baudRate);
1572-
return false;
1573-
}
1574-
15751562
//----------------------------------------
15761563
// Set the baud rate on the GNSS port that interfaces between the ESP32 and the GNSS
15771564
//----------------------------------------

Firmware/RTK_Everywhere/GNSS_ZED.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -675,13 +675,6 @@ class GNSS_ZED : GNSS
675675
// Returns true when the configuration was saved and false upon failure
676676
bool saveConfiguration();
677677

678-
// Set the baud rate on the GNSS port that interfaces between the ESP32 and the GNSS
679-
// This just sets the GNSS side
680-
// Used during Bluetooth testing
681-
// Inputs:
682-
// baudRate: The desired baudrate
683-
bool setBaudrate(uint32_t baudRate);
684-
685678
// Enable all the valid constellations and bands for this platform
686679
bool setConstellations();
687680

0 commit comments

Comments
 (0)