Coder Social home page Coder Social logo

Comments (7)

h2zero avatar h2zero commented on August 16, 2024

Thanks! I’ll add this shortly.

from nimble-arduino.

straccio avatar straccio commented on August 16, 2024

Thanks to you! :P

from nimble-arduino.

h2zero avatar h2zero commented on August 16, 2024

Just a quick note on this, you can create a std::string beginning with \0, it just needs to be done by specifying the length.

std::string dataStr((char*)data, length);
pAdvData->addData(dataStr);

from nimble-arduino.

straccio avatar straccio commented on August 16, 2024

I have tried but it doesn't work.
Before calling addData the string size is correctly; inside the adData the size of the string is truncated at \0 position.

I think that happen because passing the string to the function call the copy of the object ad that cause the issue.

The correct way must be use the variable as std::basic_string<unsigned char/uint8_t>

from nimble-arduino.

h2zero avatar h2zero commented on August 16, 2024

That's odd, I can't reproduce that here. If I use the url beacon example with a http://www. address and change the eddyStoneData construction to std::string eddyStoneData(ret_data, ret_data[7]+8); it works just fine.

I'll still add this anyway so a std::string doesn't need to be used.

from nimble-arduino.

h2zero avatar h2zero commented on August 16, 2024

Sorry for the delay, I pushed this patch just now in commit 3976074.

from nimble-arduino.

h2zero avatar h2zero commented on August 16, 2024

resolved

from nimble-arduino.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.