Skip to content

Commit b28cffd

Browse files
committed
Return to built-in BluetoothSerial library.
Congestion testing was causing problems. The current library works well at 10Hz.
1 parent a732e80 commit b28cffd

10 files changed

+13
-1553
lines changed

Firmware/RTK_Surveyor/Bluetooth.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ byte bluetoothGetState()
7373
bool bluetoothIsCongested()
7474
{
7575
#ifdef COMPILE_BT
76-
return bluetoothSerial->isCongested();
76+
//return bluetoothSerial->isCongested();
77+
return false;
7778
#else //COMPILE_BT
7879
return false;
7980
#endif //COMPILE_BT
@@ -121,7 +122,7 @@ void bluetoothStart()
121122
else
122123
bluetoothSerial = new BTClassicSerial();
123124

124-
if (bluetoothSerial->begin(deviceName, false, settings.sppRxQueueSize, settings.sppTxQueueSize) == false) //localName, isMaster, rxBufferSize, txBufferSize
125+
if (bluetoothSerial->begin(deviceName) == false)
125126
{
126127
Serial.println("An error occurred initializing Bluetooth");
127128

Firmware/RTK_Surveyor/bluetoothSelect.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#ifdef COMPILE_BT
22

3-
#include "src/BluetoothSerial/BluetoothSerial.h"
3+
#include "BluetoothSerial.h"
44
#include <BleSerial.h> // Click here to get the library: http://librarymanager/All#ESP32_BleSerial by Avinab Malla
55

66
class BTSerialInterface
77
{
88
public:
9-
virtual bool begin(String deviceName, bool isMaster, uint16_t rxQueueSize, uint16_t txQueueSize) = 0;
9+
virtual bool begin(String deviceName) = 0;
1010
virtual void disconnect() = 0;
1111
virtual void end() = 0;
1212
virtual esp_err_t register_callback(esp_spp_cb_t * callback) = 0;
@@ -15,7 +15,7 @@ class BTSerialInterface
1515
virtual int available() = 0;
1616
virtual size_t readBytes(uint8_t *buffer, size_t bufferSize) = 0;
1717

18-
virtual bool isCongested() = 0;
18+
//virtual bool isCongested() = 0;
1919
virtual size_t write(const uint8_t *buffer, size_t size) = 0;
2020
virtual void flush() = 0;
2121
};
@@ -26,9 +26,9 @@ class BTClassicSerial : public virtual BTSerialInterface, public BluetoothSerial
2626
// Everything is already implemented in BluetoothSerial since the code was
2727
// originally written using that class
2828
public:
29-
bool begin(String deviceName, bool isMaster, uint16_t rxQueueSize, uint16_t txQueueSize)
29+
bool begin(String deviceName)
3030
{
31-
return BluetoothSerial::begin(deviceName, isMaster, rxQueueSize, txQueueSize);
31+
return BluetoothSerial::begin(deviceName);
3232
}
3333

3434
void disconnect()
@@ -63,7 +63,10 @@ class BTClassicSerial : public virtual BTSerialInterface, public BluetoothSerial
6363

6464
bool isCongested()
6565
{
66-
return BluetoothSerial::isCongested();
66+
// Removed congestion testing in v2.4
67+
// TODO Remove settings and checking
68+
return(false);
69+
//return BluetoothSerial::isCongested();
6770
}
6871

6972
size_t write(const uint8_t *buffer, size_t size)
@@ -82,10 +85,8 @@ class BTLESerial: public virtual BTSerialInterface, public BleSerial
8285
{
8386
public:
8487
// Missing from BleSerial
85-
bool begin(String deviceName, bool isMaster, uint16_t rxQueueSuze, uint16_t txQueueSize)
88+
bool begin(String deviceName)
8689
{
87-
// Curretnly ignoring rxQueueSize
88-
// transmitBufferLength = txQueueSize;
8990
BleSerial::begin(deviceName.c_str());
9091
return true;
9192
}

Firmware/RTK_Surveyor/src/BluetoothSerial/BTAddress.cpp

Lines changed: 0 additions & 96 deletions
This file was deleted.

Firmware/RTK_Surveyor/src/BluetoothSerial/BTAddress.h

Lines changed: 0 additions & 36 deletions
This file was deleted.

Firmware/RTK_Surveyor/src/BluetoothSerial/BTAdvertisedDevice.h

Lines changed: 0 additions & 65 deletions
This file was deleted.

Firmware/RTK_Surveyor/src/BluetoothSerial/BTAdvertisedDeviceSet.cpp

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)