fix(bt): Fix ble periodic advertising data length 0 error

- Fixed issues about data length 0 when set ext adv data,ext scan rsp data and periodic adv data
This commit is contained in:
zhanghaipeng
2023-07-18 15:33:23 +08:00
parent f5fb6a6696
commit f83664929a
3 changed files with 23 additions and 28 deletions
@@ -2853,7 +2853,7 @@ void BTA_DmBleGapConfigExtAdvDataRaw(BOOLEAN is_scan_rsp, UINT8 instance, UINT16
p_msg->is_scan_rsp = is_scan_rsp;
p_msg->instance = instance;
p_msg->length = length;
p_msg->data = (UINT8 *)(p_msg + 1);
p_msg->data = length != 0 ? (UINT8 *)(p_msg + 1) : NULL;
if (data) {
memcpy(p_msg->data, data, length);
}
@@ -2943,6 +2943,7 @@ void BTA_DmBleGapPeriodicAdvCfgDataRaw(UINT8 instance, UINT16 length,
p_msg->length = length;
p_msg->data = (UINT8 *)(p_msg + 1);
memcpy(p_msg->data, data, length);
p_msg->data = length != 0 ? (UINT8 *)(p_msg + 1) : NULL;
//start sent the msg to the bta system control moudle
bta_sys_sendmsg(p_msg);
} else {