summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-06-26 07:35:38 +0200
committerSven Gothel <[email protected]>2020-06-26 07:35:38 +0200
commit25df14701cc9b43ee656beab915de619c2054a3f (patch)
tree8045efbdddb8fcf8501224f6486963fe6e89261b /api
parentaa912027163e577336b235220a8a237bd466b2da (diff)
L2CAPComm/GATTHandler: Use prefetched 'deviceString' for verbose output
This potentially avoid a SIGSEGV in case of an error, i.e. destructed device instance.
Diffstat (limited to 'api')
-rw-r--r--api/direct_bt/L2CAPComm.hpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/api/direct_bt/L2CAPComm.hpp b/api/direct_bt/L2CAPComm.hpp
index 8e79085f..0f2e484f 100644
--- a/api/direct_bt/L2CAPComm.hpp
+++ b/api/direct_bt/L2CAPComm.hpp
@@ -65,6 +65,7 @@ namespace direct_bt {
static int l2cap_close_dev(int dd);
std::shared_ptr<DBTDevice> device;
+ const std::string deviceString;
const uint16_t psm;
const uint16_t cid;
const bool pubaddr;
@@ -75,10 +76,7 @@ namespace direct_bt {
std::atomic<pthread_t> tid_connect;
public:
- L2CAPComm(std::shared_ptr<DBTDevice> device, const uint16_t psm, const uint16_t cid, const bool pubaddr=true)
- : device(device), psm(psm), cid(cid), pubaddr(pubaddr),
- _dd(-1), isConnected(false), hasIOError(false), interruptFlag(false), tid_connect(0) {}
- ~L2CAPComm() { disconnect(); }
+ L2CAPComm(std::shared_ptr<DBTDevice> device, const uint16_t psm, const uint16_t cid, const bool pubaddr=true);
std::shared_ptr<DBTDevice> getDevice() { return device; }