Skip to content

Commit 81a9c45

Browse files
authored
Update IDF to e5b2c1c (espressif#865)
* Update BLE Library * Fix SD driver * Update toolchain * Update IDF to e5b2c1c
1 parent a3a9dd3 commit 81a9c45

File tree

119 files changed

+1175
-439
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+1175
-439
lines changed

Diff for: libraries/SD/src/sd_diskio.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ typedef struct {
5757
int status;
5858
} ardu_sdcard_t;
5959

60-
static ardu_sdcard_t* s_cards[_VOLUMES] = { NULL };
60+
static ardu_sdcard_t* s_cards[FF_VOLUMES] = { NULL };
6161

6262
/*
6363
* SD SPI
@@ -645,7 +645,7 @@ DRESULT ff_sd_ioctl(uint8_t pdrv, uint8_t cmd, void* buff)
645645
uint8_t sdcard_uninit(uint8_t pdrv)
646646
{
647647
ardu_sdcard_t * card = s_cards[pdrv];
648-
if (pdrv >= _VOLUMES || card == NULL) {
648+
if (pdrv >= FF_VOLUMES || card == NULL) {
649649
return 1;
650650
}
651651
ff_diskio_register(pdrv, NULL);
@@ -700,7 +700,7 @@ uint8_t sdcard_init(uint8_t cs, SPIClass * spi, int hz)
700700
uint8_t sdcard_unmount(uint8_t pdrv)
701701
{
702702
ardu_sdcard_t * card = s_cards[pdrv];
703-
if (pdrv >= _VOLUMES || card == NULL) {
703+
if (pdrv >= FF_VOLUMES || card == NULL) {
704704
return 1;
705705
}
706706
card->status |= STA_NOINIT;
@@ -714,7 +714,7 @@ uint8_t sdcard_unmount(uint8_t pdrv)
714714
bool sdcard_mount(uint8_t pdrv, const char* path)
715715
{
716716
ardu_sdcard_t * card = s_cards[pdrv];
717-
if(pdrv >= _VOLUMES || card == NULL){
717+
if(pdrv >= FF_VOLUMES || card == NULL){
718718
return false;
719719
}
720720

@@ -748,15 +748,15 @@ bool sdcard_mount(uint8_t pdrv, const char* path)
748748
uint32_t sdcard_num_sectors(uint8_t pdrv)
749749
{
750750
ardu_sdcard_t * card = s_cards[pdrv];
751-
if(pdrv >= _VOLUMES || card == NULL){
751+
if(pdrv >= FF_VOLUMES || card == NULL){
752752
return 0;
753753
}
754754
return card->sectors;
755755
}
756756

757757
uint32_t sdcard_sector_size(uint8_t pdrv)
758758
{
759-
if(pdrv >= _VOLUMES || s_cards[pdrv] == NULL){
759+
if(pdrv >= FF_VOLUMES || s_cards[pdrv] == NULL){
760760
return 0;
761761
}
762762
return 512;
@@ -765,7 +765,7 @@ uint32_t sdcard_sector_size(uint8_t pdrv)
765765
sdcard_type_t sdcard_type(uint8_t pdrv)
766766
{
767767
ardu_sdcard_t * card = s_cards[pdrv];
768-
if(pdrv >= _VOLUMES || card == NULL){
768+
if(pdrv >= FF_VOLUMES || card == NULL){
769769
return CARD_NONE;
770770
}
771771
return card->type;

Diff for: package/package_esp32_index.template.json

+18-18
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
{
3434
"packager": "esp32",
3535
"name": "xtensa-esp32-elf-gcc",
36-
"version": "1.22.0-73-ge28a011-5.2.0"
36+
"version": "1.22.0-75-gbaf03c2-5.2.0"
3737
},
3838
{
3939
"packager": "esp32",
@@ -51,35 +51,35 @@
5151
"tools": [
5252
{
5353
"name": "xtensa-esp32-elf-gcc",
54-
"version": "1.22.0-73-ge28a011-5.2.0",
54+
"version": "1.22.0-75-gbaf03c2-5.2.0",
5555
"systems": [
5656
{
5757
"host": "i686-mingw32",
58-
"url": "https://dl.espressif.com/dl/xtensa-esp32-elf-win32-1.22.0-73-ge28a011-5.2.0.zip",
59-
"archiveFileName": "xtensa-esp32-elf-win32-1.22.0-73-ge28a011-5.2.0.zip",
60-
"checksum": "SHA-256:97566173909b20567b99ec1b0f5746e341d65961f82fdb760a00937193d03d29",
61-
"size": "78710389"
58+
"url": "https://dl.espressif.com/dl/xtensa-esp32-elf-win32-1.22.0-75-gbaf03c2-5.2.0.zip",
59+
"archiveFileName": "xtensa-esp32-elf-win32-1.22.0-75-gbaf03c2-5.2.0.zip",
60+
"checksum": "SHA-256:b1735be3a24c3aa5edc672a67aeaa0bf0922c01d514a6bb905d5cd3d6fb86399",
61+
"size": "78900581"
6262
},
6363
{
6464
"host": "x86_64-apple-darwin",
65-
"url": "https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-73-ge28a011-5.2.0.tar.gz",
66-
"archiveFileName": "xtensa-esp32-elf-osx-1.22.0-73-ge28a011-5.2.0.tar.gz",
67-
"checksum": "SHA-256:5eb503462eb7f6a41c0d6c0538b512ab35a0f76ce96514a4e7a6074f6b3ad0d0",
68-
"size": "39903635"
65+
"url": "https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-75-gbaf03c2-5.2.0.tar.gz",
66+
"archiveFileName": "xtensa-esp32-elf-osx-1.22.0-75-gbaf03c2-5.2.0.tar.gz",
67+
"checksum": "SHA-256:8bdaef8c88fa5e111837587e1ebd2af93125cba96a6ec7d717fe14803723a69b",
68+
"size": "39897281"
6969
},
7070
{
7171
"host": "x86_64-pc-linux-gnu",
72-
"url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-73-ge28a011-5.2.0.tar.gz",
73-
"archiveFileName": "xtensa-esp32-elf-linux64-1.22.0-73-ge28a011-5.2.0.tar.gz",
74-
"checksum": "SHA-256:3763dbed9fd43901c07757622e9c46d29e89eda812b83627df5cb9d019cae0e5",
75-
"size": "37656793"
72+
"url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-75-gbaf03c2-5.2.0.tar.gz",
73+
"archiveFileName": "xtensa-esp32-elf-linux64-1.22.0-75-gbaf03c2-5.2.0.tar.gz",
74+
"checksum": "SHA-256:c65a719545b773149cad7008c618053443f57a9c15e4ad60877ccce0a5eef82a",
75+
"size": "37642712"
7676
},
7777
{
7878
"host": "i686-pc-linux-gnu",
79-
"url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-73-ge28a011-5.2.0.tar.gz",
80-
"archiveFileName": "xtensa-esp32-elf-linux32-1.22.0-73-ge28a011-5.2.0.tar.gz",
81-
"checksum": "SHA-256:1d8b1dd16223dcb5181af7d713582cf7f22db36c0865d9fcff7b51cfac460641",
82-
"size": "38991614"
79+
"url": "https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-75-gbaf03c2-5.2.0.tar.gz",
80+
"archiveFileName": "xtensa-esp32-elf-linux32-1.22.0-75-gbaf03c2-5.2.0.tar.gz",
81+
"checksum": "SHA-256:040f7e230941c785e44936236913b1c0585594f140880e2c34758b7be8709cf6",
82+
"size": "38978071"
8383
}
8484
]
8585
},

Diff for: platform.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ compiler.warning_flags.all=-Wall -Werror=all -Wextra
2222

2323
compiler.path={runtime.tools.xtensa-esp32-elf-gcc.path}/bin/
2424
compiler.sdk.path={runtime.platform.path}/tools/sdk
25-
compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/bluedroid" "-I{compiler.sdk.path}/include/app_trace" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/esp_adc_cal" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/heap" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mbedtls_port" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/spiffs" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/wear_levelling" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/lwip"
25+
compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/bluedroid" "-I{compiler.sdk.path}/include/app_trace" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/esp_adc_cal" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/heap" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mbedtls_port" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/spiffs" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/wear_levelling" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/lwip"
2626

2727
compiler.c.cmd=xtensa-esp32-elf-gcc
2828
compiler.c.flags=-std=gnu99 -Os -g3 -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wpointer-arith {compiler.warning_flags} -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -MMD -c
@@ -35,7 +35,7 @@ compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls
3535

3636
compiler.c.elf.cmd=xtensa-esp32-elf-gcc
3737
compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy
38-
compiler.c.elf.libs=-lgcc -lcxx -lstdc++ -lapp_trace -lapp_update -lbootloader_support -lbt -lbtdm_app -lc -lc_nano -lcoap -lcoexist -lconsole -lcore -ldriver -lesp32 -lesp_adc_cal -lespnow -lethernet -lexpat -lfatfs -lfreertos -lhal -lheap -ljsmn -ljson -llog -llwip -lm -lmbedtls -lmdns -lmicro-ecc -lnet80211 -lnewlib -lnghttp -lnvs_flash -lopenssl -lphy -lpp -lpthread -lrtc -lsdmmc -lsmartconfig -lsoc -lspi_flash -lspiffs -ltcpip_adapter -lulp -lvfs -lwear_levelling -lwpa -lwpa2 -lwpa_supplicant -lwps -lxtensa-debug-module
38+
compiler.c.elf.libs=-lgcc -lopenssl -lbtdm_app -lfatfs -lwps -lcoexist -lidf_test -lwear_levelling -lhal -lnewlib -ldriver -lbootloader_support -lpp -lsmartconfig -ljsmn -lwpa -lethernet -lphy -lapp_trace -lconsole -lulp -lwpa_supplicant -lfreertos -lbt -lmicro-ecc -lcxx -lxtensa-debug-module -lmdns -lvfs -lsoc -lcore -lsdmmc -lcoap -ltcpip_adapter -lc_nano -lrtc -lspi_flash -lwpa2 -lesp32 -lapp_update -lnghttp -lspiffs -lespnow -lnvs_flash -lesp_adc_cal -llog -lexpat -lm -lc -lheap -lmbedtls -llwip -lnet80211 -lpthread -ljson -lstdc++
3939

4040
compiler.as.cmd=xtensa-esp32-elf-as
4141

Diff for: tools/platformio-build.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
join(FRAMEWORK_DIR, "tools", "sdk", "ld")
9595
],
9696
LIBS=[
97-
"gcc", "app_trace", "app_update", "bootloader_support", "bt", "btdm_app", "c", "c_nano", "coap", "coexist", "console", "core", "cxx", "driver", "esp32", "esp_adc_cal", "espnow", "ethernet", "expat", "fatfs", "freertos", "hal", "heap", "jsmn", "json", "log", "lwip", "m", "mbedtls", "mdns", "micro-ecc", "net80211", "newlib", "nghttp", "nvs_flash", "openssl", "phy", "pp", "pthread", "rtc", "sdmmc", "smartconfig", "soc", "spi_flash", "spiffs", "tcpip_adapter", "ulp", "vfs", "wear_levelling", "wpa", "wpa2", "wpa_supplicant", "wps", "xtensa-debug-module", "stdc++"
97+
"gcc", "openssl", "btdm_app", "fatfs", "wps", "coexist", "idf_test", "wear_levelling", "hal", "newlib", "driver", "bootloader_support", "pp", "smartconfig", "jsmn", "wpa", "ethernet", "phy", "app_trace", "console", "ulp", "wpa_supplicant", "freertos", "bt", "micro-ecc", "cxx", "xtensa-debug-module", "mdns", "vfs", "soc", "core", "sdmmc", "coap", "tcpip_adapter", "c_nano", "rtc", "spi_flash", "wpa2", "esp32", "app_update", "nghttp", "spiffs", "espnow", "nvs_flash", "esp_adc_cal", "log", "expat", "m", "c", "heap", "mbedtls", "lwip", "net80211", "pthread", "json", "stdc++"
9898
],
9999

100100
UPLOADERFLAGS=[

Diff for: tools/sdk/bin/bootloader.bin

1.17 KB
Binary file not shown.

Diff for: tools/sdk/bin/bootloader_qio.bin

1.16 KB
Binary file not shown.

Diff for: tools/sdk/include/bluedroid/alarm.h

+15-20
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,21 @@
2020
#define _ALARM_H_
2121

2222
#include <stdint.h>
23-
#include <freertos/FreeRTOS.h>
24-
#include <freertos/timers.h>
23+
#include "esp_timer.h"
2524

26-
typedef uint32_t period_ms_t;
27-
typedef void (*osi_alarm_callback_t)(void *data);
25+
typedef struct alarm_t osi_alarm_t;
26+
typedef uint64_t period_ms_t;
27+
typedef esp_timer_cb_t osi_alarm_callback_t;
28+
29+
typedef enum {
30+
OSI_ALARM_ERR_PASS = 0,
31+
OSI_ALARM_ERR_FAIL = -1,
32+
OSI_ALARM_ERR_INVALID_ARG = -2,
33+
OSI_ALARM_ERR_INVALID_STATE = -3,
34+
} osi_alarm_err_t;
2835

2936
#define ALARM_CBS_NUM 30
3037
#define ALARM_ID_BASE 1000
31-
typedef struct alarm_t {
32-
/* timer id point to here */
33-
TimerHandle_t alarm_hdl;
34-
osi_alarm_callback_t cb;
35-
void *cb_data;
36-
} osi_alarm_t;
3738

