Skip to content

BLE_for_ESP32_Arduino Manufacturer's data with a null character #12050

@profor-cloud

Description

@profor-cloud

Board

ESP32

Device Description

LOLIN32

Hardware Configuration

none

Version

v3.3.4

Type

Task

IDE Name

Arduino IDE 2.3.6

Operating System

Windows 10

Flash frequency

40

PSRAM enabled

yes

Upload speed

115200

Description

Hi,
While copying the BLE ManufacturerData from a real device to simulate the device,
I noticed the data is treated like a string, so a zero char half-way is treated like an end of string.
But in my case a zero is in the Manufacturor data, and can't set vendor_ID or additional vendor specific data properly when it contains a zero with this code.

Sketch

String manufacturerData = "\xEC\xB1\xAC\x00\xB6\x7c";
advertisementData.setManufacturerData(manufacturerData);
pAdvertising->setAdvertisementData(advertisementData);
// When looking with a BLE 'scanner' all after the first zero is basically chopped off.

Debug Message

Done

Other Steps to Reproduce

Arduino_ESP32 2.0.17 the function is declared as:
void setManufacturerData(std::string data);
and the code:
std::string manufacturerData = { 0xEC, 0xB1 , 0xAC, 0x00, 0xB6, 0x7C};
advertisementData.setManufacturerData(manufacturerData);
pAdvertising->setAdvertisementData(advertisementData);
is executed correctly.
starting with library version 3.0.0 the function is declared as:
void setManufacturerData(String data);

Please change the library to return the ability to work with characters 0x00.

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions