change: Static cast arg

This commit is contained in:
thekurtovic 2025-01-16 16:20:19 -05:00
parent a04ee15815
commit 60b4dc1cfa
4 changed files with 4 additions and 4 deletions

View file

@ -633,7 +633,7 @@ NimBLERemoteService* NimBLEClient::getService(const NimBLEUUID& uuid) {
NimBLERemoteService *pSvc = nullptr;
NimBLEUtils::getAttr(uuid, pSvc, m_svcVec, [this](const NimBLEUUID* u, void* arg) {
return retrieveServices(u, (NimBLERemoteService*)arg);
return retrieveServices(u, static_cast<NimBLERemoteService*>(arg));
});
NIMBLE_LOGD(LOG_TAG, "<< getService: %sfound", !pSvc ? "not " : "");

View file

@ -141,7 +141,7 @@ NimBLERemoteDescriptor* NimBLERemoteCharacteristic::getDescriptor(const NimBLEUU
NimBLERemoteDescriptor* pDsc = nullptr;
NimBLEUtils::getAttr(uuid, pDsc, m_vDescriptors, [this](const NimBLEUUID* u, void* arg) {
return retrieveDescriptors(u, (NimBLERemoteDescriptor*)arg);
return retrieveDescriptors(u, static_cast<NimBLERemoteDescriptor*>(arg));
});
NIMBLE_LOGD(LOG_TAG, "<< getDescriptor: %sfound", !pDsc ? "not " : "");

View file

@ -79,7 +79,7 @@ NimBLERemoteCharacteristic* NimBLERemoteService::getCharacteristic(const NimBLEU
NimBLERemoteCharacteristic* pChar = nullptr;
NimBLEUtils::getAttr(uuid, pChar, m_vChars, [this](const NimBLEUUID* u, void* arg) {
return retrieveCharacteristics(u, (NimBLERemoteCharacteristic*)arg);
return retrieveCharacteristics(u, static_cast<NimBLERemoteCharacteristic*>(arg));
});
NIMBLE_LOGD(LOG_TAG, "<< getCharacteristic: %sfound", !pChar ? "not " : "");

View file

@ -57,7 +57,7 @@ class NimBLEUtils {
static void taskRelease(const NimBLETaskData& taskData, int rc = 0);
template <typename T, typename S>
static void getAttr(const NimBLEUUID& uuid, T* attr, const std::vector<S*> vec, const std::function<bool(const NimBLEUUID*, void*)>& getter) {
static void getAttr(const NimBLEUUID& uuid, T* attr, const std::vector<S*>& vec, const std::function<bool(const NimBLEUUID*, void*)>& getter) {
// Check if already exists.
for (const auto& v : vec) {
if (v->getUUID() == uuid) {