mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2025-01-22 09:20:51 +01:00
change: Static cast arg
This commit is contained in:
parent
a04ee15815
commit
60b4dc1cfa
4 changed files with 4 additions and 4 deletions
|
@ -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 " : "");
|
||||
|
|
|
@ -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 " : "");
|
||||
|
|
|
@ -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 " : "");
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue