From 2ee6abb408f4e1916827e112b720595489ae08c0 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Thu, 30 Mar 2023 16:44:16 +0200 Subject: [PATCH] Align sync function name with convention --- src/platform/Tizen/BLEManagerImpl.cpp | 4 ++-- src/platform/Tizen/ChipDeviceScanner.cpp | 2 +- src/platform/Tizen/DnssdImpl.cpp | 6 +++--- src/platform/Tizen/PlatformManagerImpl.cpp | 2 +- src/platform/Tizen/PlatformManagerImpl.h | 8 ++++---- src/platform/Tizen/WiFiManager.cpp | 12 ++++++------ 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/platform/Tizen/BLEManagerImpl.cpp b/src/platform/Tizen/BLEManagerImpl.cpp index 01a445e27c93c6..8b55c11ea61cf2 100644 --- a/src/platform/Tizen/BLEManagerImpl.cpp +++ b/src/platform/Tizen/BLEManagerImpl.cpp @@ -503,7 +503,7 @@ void BLEManagerImpl::OnChipDeviceScanned(void * device, const Ble::ChipBLEDevice mDeviceScanner->StopChipScan(); /* Initiate Connect */ - PlatformMgrImpl().GLibMatterContextInvokeSynchronous(ConnectChipThing, const_cast(deviceInfo->remote_address)); + PlatformMgrImpl().GLibMatterContextInvokeSync(ConnectChipThing, const_cast(deviceInfo->remote_address)); } void BLEManagerImpl::OnScanComplete() @@ -955,7 +955,7 @@ CHIP_ERROR BLEManagerImpl::_Init() mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Enabled; ChipLogProgress(DeviceLayer, "Initialize BLE"); - err = PlatformMgrImpl().GLibMatterContextInvokeSynchronous(_BleInitialize, static_cast(nullptr)); + err = PlatformMgrImpl().GLibMatterContextInvokeSync(_BleInitialize, static_cast(nullptr)); SuccessOrExit(err); PlatformMgr().ScheduleWork(DriveBLEState, 0); diff --git a/src/platform/Tizen/ChipDeviceScanner.cpp b/src/platform/Tizen/ChipDeviceScanner.cpp index 5ce1ee779e2fcc..5dcf154f13b984 100644 --- a/src/platform/Tizen/ChipDeviceScanner.cpp +++ b/src/platform/Tizen/ChipDeviceScanner.cpp @@ -209,7 +209,7 @@ CHIP_ERROR ChipDeviceScanner::StartChipScan(System::Clock::Timeout timeout, Scan // All set to trigger LE Scan ChipLogProgress(DeviceLayer, "Start CHIP BLE scan: timeout=%ums", mScanTimeoutMs); - err = PlatformMgrImpl().GLibMatterContextInvokeSynchronous(TriggerScan, this); + err = PlatformMgrImpl().GLibMatterContextInvokeSync(TriggerScan, this); SuccessOrExit(err); return CHIP_NO_ERROR; diff --git a/src/platform/Tizen/DnssdImpl.cpp b/src/platform/Tizen/DnssdImpl.cpp index 1d618d5d302f01..0c68bd67694a03 100644 --- a/src/platform/Tizen/DnssdImpl.cpp +++ b/src/platform/Tizen/DnssdImpl.cpp @@ -584,7 +584,7 @@ CHIP_ERROR DnssdTizen::RegisterService(const DnssdService & service, DnssdPublis err = GetChipError(ret)); } - err = DeviceLayer::PlatformMgrImpl().GLibMatterContextInvokeSynchronous(RegisterAsync, serviceCtx); + err = DeviceLayer::PlatformMgrImpl().GLibMatterContextInvokeSync(RegisterAsync, serviceCtx); SuccessOrExit(err); exit: @@ -623,7 +623,7 @@ CHIP_ERROR DnssdTizen::Browse(const char * type, Dnssd::DnssdServiceProtocol pro auto browseCtx = CreateBrowseContext(fullType.c_str(), protocol, interfaceId, callback, context); - err = DeviceLayer::PlatformMgrImpl().GLibMatterContextInvokeSynchronous(BrowseAsync, browseCtx); + err = DeviceLayer::PlatformMgrImpl().GLibMatterContextInvokeSync(BrowseAsync, browseCtx); SuccessOrExit(err); exit: @@ -664,7 +664,7 @@ CHIP_ERROR DnssdTizen::Resolve(const DnssdService & browseResult, chip::Inet::In VerifyOrExit(ret == DNSSD_ERROR_NONE, ChipLogError(DeviceLayer, "dnssd_create_remote_service() failed. ret: %d", ret); err = GetChipError(ret)); - err = DeviceLayer::PlatformMgrImpl().GLibMatterContextInvokeSynchronous(ResolveAsync, resolveCtx); + err = DeviceLayer::PlatformMgrImpl().GLibMatterContextInvokeSync(ResolveAsync, resolveCtx); SuccessOrExit(err); exit: diff --git a/src/platform/Tizen/PlatformManagerImpl.cpp b/src/platform/Tizen/PlatformManagerImpl.cpp index da88b2b1129c81..89cb8eb6770366 100644 --- a/src/platform/Tizen/PlatformManagerImpl.cpp +++ b/src/platform/Tizen/PlatformManagerImpl.cpp @@ -103,7 +103,7 @@ void PlatformManagerImpl::_Shutdown() g_thread_join(mGLibMainLoopThread); } -CHIP_ERROR PlatformManagerImpl::_GLibMatterContextInvokeSynchronous(CHIP_ERROR (*func)(void *), void * userData) +CHIP_ERROR PlatformManagerImpl::_GLibMatterContextInvokeSync(CHIP_ERROR (*func)(void *), void * userData) { GLibMatterContextInvokeData invokeData{ func, userData }; diff --git a/src/platform/Tizen/PlatformManagerImpl.h b/src/platform/Tizen/PlatformManagerImpl.h index 8bca1ce8a49068..04ad1c02864705 100644 --- a/src/platform/Tizen/PlatformManagerImpl.h +++ b/src/platform/Tizen/PlatformManagerImpl.h @@ -62,9 +62,9 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener * @returns The result of the function. */ template - CHIP_ERROR GLibMatterContextInvokeSynchronous(CHIP_ERROR (*func)(T *), T * userData) + CHIP_ERROR GLibMatterContextInvokeSync(CHIP_ERROR (*func)(T *), T * userData) { - return _GLibMatterContextInvokeSynchronous((CHIP_ERROR(*)(void *)) func, (void *) userData); + return _GLibMatterContextInvokeSync((CHIP_ERROR(*)(void *)) func, (void *) userData); } private: @@ -85,9 +85,9 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener * @brief Invoke a function on the Matter GLib context. * * @note This function does not provide type safety for the user data. Please, - * use the GLibMatterContextInvokeSynchronous() template function instead. + * use the GLibMatterContextInvokeSync() template function instead. */ - CHIP_ERROR _GLibMatterContextInvokeSynchronous(CHIP_ERROR (*func)(void *), void * userData); + CHIP_ERROR _GLibMatterContextInvokeSync(CHIP_ERROR (*func)(void *), void * userData); GMainLoop * mGLibMainLoop; GThread * mGLibMainLoopThread; diff --git a/src/platform/Tizen/WiFiManager.cpp b/src/platform/Tizen/WiFiManager.cpp index 53a461dfe87118..b45e34bda450c8 100644 --- a/src/platform/Tizen/WiFiManager.cpp +++ b/src/platform/Tizen/WiFiManager.cpp @@ -210,7 +210,7 @@ void WiFiManager::_ScanFinishedCb(wifi_manager_error_e wifiErr, void * userData) foundAp = sInstance._WiFiGetFoundAP(); if (foundAp != nullptr) { - PlatformMgrImpl().GLibMatterContextInvokeSynchronous(_WiFiConnect, foundAp); + PlatformMgrImpl().GLibMatterContextInvokeSync(_WiFiConnect, foundAp); } } else @@ -552,7 +552,7 @@ void WiFiManager::Init() sInstance.mModuleState = WIFI_MANAGER_MODULE_STATE_DETACHED; sInstance.mConnectionState = WIFI_MANAGER_CONNECTION_STATE_DISCONNECTED; - PlatformMgrImpl().GLibMatterContextInvokeSynchronous(_WiFiInitialize, static_cast(nullptr)); + PlatformMgrImpl().GLibMatterContextInvokeSync(_WiFiInitialize, static_cast(nullptr)); } void WiFiManager::Deinit() @@ -576,7 +576,7 @@ CHIP_ERROR WiFiManager::Activate() VerifyOrExit((err = IsActivated(&isWiFiActivated)) == CHIP_NO_ERROR, ); VerifyOrExit(isWiFiActivated == false, ChipLogProgress(DeviceLayer, "WiFi is already activated")); - err = PlatformMgrImpl().GLibMatterContextInvokeSynchronous(_WiFiActivate, static_cast(nullptr)); + err = PlatformMgrImpl().GLibMatterContextInvokeSync(_WiFiActivate, static_cast(nullptr)); SuccessOrExit(err); exit: @@ -591,7 +591,7 @@ CHIP_ERROR WiFiManager::Deactivate() VerifyOrExit((err = IsActivated(&isWiFiActivated)) == CHIP_NO_ERROR, ); VerifyOrExit(isWiFiActivated == true, ChipLogProgress(DeviceLayer, "WiFi is already deactivated")); - err = PlatformMgrImpl().GLibMatterContextInvokeSynchronous(_WiFiDeactivate, static_cast(nullptr)); + err = PlatformMgrImpl().GLibMatterContextInvokeSync(_WiFiDeactivate, static_cast(nullptr)); SuccessOrExit(err); exit: @@ -619,12 +619,12 @@ CHIP_ERROR WiFiManager::Connect(const char * ssid, const char * key, foundAp = sInstance._WiFiGetFoundAP(); if (foundAp != nullptr) { - err = PlatformMgrImpl().GLibMatterContextInvokeSynchronous(_WiFiConnect, foundAp); + err = PlatformMgrImpl().GLibMatterContextInvokeSync(_WiFiConnect, foundAp); SuccessOrExit(err); } else { - err = PlatformMgrImpl().GLibMatterContextInvokeSynchronous(_WiFiScan, static_cast(nullptr)); + err = PlatformMgrImpl().GLibMatterContextInvokeSync(_WiFiScan, static_cast(nullptr)); SuccessOrExit(err); }