Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BLE Service data size for Infineon P6 Platform #13554

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/platform/P6/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ extern "C" {
using namespace ::chip;
using namespace ::chip::Ble;

#define BLE_SERVICE_DATA_SIZE 10

namespace chip {
namespace DeviceLayer {
namespace Internal {
Expand Down Expand Up @@ -787,9 +789,11 @@ void BLEManagerImpl::SetAdvertisingData(void)
ChipBLEDeviceIdentificationInfo mDeviceIdInfo;
uint16_t deviceDiscriminator = 0;
uint8_t localDeviceNameLen;
uint8_t service_data[9];
uint8_t service_data[BLE_SERVICE_DATA_SIZE];
praveenCY marked this conversation as resolved.
Show resolved Hide resolved
uint8_t * p = service_data;

static_assert(BLE_SERVICE_DATA_SIZE == sizeof(ChipBLEDeviceIdentificationInfo) + 2, "BLE Service Data Size is incorrect");

// Initialize the CHIP BLE Device Identification Information block that will be sent as payload
// within the BLE service advertisement data.
err = ConfigurationMgr().GetBLEDeviceIdentificationInfo(mDeviceIdInfo);
Expand Down Expand Up @@ -838,6 +842,7 @@ void BLEManagerImpl::SetAdvertisingData(void)
UINT8_TO_STREAM(p, mDeviceIdInfo.DeviceVendorId[1]);
UINT8_TO_STREAM(p, mDeviceIdInfo.DeviceProductId[0]);
UINT8_TO_STREAM(p, mDeviceIdInfo.DeviceProductId[1]);
UINT8_TO_STREAM(p, 0); // Additional Data Flag

adv_elem[num_elem].advert_type = BTM_BLE_ADVERT_TYPE_NAME_COMPLETE;
adv_elem[num_elem].len = localDeviceNameLen;
Expand Down