summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-06-09 07:23:39 +0200
committerSven Gothel <[email protected]>2020-06-09 07:23:39 +0200
commit5b835bf15243b24d20125d1796349750665b1850 (patch)
tree42729064068e5d353c4d00f5fbda4fde586ad8b0 /api
parentf881c9a048b752cdd9a695dafd83003a8be2d0b0 (diff)
L2CAPComm::connect: Retry connect on ETIMEDOUT up to 3, working around rare system timeouts.
Diffstat (limited to 'api')
-rw-r--r--api/direct_bt/L2CAPComm.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/api/direct_bt/L2CAPComm.hpp b/api/direct_bt/L2CAPComm.hpp
index 80e27e6e..4db7e84b 100644
--- a/api/direct_bt/L2CAPComm.hpp
+++ b/api/direct_bt/L2CAPComm.hpp
@@ -60,6 +60,11 @@ namespace direct_bt {
static std::string getStateString(const State state);
+ enum class Defaults : int {
+ L2CAP_CONNECT_MAX_RETRY = 3
+ };
+ static inline int number(const Defaults d) { return static_cast<int>(d); }
+
private:
static int l2cap_open_dev(const EUI48 & adapterAddress, const uint16_t psm, const uint16_t cid, const bool pubaddr, const bool blocking);
static int l2cap_close_dev(int dd);