aboutsummaryrefslogtreecommitdiffstats
path: root/src/direct_bt/DBTManager.cpp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-10-20 08:18:11 +0200
committerSven Gothel <[email protected]>2020-10-20 08:18:11 +0200
commitbc5b9519034edfa7a24a6667d183f3a3b01f3867 (patch)
treed18e96cef8286dfc6bc20e1f8e8e71b360aba1fd /src/direct_bt/DBTManager.cpp
parentaa43800a7722940ac1a902b088a6900e29efd0c9 (diff)
Small footprint compromise: Use jau::nsize_t and jau::snsize_t where appropriate
Revises commit 1f6e924fe05ed45bfa4d0d901af2c4df6c1abab5 Use jau::nsize_t and jau::snsize_t where appropriate - OctetTypes.hpp: TROOctets* - ATTPDUTypes.hpp: AttPDUMsg* - HCITypes.hpp: HCIPacket* - HCIComm.hpp: HCIComm - L2CAPComm.hpp: L2CAPComm - MgmtTypes.hpp: MgmtCommand*, MgmtEvent* - UUID.hpp: uuid_t - DBTManager, GATTHandler, HCIHandler - HCIComm.hpp: HCIComm - BTTypes.hpp - DBTTypes.hpp
Diffstat (limited to 'src/direct_bt/DBTManager.cpp')
-rw-r--r--src/direct_bt/DBTManager.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/direct_bt/DBTManager.cpp b/src/direct_bt/DBTManager.cpp
index dcff5ea9..111ef4b1 100644
--- a/src/direct_bt/DBTManager.cpp
+++ b/src/direct_bt/DBTManager.cpp
@@ -89,7 +89,7 @@ void DBTManager::mgmtReaderThreadImpl() noexcept {
}
while( !mgmtReaderShallStop ) {
- ssize_t len;
+ jau::snsize_t len;
if( !comm.isOpen() ) {
// not open
ERR_PRINT("DBTManager::reader: Not connected");
@@ -99,10 +99,10 @@ void DBTManager::mgmtReaderThreadImpl() noexcept {
len = comm.read(rbuffer.get_wptr(), rbuffer.getSize(), env.MGMT_READER_THREAD_POLL_TIMEOUT);
if( 0 < len ) {
- const size_t len2 = static_cast<size_t>(len);
- const size_t paramSize = len2 >= MGMT_HEADER_SIZE ? rbuffer.get_uint16_nc(4) : 0;
+ const jau::nsize_t len2 = static_cast<jau::nsize_t>(len);
+ const jau::nsize_t paramSize = len2 >= MGMT_HEADER_SIZE ? rbuffer.get_uint16_nc(4) : 0;
if( len2 < MGMT_HEADER_SIZE + paramSize ) {
- WARN_PRINT("DBTManager::reader: length mismatch %zu < MGMT_HEADER_SIZE(%zu) + %zu", len2, MGMT_HEADER_SIZE, paramSize);
+ WARN_PRINT("DBTManager::reader: length mismatch %zu < MGMT_HEADER_SIZE(%u) + %u", len2, MGMT_HEADER_SIZE, paramSize);
continue; // discard data
}
std::shared_ptr<MgmtEvent> event = MgmtEvent::getSpecialized(rbuffer.get_ptr(), len2);
@@ -411,7 +411,7 @@ next1:
const uint16_t num_adapter = jau::get_uint16(data, 0, true /* littleEndian */);
WORDY_PRINT("Bluetooth %d adapter", num_adapter);
- const size_t expDataSize = 2 + num_adapter * 2;
+ const jau::nsize_t expDataSize = 2 + num_adapter * 2;
if( res->getDataSize() < expDataSize ) {
ERR_PRINT("Insufficient data for %d adapter indices: res %s", num_adapter, res->toString().c_str());
goto fail;