Comments (5)
Hi @kaiwen98, you are most welcome.
This functionality is supported, you should also be able to do both at the same time if you manage your scan and advertise interval and window times.
Pseudo code example:
NimBLEDevice::init();
NimBLEScan *pScan = NimBLEDevice::getScan();
/* set scan parameters */
NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
/* set advertising parameters */
pAdvertising->start();
pScan->start();
I have not tested this, however it should work. If you do, please let us know the results π,
from nimble-arduino.
Previously I tried something like this:
setup:
device::init
getscan()
getadv()
task1client:
startscan
getdatafromindicate
stopscan
mutex give
task2 -> server
mutex take
startadv
.
.
.
<rc = 15, host busy>
The esp32 crashes with the error message being Bluetooth host error code 15: host busy. Can you speculate what might have caused the error?
I will try out your pseudocode asap. Thank you!
from nimble-arduino.
That error just means the controller isnβt finished stopping the scan or advertising. You should wait in a loop until it returns success before starting the next operation.
from nimble-arduino.
I am experimenting (and having success so far) with having a client and server running at the same time. The idea is that there will be multiple client connections being aggregated into a single server. I'm using the non-blocking scan so the server can do its thing, and have values that update as and when the relevant client connections receive updates. Do you have something similar in mind? The key for you might be to look at using the non-blocking scan.
EDIT... I should add that I'm using the simple Arduino loop() paradigm rather than attempting any multi-tasking!
from nimble-arduino.
Closing this as stale, feel free to re-open if your issue is not yet resolved.
from nimble-arduino.
Related Issues (20)
- pScan->start(...) blocking forever HOT 6
- Can't connect device HOT 2
- Stack canary watchpoint triggered (ipc0) when constantly notifying. HOT 2
- Arduino Uno R4 WiFi Compatibility HOT 3
- Arduino IDE ext_nimble_config.h: No such file or directory HOT 10
- how should I set an description for 2902 based code`/ HOT 3
- Not able to connect to a host system that only support classic Bluetooth HOT 1
- Read / Write BLERemoteCharacteristic like stream or serial
- ESP32-S3 BLE Server Vs. Detection on PC Bluetooth Dongle HOT 5
- NimBLEscan turn a wrong MAC adress by 2 in the last octet HOT 2
- How to require a passkey for Notify? HOT 2
- How to react to a bad passkey? HOT 1
- ESP32-S3 compatable? HOT 1
- ESP32C3 don't advertise
- Connection only on client request after disconnecting? HOT 2
- Adafruit Feather ESP32-S3 panik resets in the Scan Continuous example. HOT 1
- NimBLEClient issue on TRANSPARENT UART: receiving only one callback from ble server after writing HOT 2
- NimBLEServerCallbacks won't call onConnect(BLEServer*, NimBLEConnInfo&) HOT 2
- Is it possible to scan and detect smartphones? HOT 1
- suppressing some serial output from the scan whitelist example HOT 3
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 nimble-arduino.