Giter Club home page Giter Club logo

Comments (9)

rgrover avatar rgrover commented on June 27, 2024

Thanks for pointing this out. I'll fix this shortly.

from ble.

rgrover avatar rgrover commented on June 27, 2024

Why is the encoded URI data restricted to 18 bytes when you can go up to 21?
ADV payload can be up to 31 bytes.
4 bytes for the service UUID: Type + length + 16-bit UUID
6 bytes of header for the URI data: Type + length + 16-bitUUID + flags + power

from ble.

schilit avatar schilit commented on June 27, 2024

The case of the missing bytes!

See the Figure below. The missing bytes are from the AD Flags (AD Type 0x01).

Is mbed broadcasting flags? CSR firmware forces the flags in the ADV packet.

The thing is that some central devices care about them and some don't. We've seen versions of Android/iOS discard ADV packets without flags (though I'd have to dig up which).

Robin Hayden was going to propose that missing flags default to 0... which is reasonable but right now it doesn't seem to be widely adopted in scanners.

Figure

from ble.

rgrover avatar rgrover commented on June 27, 2024

Why is the service UUID duplicated?

from ble.

rgrover avatar rgrover commented on June 27, 2024

Hi, AD flags aren't needed. Mbed doesn't add them. Secondly, Advertisement payload can be up to 31 octets long. Lastly, you shouldn't be duplicating the Service UUID.

You should be able to add another 7 bytes to your max URI data length!!

from ble.

hugovincent avatar hugovincent commented on June 27, 2024

@rgrover are you sure that's true for all versions of Android and iOS? If I recall correctly, Scott said these were added for compatibility with either iOS (something to do with detecting tags from a background process) or older versions of Android.

from ble.

rgrover avatar rgrover commented on June 27, 2024

I'm not sure about all version of Android/iOS. Even if we need to keep AD flags, there's some more room in the advertisement payload, and there's also some redundancy. You could certain get a few more URI octets out of the payload.

from ble.

schilit avatar schilit commented on June 27, 2024

As mentioned above, AD Flags is necessary for some devices, else packets are filtered. We can revisit this and see exactly which devices.

Why is the service UUID duplicated?

I assume you mean why is there both a AD Service UUIDs and AD Service Data? AD Complete List of 16-Bit Service UUIDs is needed in order to background scanning on iOS.

from ble.

schilit avatar schilit commented on June 27, 2024

31 - 3 (AD Flags) - 4 (AD Service UUIDs) - 4 (AD Service Data header) - 2 (Flags, TX Power) = 18

from ble.

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.