summaryrefslogtreecommitdiffstats
path: root/src/direct_bt/SMPHandler.cpp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-10-31 17:14:32 +0100
committerSven Gothel <[email protected]>2021-10-31 17:14:32 +0100
commitd51cabf227bd4dae06a0565365268d26f785586a (patch)
tree7d40b166c7ed12461ff17e9aa761139c6fccfd2d /src/direct_bt/SMPHandler.cpp
parent6a13eeb65d5667b6e284bacb645f1bf9cc8e4c12 (diff)
Adapt to jau::ringbuffer API change
Diffstat (limited to 'src/direct_bt/SMPHandler.cpp')
-rw-r--r--src/direct_bt/SMPHandler.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/direct_bt/SMPHandler.cpp b/src/direct_bt/SMPHandler.cpp
index c9d342e8..12cfa6db 100644
--- a/src/direct_bt/SMPHandler.cpp
+++ b/src/direct_bt/SMPHandler.cpp
@@ -167,7 +167,7 @@ SMPHandler::SMPHandler(const std::shared_ptr<BTDevice> &device) noexcept
rbuffer(number(Defaults::SMP_MTU_BUFFER_SZ), jau::endian::little),
l2cap(device->getAdapter().getAddressAndType(), L2CAP_PSM::UNDEFINED, L2CAP_CID::SMP),
is_connected(l2cap.open(*device)), has_ioerror(false),
- smpPDURing(nullptr, env.SMPPDU_RING_CAPACITY), l2capReaderShallStop(false),
+ smpPDURing(env.SMPPDU_RING_CAPACITY), l2capReaderShallStop(false),
l2capReaderThreadId(0), l2capReaderRunning(false),
mtu(number(Defaults::MIN_SMP_MTU))
{
@@ -312,8 +312,8 @@ std::unique_ptr<const SMPPDUMsg> SMPHandler::sendWithReply(const SMPPDUMsg & msg
send( msg );
// Ringbuffer read is thread safe
- std::unique_ptr<const SMPPDUMsg> res = smpPDURing.getBlocking(timeout);
- if( nullptr == res ) {
+ std::unique_ptr<const SMPPDUMsg> res;
+ if( !smpPDURing.getBlocking(res, timeout) || nullptr == res ) {
errno = ETIMEDOUT;
IRQ_PRINT("SMPHandler::sendWithReply: nullptr result (timeout %d): req %s to %s", timeout, msg.toString().c_str(), deviceString.c_str());
has_ioerror = true;