Comments (9)
I will answer as I understand it. Sorry if I am wrong.
The maximum size of an advertised packet is 31 bytes. (This is defined in BLE_HS_ADV_MAX_SZ
).
UUID128 is 16 bytes, so if you put two values in the packet, it will exceed 31 bytes, resulting in an error.
If multiple UUIDs are used, UUID16 or UUID32 must be used.
from esp32-nimble.
I did some additional research.
It appears that Advertising Extensions can be used to increase the amount of data.
reference: apache/mynewt-core#1027
(The current implementation does not implement this feature.)
from esp32-nimble.
Thanks @taks. It make sense for me.
Do you know how can I override this variable at compile time or is mandatory to follow this restriction?
Thank you very much again and sorry for my ignorance.
regards
from esp32-nimble.
This restriction is determined by the BLE specification.
Therefore, even if you rewrite this variable, it seems that it will not work properly.
from esp32-nimble.
Got it, thank you very much.
from esp32-nimble.
It would be nice to have an example with advertising extensions
from esp32-nimble.
Is there any support for extended advertising yet?
Seems it's supported with CONFIG_BT_NIMBLE_EXT_ADV=y
, but the sample no longer compiles and some function signatures seem to be changed, so a sample would indeed be nice.
error[E0061]: this method takes 1 argument but 0 arguments were supplied
--> src/main.rs:59:38
|
59 | ble_device.get_advertising().start().unwrap();
| ^^^^^-- an argument of type `u8` is missing
|
note: method defined here
--> /home/leon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp32-nimble-0.5.1/src/server/ble_ext_advertising.rs:298:10
|
298 | pub fn start(&mut self, inst_id: u8) -> Result<(), BLEReturnCode> {
| ^^^^^
help: provide the argument
|
59 | ble_device.get_advertising().start(/* u8 */).unwrap();
| ~~~~~~~~~~
error[E0599]: no method named `name` found for mutable reference `&mut BLEExtAdvertising` in the current scope
--> src/main.rs:89:10
|
88 | / ble_advertising
89 | | .name(&device_name.as_str())
| | -^^^^ method not found in `&mut BLEExtAdvertising`
| |_________|
|
error[E0061]: this method takes 1 argument but 0 arguments were supplied
--> src/main.rs:94:21
|
94 | ble_advertising.start().unwrap();
| ^^^^^-- an argument of type `u8` is missing
|
note: method defined here
--> /home/leon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp32-nimble-0.5.1/src/server/ble_ext_advertising.rs:298:10
|
298 | pub fn start(&mut self, inst_id: u8) -> Result<(), BLEReturnCode> {
| ^^^^^
help: provide the argument
|
94 | ble_advertising.start(/* u8 */).unwrap();
| ~~~~~~~~~~
Some errors have detailed explanations: E0061, E0599.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `offline-unlock` (bin "offline-unlock") due to 3 previous errors
from esp32-nimble.
Please refer to examples/ble5_multi_advertiser.rs.
※ I'm sorry, but extended advertising has not been tested much.
from esp32-nimble.
Please refer to examples/ble5_multi_advertiser.rs.
※ I'm sorry, but extended advertising has not been tested much.
Thanks, must have missed this sample somehow. Will give it a try.
from esp32-nimble.
Related Issues (20)
- BLEServer disconnect HOT 1
- Add Accessor Functions
- Adding Characteristics after Advertising has already been started
- Cleanup BLEServer on BLEDevice::deinit HOT 2
- Wrong error mapping for BLE_ERR_INV_HCI_CMD_PARMS on set_raw_data HOT 1
- ble_gatt_chr_def missing `cpfd` on ESP-IDF version 5.2.1
- Change branch HOT 3
- Make use of `esp_idf_svc::eventloop::EspSystemEventLoop` instead of `loop`? HOT 3
- Support L2CAP HOT 6
- ble_keyboard example doesn't work HOT 2
- Support original NimBLE as well HOT 1
- Support v5.2.1 esp-idf HOT 2
- ble_gatt_chr_def, Required fields/characteristics in struct? HOT 4
- NimBLE: GAP procedure initiated: stop advertising. HOT 1
- Reflect new build args propagation in `build.rs`
- Add hint for potential increase of CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE HOT 3
- How do handle large reads (larger than MAX MTU)? HOT 4
- Build errors HOT 1
- Creating a new BLEAddress is confusing because it reverses the bytes. HOT 3
- Memory Leak When Looping Scan HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp32-nimble.