3839
int osi_alarm_create_mux(void);
3940
int osi_alarm_delete_mux(void);
@@ -42,27 +43,25 @@ void osi_alarm_deinit(void);
4243

4344
// Creates a new alarm object. The returned object must be freed by calling
4445
// |alarm_free|. Returns NULL on failure.
45-
osi_alarm_t *osi_alarm_new(char *alarm_name, osi_alarm_callback_t callback, void *data, period_ms_t timer_expire);
46+
osi_alarm_t *osi_alarm_new(const char *alarm_name, osi_alarm_callback_t callback, void *data, period_ms_t timer_expire);
4647

4748
// Frees an alarm object created by |alarm_new|. |alarm| may be NULL. If the
4849
// alarm is pending, it will be cancelled. It is not safe to call |alarm_free|
4950
// from inside the callback of |alarm|.
50-
int osi_alarm_free(osi_alarm_t *alarm);
51+
void osi_alarm_free(osi_alarm_t *alarm);
5152

5253
// Sets an alarm to fire |cb| after the given |deadline|. Note that |deadline| is the
5354
// number of milliseconds relative to the current time. |data| is a context variable
5455
// for the callback and may be NULL. |cb| will be called back in the context of an
5556
// unspecified thread (i.e. it will not be called back in the same thread as the caller).
5657
// |alarm| and |cb| may not be NULL.
57-
int osi_alarm_set(osi_alarm_t *alarm, period_ms_t timeout);
58+
osi_alarm_err_t osi_alarm_set(osi_alarm_t *alarm, period_ms_t timeout);
5859

