@@ -598,7 +598,7 @@ void bluetoothStart()
598
598
599
599
if (pin_bluetoothStatusLED != PIN_UNDEFINED)
600
600
{
601
- bluetoothLedTask.detach (); // Reset BT LED blinker task rate to 2Hz
601
+ bluetoothLedTask.detach (); // Reset BT LED blinker task rate to 2Hz
602
602
bluetoothLedTask.attach (bluetoothLedTaskPace2Hz, tickerBluetoothLedUpdate); // Rate in seconds, callback
603
603
}
604
604
@@ -608,11 +608,11 @@ void bluetoothStart()
608
608
{
609
609
if (bluetoothCommandTaskHandle == nullptr )
610
610
xTaskCreatePinnedToCore (
611
- bluetoothCommandTask, // Function to run
612
- " BluetoothCommandTask" , // Just for humans
613
- 4000 , // Stack Size - must be ~4000
614
- nullptr , // Task input parameter
615
- 0 , // Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest
611
+ bluetoothCommandTask, // Function to run
612
+ " BluetoothCommandTask" , // Just for humans
613
+ 4000 , // Stack Size - must be ~4000
614
+ nullptr , // Task input parameter
615
+ 0 , // Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest
616
616
&bluetoothCommandTaskHandle, // Task handle
617
617
settings.bluetoothInterruptsCore ); // Core where task should run, 0 = core, 1 = Arduino
618
618
}
@@ -696,53 +696,10 @@ void bluetoothStop()
696
696
bluetoothIncomingRTCM = false ;
697
697
}
698
698
699
- // Test the bidirectional communication through UART connected to GNSS
700
- // TODO Make this not ZED centric
701
- void bluetoothTest (bool runTest)
699
+ // Print the current Bluetooth radio configuration and connection status
700
+ void bluetoothPrintStatus ()
702
701
{
703
- // Verify the ESP UART can communicate TX/RX to ZED UART1
704
- const char *bluetoothStatusText;
705
-
706
- if (online.gnss == true )
707
- {
708
- if (runTest && (zedUartPassed == false ))
709
- {
710
- tasksStopGnssUart (); // Stop absorbing serial via task from GNSS receiver
711
-
712
- gnss->setBaudrate (115200 * 2 );
713
-
714
- serialGNSS->begin (115200 * 2 , SERIAL_8N1, pin_GnssUart_RX,
715
- pin_GnssUart_TX); // Start UART on platform depedent pins for SPP. The GNSS will be
716
- // configured to output NMEA over its UART at the same rate.
717
-
718
- #ifdef COMPILE_ZED
719
- SFE_UBLOX_GNSS_SERIAL myGNSS;
720
- if (myGNSS.begin (*serialGNSS) == true ) // begin() attempts 3 connections
721
- {
722
- zedUartPassed = true ;
723
- bluetoothStatusText = (settings.bluetoothRadioType == BLUETOOTH_RADIO_OFF) ? " Off" : " Online" ;
724
- }
725
- else
726
- bluetoothStatusText = " Offline" ;
727
- #endif // COMPILE_ZED
728
-
729
- gnss->setBaudrate (settings.dataPortBaud );
730
-
731
- serialGNSS->begin (settings.dataPortBaud , SERIAL_8N1, pin_GnssUart_RX,
732
- pin_GnssUart_TX); // Start UART on platform depedent pins for SPP. The GNSS will be
733
- // configured to output NMEA over its UART at the same rate.
734
-
735
- tasksStartGnssUart (); // Return to normal operation
736
- }
737
- else
738
- bluetoothStatusText = (settings.bluetoothRadioType == BLUETOOTH_RADIO_OFF) ? " Off" : " Online" ;
739
- }
740
- else
741
- bluetoothStatusText = " GNSS Offline" ;
742
-
743
702
// Display Bluetooth MAC address and test results
744
- char macAddress[5 ];
745
- snprintf (macAddress, sizeof (macAddress), " %02X%02X" , btMACAddress[4 ], btMACAddress[5 ]);
746
703
systemPrint (" Bluetooth " );
747
704
if (settings.bluetoothRadioType == BLUETOOTH_RADIO_SPP_AND_BLE)
748
705
systemPrint (" SPP and Low Energy " );
@@ -755,8 +712,19 @@ void bluetoothTest(bool runTest)
755
712
else if (settings.bluetoothRadioType == BLUETOOTH_RADIO_OFF)
756
713
systemPrint (" Off " );
757
714
715
+ char macAddress[5 ];
716
+ snprintf (macAddress, sizeof (macAddress), " %02X%02X" , btMACAddress[4 ], btMACAddress[5 ]);
758
717
systemPrint (" (" );
759
718
systemPrint (macAddress);
760
- systemPrint (" ): " );
761
- systemPrintln (bluetoothStatusText);
719
+ systemPrint (" )" );
720
+
721
+ if (settings.bluetoothRadioType != BLUETOOTH_RADIO_OFF)
722
+ {
723
+ systemPrint (" : " );
724
+ if (bluetoothIsConnected () == false )
725
+ systemPrint (" Not " );
726
+ systemPrint (" Connected" );
727
+ }
728
+
729
+ systemPrintln ();
762
730
}
0 commit comments