]> granicus.if.org Git - esp-idf/commitdiff
Component/bt: fix iPhoneX error when getting wifi list
authorzhiweijian <zhiweijian@espressif.com>
Tue, 18 Sep 2018 12:48:28 +0000 (20:48 +0800)
committerzhiweijian <zhiweijian@espressif.com>
Wed, 19 Sep 2018 07:17:57 +0000 (15:17 +0800)
components/bt/bluedroid/btc/profile/esp/blufi/blufi_prf.c
components/bt/bluedroid/btc/profile/esp/blufi/include/blufi_int.h

index 56be5fb61bd754dfe2431189b5385878262e3a10..873b5ed843f74adb2d024fc6ee664b3c6676933e 100644 (file)
@@ -206,7 +206,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
         break;
     case BTA_GATTS_MTU_EVT:
         BLUFI_TRACE_DEBUG("MTU size %d\n", p_data->req_data.p_data->mtu);
-        blufi_env.frag_size = p_data->req_data.p_data->mtu - BLUFI_MTU_RESERVED_SIZE;
+        blufi_env.frag_size = (p_data->req_data.p_data->mtu < BLUFI_MAX_DATA_LEN ? p_data->req_data.p_data->mtu : BLUFI_MAX_DATA_LEN) - BLUFI_MTU_RESERVED_SIZE;
         break;
     case BTA_GATTS_CONF_EVT:
         BLUFI_TRACE_DEBUG("CONFIRM EVT\n");
index eab51ad85c48b3fe3dbcb95a13d1907b226b7d06..08be6703f5f8705d4a62c9008a904d68c0e94a32 100644 (file)
@@ -72,6 +72,7 @@ typedef struct blufi_frag_hdr blufi_frag_hdr_t;
 #define BLUFI_DATA_SEC_MODE_ENC_MASK    0x02  
 #define BLUFI_CTRL_SEC_MODE_CHECK_MASK  0x10  
 #define BLUFI_CTRL_SEC_MODE_ENC_MASK    0x20
+#define BLUFI_MAX_DATA_LEN              255
 
 // packet type
 #define BLUFI_TYPE_MASK         0x03