5960
// This function cancels the |alarm| if it was previously set. When this call
6061
// returns, the caller has a guarantee that the callback is not in progress and
6162
// will not be called if it hasn't already been called. This function is idempotent.
6263
// |alarm| may not be NULL.
63-
int osi_alarm_cancel(osi_alarm_t *alarm);
64-
65-
period_ms_t osi_alarm_now(void);
64+
osi_alarm_err_t osi_alarm_cancel(osi_alarm_t *alarm);
6665

6766
// Figure out how much time until next expiration.
6867
// Returns 0 if not armed. |alarm| may not be NULL.
@@ -72,10 +71,6 @@ period_ms_t osi_alarm_get_remaining_ms(const osi_alarm_t *alarm);
7271
// Alarm-related state cleanup
7372
//void alarm_cleanup(void);
7473

75-
// Compute time difference (t1-t2) considering tick counter wrap
76-
// t1 and t2 should be no greater than the time of MAX ticks
77-
period_ms_t osi_alarm_time_diff(period_ms_t t1, period_ms_t t2);
78-
7974
uint32_t osi_time_get_os_boottime_ms(void);
8075

8176
#endif /*_ALARM_H_*/

Diff for: tools/sdk/include/bluedroid/bt_target.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -681,11 +681,15 @@
681681
/* The maximum number of simultaneous channels that L2CAP can support. Up to 16*/
682682
#ifndef MAX_L2CAP_CHANNELS
683683
#if (CLASSIC_BT_INCLUDED == TRUE)
684-
#define MAX_L2CAP_CHANNELS 8
684+
#define MAX_L2CAP_CHANNELS 16
685685
#else
686+
#if (SMP_INCLUDED == FALSE)
686687
#define MAX_L2CAP_CHANNELS MAX_ACL_CONNECTIONS //This is used in the BLE client when start connected with the peer device
688+
#else
689+
#define MAX_L2CAP_CHANNELS (MAX_ACL_CONNECTIONS * 2) //This is used in the BLE client when start connected with the peer device and in SMP
690+
#endif ///SMP_INCLUDED == FALSE
687691
#endif ///CLASSIC_BT_INCLUDED == TRUE
688-
#endif
692+
#endif ///MAX_L2CAP_CHANNELS
689693

