Skip to content

Commit 1dc5c34

Browse files
committed
Remove BT Congestion settings
Left over from Bluetooth congestion settings (and custom BT implementation)
1 parent 57b298e commit 1dc5c34

File tree

6 files changed

+10
-64
lines changed

6 files changed

+10
-64
lines changed

Firmware/RTK_Surveyor/Bluetooth.ino

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,6 @@ byte bluetoothGetState()
6969
#endif //COMPILE_BT
7070
}
7171

72-
//Determine if the Bluetooth link is congested
73-
bool bluetoothIsCongested()
74-
{
75-
#ifdef COMPILE_BT
76-
//return bluetoothSerial->isCongested();
77-
return false;
78-
#else //COMPILE_BT
79-
return false;
80-
#endif //COMPILE_BT
81-
}
82-
8372
//Read data from the Bluetooth device
8473
int bluetoothReadBytes(uint8_t * buffer, int length)
8574
{

Firmware/RTK_Surveyor/NVM.ino

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ void recordSystemSettingsToFile(File * settingsFile)
181181
settingsFile->printf("%s=%d\n\r", "sppTxQueueSize", settings.sppTxQueueSize);
182182
settingsFile->printf("%s=%d\n\r", "dynamicModel", settings.dynamicModel);
183183
settingsFile->printf("%s=%d\n\r", "lastState", settings.lastState);
184-
settingsFile->printf("%s=%d\n\r", "throttleDuringSPPCongestion", settings.throttleDuringSPPCongestion);
185184
settingsFile->printf("%s=%d\n\r", "enableSensorFusion", settings.enableSensorFusion);
186185
settingsFile->printf("%s=%d\n\r", "autoIMUmountAlignment", settings.autoIMUmountAlignment);
187186
settingsFile->printf("%s=%d\n\r", "enableResetDisplay", settings.enableResetDisplay);
@@ -688,8 +687,6 @@ bool parseLine(char* str, Settings *settings)
688687
settings->updateZEDSettings = true;
689688
}
690689
}
691-
else if (strcmp(settingName, "throttleDuringSPPCongestion") == 0)
692-
settings->throttleDuringSPPCongestion = d;
693690
else if (strcmp(settingName, "enableSensorFusion") == 0)
694691
{
695692
if (settings->enableSensorFusion != d)

Firmware/RTK_Surveyor/Tasks.ino

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ void F9PSerialWriteTask(void *e)
1414
{
1515
//Pass bytes to GNSS receiver
1616
int s = bluetoothReadBytes(wBuffer, sizeof(wBuffer));
17-
17+
1818
//TODO - control if this RTCM source should be listened to or not
1919
serialGNSS.write(wBuffer, s);
2020
bluetoothIncomingRTCM = true;
21-
if(!inMainMenu) log_d("Bluetooth received %d RTCM bytes, sent to ZED", s);
21+
if (!inMainMenu) log_d("Bluetooth received %d RTCM bytes, sent to ZED", s);
2222

2323
if (settings.enableTaskReports == true)
2424
Serial.printf("SerialWriteTask High watermark: %d\n\r", uxTaskGetStackHighWaterMark(NULL));
@@ -170,34 +170,17 @@ void F9PSerialReadTask(void *e)
170170
if ((btTail + btBytesToSend) >= sizeof(rBuffer))
171171
btBytesToSend = sizeof(rBuffer) - btTail;
172172

173-
if ((bluetoothIsCongested() == false) || (settings.throttleDuringSPPCongestion == false))
173+
//Push new data to BT SPP if not congested or not throttling
174+
btBytesToSend = bluetoothWriteBytes(&rBuffer[btTail], btBytesToSend);
175+
if (btBytesToSend > 0)
174176
{
175-
//Push new data to BT SPP if not congested or not throttling
176-
btBytesToSend = bluetoothWriteBytes(&rBuffer[btTail], btBytesToSend);
177-
if (btBytesToSend > 0)
178-
{
179-
//If we are in base mode, assume part of the outgoing data is RTCM
180-
if (systemState >= STATE_BASE_NOT_STARTED && systemState <= STATE_BASE_FIXED_TRANSMITTING)
181-
bluetoothOutgoingRTCM = true;
182-
}
183-
else
184-
log_w("BT failed to send");
177+
//If we are in base mode, assume part of the outgoing data is RTCM
178+
if (systemState >= STATE_BASE_NOT_STARTED && systemState <= STATE_BASE_FIXED_TRANSMITTING)
179+
bluetoothOutgoingRTCM = true;
185180
}
186181
else
187-
{
188-
//Don't push data to BT SPP if there is congestion to prevent heap hits.
189-
if (btBytesToSend >= (sizeof(rBuffer) - 1))
190-
{
191-
//Error - no more room in the buffer, drop a buffer's worth of data
192-
btTail = dataHead;
193-
Serial.printf("ERROR - BT congestion dropped %d bytes: GNSS --> Bluetooth\r\n", btBytesToSend);
194-
}
195-
else
196-
{
197-
log_w("BT congestion delayed %d bytes, Tasks.ino line %d", btBytesToSend, __LINE__);
198-
btBytesToSend = 0;
199-
}
200-
}
182+
log_w("BT failed to send");
183+
201184

202185
//Account for the sent or dropped data
203186
btTail += btBytesToSend;

Firmware/RTK_Surveyor/bluetoothSelect.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ class BTClassicSerial : public virtual BTSerialInterface, public BluetoothSerial
6161
return BluetoothSerial::readBytes(buffer, bufferSize);
6262
}
6363

64-
bool isCongested()
65-
{
66-
// Removed congestion testing in v2.4
67-
// TODO Remove settings and checking
68-
return(false);
69-
//return BluetoothSerial::isCongested();
70-
}
71-
7264
size_t write(const uint8_t *buffer, size_t size)
7365
{
7466
return BluetoothSerial::write(buffer, size);
@@ -122,12 +114,6 @@ class BTLESerial: public virtual BTSerialInterface, public BleSerial
122114
return BleSerial::readBytes(buffer, bufferSize);
123115
}
124116

125-
bool isCongested()
126-
{
127-
// not currently supported in this implementation
128-
return false;
129-
}
130-
131117
size_t write(const uint8_t *buffer, size_t size)
132118
{
133119
return BleSerial::write(buffer, size);

Firmware/RTK_Surveyor/menuSystem.ino

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,6 @@ void menuDebug()
321321
Serial.print("6) Set SPP TX Buffer Size: ");
322322
Serial.println(settings.sppTxQueueSize);
323323

324-
Serial.print("7) Throttle BT Transmissions During SPP Congestion: ");
325-
if (settings.throttleDuringSPPCongestion == true) Serial.println("Enabled");
326-
else Serial.println("Disabled");
327-
328324
Serial.printf("8) Display Reset Counter: %d - ", settings.resetCount);
329325
if (settings.enableResetDisplay == true) Serial.println("Enabled");
330326
else Serial.println("Disabled");
@@ -465,10 +461,6 @@ void menuDebug()
465461
settings.sppTxQueueSize = queSize; //Recorded to NVM and file at main menu exit
466462
}
467463
}
468-
else if (incoming == 7)
469-
{
470-
settings.throttleDuringSPPCongestion ^= 1;
471-
}
472464
else if (incoming == 8)
473465
{
474466
settings.enableResetDisplay ^= 1;

Firmware/RTK_Surveyor/settings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ typedef struct {
294294
uint16_t sppTxQueueSize = 512;
295295
uint8_t dynamicModel = DYN_MODEL_PORTABLE;
296296
SystemState lastState = STATE_ROVER_NOT_STARTED; //For Express, start unit in last known state
297-
bool throttleDuringSPPCongestion = true;
298297
bool enableSensorFusion = false; //If IMU is available, avoid using it unless user specifically selects automotive
299298
bool autoIMUmountAlignment = true; //Allows unit to automatically establish device orientation in vehicle
300299
bool enableResetDisplay = false;

0 commit comments

Comments
 (0)