Git Product home page Git Product logo

Comments (5)

h2zero avatar h2zero commented on May 19, 2024

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.

kaiwen98 avatar kaiwen98 commented on May 19, 2024

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.

h2zero avatar h2zero commented on May 19, 2024

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.

elguiri avatar elguiri commented on May 19, 2024

@kaiwen98

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.

h2zero avatar h2zero commented on May 19, 2024

Closing this as stale, feel free to re-open if your issue is not yet 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.