Skip to content

BLE set a timeout for client.connect() #4394

@nathan-casabieille

Description

@nathan-casabieille

Hello,

I am currently programming an esp32 to retrieve data from all surrounding bluetooth devices.

First, it does a scan, then it create a linked list and connect to all the detected devices one by one, retrieving each time a data.

Everything works perfectly for tens of minutes, but randomly, at one point the program always hangs while I execute the command pClient->connect(pAddress); while trying to connect to one of the detected devices.

Knowing that this is a blocking function, how can I execute it, and move on to the next one if after 30 seconds it is still blocked?

Any answer would help me greatly, thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions