Skip to content

Unable to advertise binary payload with BLE server #10590

@bilogic

Description

@bilogic

Board

ESP32

Device Description

WROOM32

Hardware Configuration

Nothing else.

Version

latest master (checkout manually)

IDE Name

PlatformIO on VSCode

Operating System

Windows 10

Flash frequency

40Mhz

PSRAM enabled

yes

Upload speed

115200

Description

void BLEAdvertisementData::setServiceData(BLEUUID uuid, String data) {

My payload is truncated when it contains 0x0 because expected type of string is a null character terminated type.

Sketch

char buf[3];
buf[0] = 1;
buf[1] = 0;
buf[2] = 1;

pAdvertistmentDataa->setServiceData(BLEUUID(0x181D), buf); 
// only 1 character set as payload instead of 3 because buf[1] is null

Debug Message

N/A

Other Steps to Reproduce

Can we please add a length parameter?

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

Labels

Status: SolvedThe issue has been resolved and requires no further action.Type: QuestionOnly question

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions