Skip to content

Commit 145625d

Browse files
committed
!deleteme: Temp commit
This is just to get things compiling.
1 parent fbb2833 commit 145625d

5 files changed

Lines changed: 331 additions & 6 deletions

File tree

lib/pbio/drv/bluetooth/bluetooth_btstack.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
// Bluetooth driver using BlueKitchen BTStack.
55

6+
#include <btstack_config.h>
67
#include <pbdrv/config.h>
78

89
#if PBDRV_CONFIG_BLUETOOTH_BTSTACK
@@ -21,9 +22,10 @@
2122
#include <classic/sdp_client.h>
2223
#include <classic/sdp_server.h>
2324
#include <classic/spp_server.h>
25+
#include <gap.h>
26+
#include <lwrb/lwrb.h>
2427
#include <pbsys/storage.h>
2528
#include <pbsys/storage_settings.h>
26-
#include <lwrb/lwrb.h>
2729

2830
#if HAVE_UMM_MALLOC
2931
#include <umm_malloc.h>
@@ -61,7 +63,7 @@
6163
#define PERIPHERAL_TIMEOUT_MS_CONNECT (5000)
6264
#define PERIPHERAL_TIMEOUT_MS_PAIRING (5000)
6365

64-
#define DEBUG 0
66+
#define DEBUG 2
6567

6668
#if DEBUG
6769
#include <pbio/debug.h>
@@ -1847,6 +1849,7 @@ pbio_error_t pbdrv_bluetooth_rfcomm_listen(
18471849
// ready when the bluetooth system is initialized, but it will be ready by
18481850
// the time we try to make any rfcomm connections.
18491851
link_db_settings_load_once();
1852+
gap_discoverable_control(1);
18501853

18511854
sock = pbdrv_bluetooth_classic_rfcomm_socket_alloc();
18521855
if (!sock) {
@@ -1884,11 +1887,12 @@ pbio_error_t pbdrv_bluetooth_rfcomm_listen(
18841887
}
18851888

18861889
DEBUG_PRINT("[btc:rfcomm_listen] Connected\n");
1890+
gap_discoverable_control(0);
18871891

18881892
PBIO_OS_ASYNC_END(PBIO_SUCCESS);
18891893

1890-
cleanup:
1891-
;
1894+
cleanup:;
1895+
gap_discoverable_control(0);
18921896
pbio_error_t err = sock->err;
18931897
pbdrv_bluetooth_classic_rfcomm_socket_reset(sock);
18941898
return err;

lib/pbio/platform/virtual_hub/btstack_config.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,24 @@
6060
#define MAX_NR_MESH_TRANSPORT_KEYS 16
6161
#define MAX_NR_MESH_VIRTUAL_ADDRESSES 16
6262

63+
#define MAX_ATT_DB_SIZE 512
64+
#define MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES 20
65+
#define MAX_NR_HCI_CONNECTIONS 7 // CC2560/A limit.
66+
#define MAX_NR_HFP_CONNECTIONS 0
67+
// Up to 7 RFCOMM channels, plus 2 for transient use.
68+
#define MAX_NR_L2CAP_CHANNELS 9
69+
#define MAX_NR_L2CAP_SERVICES 7
70+
// We can have up to 7 connections, so we keep one extra spare.
71+
#define MAX_NR_RFCOMM_CHANNELS 8
72+
// We have one rfcomm service for the SPP profile.
73+
#define MAX_NR_RFCOMM_MULTIPLEXERS 1
74+
#define MAX_NR_RFCOMM_SERVICES 1
75+
#define MAX_NR_SERVICE_RECORD_ITEMS 1
76+
#define MAX_NR_SM_LOOKUP_ENTRIES 3
77+
#define MAX_NR_WHITELIST_ENTRIES 0
78+
#define MAX_NR_LE_DEVICE_DB_ENTRIES 3
79+
#define MAX_NR_SDP_CLIENTS 1
80+
6381
// allow for one NetKey update
6482
#define MAX_NR_MESH_NETWORK_KEYS (MAX_NR_MESH_SUBNETS + 1)
6583

lib/pbio/platform/virtual_hub/pbdrvconfig.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#define PBDRV_CONFIG_BLUETOOTH_BTSTACK (1)
1717
#define PBDRV_CONFIG_BLUETOOTH_BTSTACK_LE_SERVER (1)
1818
#define PBDRV_CONFIG_BLUETOOTH_BTSTACK_POSIX (1)
19+
#define PBDRV_CONFIG_BLUETOOTH_BTSTACK_CLASSIC (1)
20+
1921
#define PBDRV_CONFIG_BLUETOOTH_BTSTACK_HUB_KIND (LWP3_HUB_KIND_TECHNIC_LARGE)
2022
#endif // PBDRV_CONFIG_RUN_ON_CI
2123

lib/pbio/platform/virtual_hub/pbsysconfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@
2828
#define PBSYS_CONFIG_TELEMETRY (1)
2929
#define PBSYS_CONFIG_USER_PROGRAM (0)
3030
#define PBSYS_CONFIG_PROGRAM_STOP (1)
31+
#define PBSYS_CONFIG_BLUETOOTH_CLASSIC_LINK_KEY_DB_SIZE (2 + 20 * 23)

0 commit comments

Comments
 (0)