690694
/* The maximum number of simultaneous applications that can register with L2CAP. */
691695
#ifndef MAX_L2CAP_CLIENTS

Diff for: tools/sdk/include/bluedroid/bta_gatt_api.h

+12-2
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ typedef UINT8 tBTA_GATT_STATUS;
182182
#define BTA_GATTC_CONNECT_EVT 35 /* GATTC CONNECT event */
183183
#define BTA_GATTC_DISCONNECT_EVT 36 /* GATTC DISCONNECT event */
184184
#define BTA_GATTC_READ_MUTIPLE_EVT 37 /* GATTC Read mutiple event */
185+
#define BTA_GATTC_QUEUE_FULL_EVT 38 /* GATTC queue full event */
185186

186187
typedef UINT8 tBTA_GATTC_EVT;
187188

@@ -298,6 +299,7 @@ typedef struct {
298299
UINT16 conn_id;
299300
tBTA_GATT_STATUS status;
300301
UINT16 handle;
302+
UINT16 offset;
301303
}tBTA_GATTC_WRITE;
302304

303305
typedef struct {
@@ -354,6 +356,12 @@ typedef struct {
354356
BOOLEAN congested; /* congestion indicator */
355357
} tBTA_GATTC_CONGEST;
356358

359+
typedef struct {
360+
tBTA_GATT_STATUS status;
361+
UINT16 conn_id;
362+
BOOLEAN is_full;
363+
} tBTA_GATTC_QUEUE_FULL;
364+
357365
typedef struct {
358366
tBTA_GATT_STATUS status;
359367
tBTA_GATTC_IF client_if;
@@ -367,14 +375,13 @@ typedef struct {
367375
} tBTA_GATTC_ENC_CMPL_CB;
368376

369377
typedef struct {
370-
tBTA_GATT_STATUS status;
371378
UINT16 conn_id;
372379
tBTA_GATTC_IF client_if;
373380
BD_ADDR remote_bda;
374381
} tBTA_GATTC_CONNECT;
375382

376383
typedef struct {
377-
tBTA_GATT_STATUS status;
384+
tGATT_DISCONN_REASON reason;
378385
UINT16 conn_id;
379386
tBTA_GATTC_IF client_if;
380387
BD_ADDR remote_bda;
@@ -400,6 +407,7 @@ typedef union {
400407
BD_ADDR remote_bda; /* service change event */
401408
tBTA_GATTC_CFG_MTU cfg_mtu; /* configure MTU operation */
402409
tBTA_GATTC_CONGEST congest;
410+
tBTA_GATTC_QUEUE_FULL queue_full;
403411
} tBTA_GATTC;
404412

405413
/* GATTC enable callback function */
@@ -523,6 +531,8 @@ typedef struct {
523531
UINT32 trans_id;
524532
UINT16 conn_id;
525533
tBTA_GATTS_REQ_DATA *p_data;
534+
UINT16 data_len;
535+
UINT8 *value;
526536
} tBTA_GATTS_REQ;
527537

528538
typedef struct {

Diff for: tools/sdk/include/bluedroid/bta_gattc_int.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ typedef struct {
310310
tBTA_GATTC_RCB *p_rcb; /* pointer to the registration CB */
311311
tBTA_GATTC_SERV *p_srcb; /* server cache CB */
312312
tBTA_GATTC_DATA *p_q_cmd; /* command in queue waiting for execution */
313-
313+
list_t *p_cmd_list; /* The list to store the command to be sent */
314+
BOOLEAN is_full; /* The gattc command queue is full or not */
314315
#define BTA_GATTC_NO_SCHEDULE 0
315316
#define BTA_GATTC_DISC_WAITING 0x01
316317
#define BTA_GATTC_REQ_WAITING 0x10
@@ -425,6 +426,7 @@ extern void bta_gattc_read(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
425426
extern void bta_gattc_write(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
426427
extern void bta_gattc_op_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
427428
extern void bta_gattc_q_cmd(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
429+
extern void bta_gattc_free_command_data(tBTA_GATTC_CLCB *p_clcb);
428430
extern void bta_gattc_search(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
429431
extern void bta_gattc_fail(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
430432
extern void bta_gattc_confirm(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
@@ -438,9 +440,8 @@ extern void bta_gattc_init_bk_conn(tBTA_GATTC_API_OPEN *p_data, tBTA_GATTC_RCB *
438440
extern void bta_gattc_cancel_bk_conn(tBTA_GATTC_API_CANCEL_OPEN *p_data);
439441
extern void bta_gattc_send_open_cback( tBTA_GATTC_RCB *p_clreg, tBTA_GATT_STATUS status,
440442
BD_ADDR remote_bda, UINT16 conn_id, tBTA_TRANSPORT transport, UINT16 mtu);
441-
extern void bta_gattc_send_connect_cback( tBTA_GATTC_RCB *p_clreg, tBTA_GATT_STATUS status,
442-
BD_ADDR remote_bda, UINT16 conn_id);
443-
extern void bta_gattc_send_disconnect_cback( tBTA_GATTC_RCB *p_clreg, tBTA_GATT_STATUS status,
443+
extern void bta_gattc_send_connect_cback( tBTA_GATTC_RCB *p_clreg, BD_ADDR remote_bda, UINT16 conn_id);
444+
extern void bta_gattc_send_disconnect_cback( tBTA_GATTC_RCB *p_clreg, tGATT_DISCONN_REASON reason,
444445
BD_ADDR remote_bda, UINT16 conn_id);
445446
extern void bta_gattc_process_api_refresh(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_msg);
446447
extern void bta_gattc_cfg_mtu(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);

0 commit comments

Comments
 (0)