Skip to content

Commit aa4e55c

Browse files
committed
Update BTSerial library with ESP32 core v2.0.2
1 parent be2c50d commit aa4e55c

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

Firmware/RTK_Surveyor/src/BluetoothSerial/BTAddress.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Author: Thomas M. (ArcticSnowSky)
88
*/
99
#include "sdkconfig.h"
10-
#if defined(CONFIG_BT_ENABLED)
10+
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
1111

1212
#include "BTAddress.h"
1313
#include <string>

Firmware/RTK_Surveyor/src/BluetoothSerial/BTAddress.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#ifndef COMPONENTS_CPP_UTILS_BTADDRESS_H_
1111
#define COMPONENTS_CPP_UTILS_BTADDRESS_H_
1212
#include "sdkconfig.h"
13-
#if defined(CONFIG_BT_ENABLED)
13+
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
1414
#include <esp_gap_bt_api.h> // ESP32 BT
1515
#include <string>
1616

Firmware/RTK_Surveyor/src/BluetoothSerial/BTAdvertisedDeviceSet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
#include "sdkconfig.h"
9-
#if defined(CONFIG_BT_ENABLED)
9+
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
1010

1111
//#include <map>
1212

Firmware/RTK_Surveyor/src/BluetoothSerial/BTScanResultsSet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
#include "sdkconfig.h"
9-
#if defined(CONFIG_BT_ENABLED)
9+
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
1010

1111

1212
#include <esp_err.h>

Firmware/RTK_Surveyor/src/BluetoothSerial/BluetoothSerial.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,9 @@
4141
const char * _spp_server_name = "ESP32SPP";
4242

4343
//Now passed in during begin()
44-
//#define RX_QUEUE_SIZE (512 * 4) //Increase to facilitate larger NTRIP transfers
45-
//#define TX_QUEUE_SIZE 512 //Increase to facilitate high transmission rates
46-
4744
//#define RX_QUEUE_SIZE 512 //Original
4845
//#define TX_QUEUE_SIZE 32
46+
4947
#define SPP_TX_QUEUE_TIMEOUT 1000
5048
#define SPP_TX_DONE_TIMEOUT 1000
5149
#define SPP_CONGESTED_TIMEOUT 1000
@@ -542,6 +540,7 @@ static void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *pa
542540
}
543541
}
544542

543+
//static bool _init_bt(const char *deviceName)
545544
static bool _init_bt(const char *deviceName, uint16_t rxQueueSize, uint16_t txQueueSize)
546545
{
547546
if(!_bt_event_group){
@@ -563,13 +562,15 @@ static bool _init_bt(const char *deviceName, uint16_t rxQueueSize, uint16_t txQu
563562
xEventGroupSetBits(_spp_event_group, SPP_DISCONNECTED);
564563
}
565564
if (_spp_rx_queue == NULL){
565+
//_spp_rx_queue = xQueueCreate(RX_QUEUE_SIZE, sizeof(uint8_t)); //initialize the queue
566566
_spp_rx_queue = xQueueCreate(rxQueueSize, sizeof(uint8_t)); //initialize the queue
567567
if (_spp_rx_queue == NULL){
568568
log_e("RX Queue Create Failed");
569569
return false;
570570
}
571571
}
572572
if (_spp_tx_queue == NULL){
573+
//_spp_tx_queue = xQueueCreate(TX_QUEUE_SIZE, sizeof(spp_packet_t*)); //initialize the queue
573574
_spp_tx_queue = xQueueCreate(txQueueSize, sizeof(spp_packet_t*)); //initialize the queue
574575
if (_spp_tx_queue == NULL){
575576
log_e("TX Queue Create Failed");
@@ -728,12 +729,14 @@ BluetoothSerial::~BluetoothSerial(void)
728729
_stop_bt();
729730
}
730731

732+
//bool BluetoothSerial::begin(String localName, bool isMaster)
731733
bool BluetoothSerial::begin(String localName, bool isMaster, uint16_t rxQueueSize, uint16_t txQueueSize)
732734
{
733735
_isMaster = isMaster;
734736
if (localName.length()){
735737
local_name = localName;
736738
}
739+
//return _init_bt(local_name.c_str());
737740
return _init_bt(local_name.c_str(), rxQueueSize, txQueueSize);
738741
}
739742

@@ -1027,5 +1030,4 @@ BluetoothSerial::operator bool() const
10271030
bool BluetoothSerial::isCongested(){
10281031
return(!(xEventGroupGetBits(_spp_event_group) & SPP_CONGESTED));
10291032
}
1030-
10311033
#endif

0 commit comments

Comments
 (0)