From d67911537931d84d58334366c55e7f7f03bccb07 Mon Sep 17 00:00:00 2001 From: linruihao Date: Mon, 16 Dec 2024 19:39:38 +0800 Subject: [PATCH] change(bt/bluedroid): Some minor changes in bluedroid - Increase the number of BTM security records for services - Fix a coding style issue in OBEX and GOEP --- components/bt/host/bluedroid/common/include/common/bt_target.h | 2 +- components/bt/host/bluedroid/stack/goep/goepc_api.c | 2 +- components/bt/host/bluedroid/stack/obex/obex_api.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/bt/host/bluedroid/common/include/common/bt_target.h b/components/bt/host/bluedroid/common/include/common/bt_target.h index 3142335694..c7dff7606d 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -956,7 +956,7 @@ /* The number of security records for services. 32 AS Default*/ #ifndef BTM_SEC_MAX_SERVICE_RECORDS -#define BTM_SEC_MAX_SERVICE_RECORDS 8 // 32 +#define BTM_SEC_MAX_SERVICE_RECORDS 32 #endif /* If True, force a retrieval of remote device name for each bond in case it's changed */ diff --git a/components/bt/host/bluedroid/stack/goep/goepc_api.c b/components/bt/host/bluedroid/stack/goep/goepc_api.c index 350e80c9c2..06be8f59cb 100644 --- a/components/bt/host/bluedroid/stack/goep/goepc_api.c +++ b/components/bt/host/bluedroid/stack/goep/goepc_api.c @@ -359,7 +359,7 @@ UINT16 GOEPC_RequestAddHeader(UINT16 handle, UINT8 header_id, const UINT8 *data, break; } - if ((data == NULL) ^ (data_len == 0)) { + if ((data == NULL && data_len != 0) || (data != NULL && data_len == 0)) { ret = GOEP_INVALID_PARAM; break; } diff --git a/components/bt/host/bluedroid/stack/obex/obex_api.c b/components/bt/host/bluedroid/stack/obex/obex_api.c index 8851a0f81a..0ebf14bf6d 100644 --- a/components/bt/host/bluedroid/stack/obex/obex_api.c +++ b/components/bt/host/bluedroid/stack/obex/obex_api.c @@ -491,7 +491,7 @@ UINT16 OBEX_AppendHeaderRaw(BT_HDR *pkt, UINT8 header_id, const UINT8 *data, UIN return OBEX_INVALID_PARAM; } - if ((data == NULL) ^ (data_len == 0)) { + if ((data == NULL && data_len != 0) || (data != NULL && data_len == 0)) { return OBEX_INVALID_PARAM; }