diff options
author | Sven Gothel <[email protected]> | 2020-05-02 03:29:09 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-05-02 03:29:09 +0200 |
commit | 99f9b498316c90c3fef95a6caadd880f03e22672 (patch) | |
tree | c7b6ea132392febd75bf43db212fce0c00e32869 | |
parent | ef962e04530ca0c98bbcff52359059d409dc9eff (diff) |
GATTHandler/DBTManager Timeout/Error: Use 3s timeout; GATTHandler/l2cap use timeoutMS field
-rw-r--r-- | api/direct_bt/DBTManager.hpp | 4 | ||||
-rw-r--r-- | api/direct_bt/GATTHandler.hpp | 4 | ||||
-rw-r--r-- | src/direct_bt/GATTHandler.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/api/direct_bt/DBTManager.hpp b/api/direct_bt/DBTManager.hpp index 3ff86ca3..dcca32ff 100644 --- a/api/direct_bt/DBTManager.hpp +++ b/api/direct_bt/DBTManager.hpp @@ -61,8 +61,8 @@ namespace direct_bt { /* BT Core Spec v5.2: Vol 3, Part F 3.2.8: Maximum length of an attribute value. */ ClientMaxMTU = 512, - /** 10s poll timeout for mgmt reader thread */ - MGMT_READER_THREAD_POLL_TIMEOUT = 10000, + /** 3s poll timeout for mgmt reader thread */ + MGMT_READER_THREAD_POLL_TIMEOUT = 3000, MGMTEVT_RING_CAPACITY = 256 }; diff --git a/api/direct_bt/GATTHandler.hpp b/api/direct_bt/GATTHandler.hpp index 97feece9..fcfc5f0a 100644 --- a/api/direct_bt/GATTHandler.hpp +++ b/api/direct_bt/GATTHandler.hpp @@ -128,8 +128,8 @@ namespace direct_bt { /* BT Core Spec v5.2: Vol 3, Part G GATT: 5.2.1 ATT_MTU */ DEFAULT_MIN_ATT_MTU = 23, - /** 10s poll timeout for l2cap reader thread */ - L2CAP_READER_THREAD_POLL_TIMEOUT = 10000, + /** 3s poll timeout for l2cap reader thread */ + L2CAP_READER_THREAD_POLL_TIMEOUT = 3000, ATTPDU_RING_CAPACITY = 256 }; diff --git a/src/direct_bt/GATTHandler.cpp b/src/direct_bt/GATTHandler.cpp index 998c9119..6f426bc7 100644 --- a/src/direct_bt/GATTHandler.cpp +++ b/src/direct_bt/GATTHandler.cpp @@ -115,7 +115,7 @@ void GATTHandler::l2capReaderThreadImpl() { break; } - len = l2cap->read(rbuffer.get_wptr(), rbuffer.getSize(), Defaults::L2CAP_READER_THREAD_POLL_TIMEOUT); + len = l2cap->read(rbuffer.get_wptr(), rbuffer.getSize(), timeoutMS); if( 0 < len ) { const AttPDUMsg * attPDU = AttPDUMsg::getSpecialized(rbuffer.get_ptr(), len); const AttPDUMsg::Opcode opc = attPDU->getOpcode(); |