diff options
-rw-r--r-- | java/jni/direct_bt/DBTAdapter.cxx | 2 | ||||
-rw-r--r-- | src/direct_bt/DBTManager.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/java/jni/direct_bt/DBTAdapter.cxx b/java/jni/direct_bt/DBTAdapter.cxx index ce0b451c..05bc0aa7 100644 --- a/java/jni/direct_bt/DBTAdapter.cxx +++ b/java/jni/direct_bt/DBTAdapter.cxx @@ -473,7 +473,7 @@ jboolean Java_direct_1bt_tinyb_DBTAdapter_addDeviceToWhitelist__Ljava_lang_Strin EUI48 address(saddress); const BDAddressType addressType = static_cast<BDAddressType>( jaddressType ); const HCIWhitelistConnectType ctype = static_cast<HCIWhitelistConnectType>( jctype ); - return adapter->addDeviceToWhitelist(address, addressType, ctype, min_interval, max_interval, latency, timeout); + return adapter->addDeviceToWhitelist(address, addressType, ctype, (uint16_t)min_interval, (uint16_t)max_interval, (uint16_t)latency, (uint16_t)timeout); } catch(...) { rethrow_and_raise_java_exception(env); } diff --git a/src/direct_bt/DBTManager.cpp b/src/direct_bt/DBTManager.cpp index 54600070..a0654f69 100644 --- a/src/direct_bt/DBTManager.cpp +++ b/src/direct_bt/DBTManager.cpp @@ -771,7 +771,7 @@ std::shared_ptr<ConnectionInfo> DBTManager::getConnectionInfo(const int dev_id, } std::shared_ptr<NameAndShortName> DBTManager::setLocalName(const int dev_id, const std::string & name, const std::string & short_name) noexcept { - MgmtSetLocalNameCmd req (dev_id, name, short_name); + MgmtSetLocalNameCmd req (static_cast<uint16_t>(dev_id), name, short_name); std::shared_ptr<MgmtEvent> res = sendWithReply(req); if( nullptr != res && res->getOpcode() == MgmtEvent::Opcode::CMD_COMPLETE ) { const MgmtEvtCmdComplete &res1 = *static_cast<const MgmtEvtCmdComplete *>(res.get()); @@ -779,7 +779,7 @@ std::shared_ptr<NameAndShortName> DBTManager::setLocalName(const int dev_id, con std::shared_ptr<NameAndShortName> result = res1.toNameAndShortName(); // explicit LocalNameChanged event - MgmtEvtLocalNameChanged * e = new MgmtEvtLocalNameChanged(dev_id, result->getName(), result->getShortName()); + MgmtEvtLocalNameChanged * e = new MgmtEvtLocalNameChanged(static_cast<uint16_t>(dev_id), result->getName(), result->getShortName()); sendMgmtEvent(std::shared_ptr<MgmtEvent>(e)); return result; } |