Skip to content

Commit

Permalink
Align sync function name with convention
Browse files Browse the repository at this point in the history
  • Loading branch information
arkq committed Mar 30, 2023
1 parent 6a2c8c9 commit 2ee6abb
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/platform/Tizen/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ void BLEManagerImpl::OnChipDeviceScanned(void * device, const Ble::ChipBLEDevice
mDeviceScanner->StopChipScan();

/* Initiate Connect */
PlatformMgrImpl().GLibMatterContextInvokeSynchronous(ConnectChipThing, const_cast<const char *>(deviceInfo->remote_address));
PlatformMgrImpl().GLibMatterContextInvokeSync(ConnectChipThing, const_cast<const char *>(deviceInfo->remote_address));
}

void BLEManagerImpl::OnScanComplete()
Expand Down Expand Up @@ -955,7 +955,7 @@ CHIP_ERROR BLEManagerImpl::_Init()
mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Enabled;

ChipLogProgress(DeviceLayer, "Initialize BLE");
err = PlatformMgrImpl().GLibMatterContextInvokeSynchronous(_BleInitialize, static_cast<void *>(nullptr));
err = PlatformMgrImpl().GLibMatterContextInvokeSync(_BleInitialize, static_cast<void *>(nullptr));
SuccessOrExit(err);

PlatformMgr().ScheduleWork(DriveBLEState, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Tizen/ChipDeviceScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/platform/Tizen/DnssdImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Tizen/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down
8 changes: 4 additions & 4 deletions src/platform/Tizen/PlatformManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener
* @returns The result of the function.
*/
template <typename T>
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:
Expand All @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions src/platform/Tizen/WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<void *>(nullptr));
PlatformMgrImpl().GLibMatterContextInvokeSync(_WiFiInitialize, static_cast<void *>(nullptr));
}

void WiFiManager::Deinit()
Expand All @@ -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<void *>(nullptr));
err = PlatformMgrImpl().GLibMatterContextInvokeSync(_WiFiActivate, static_cast<void *>(nullptr));
SuccessOrExit(err);

exit:
Expand All @@ -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<void *>(nullptr));
err = PlatformMgrImpl().GLibMatterContextInvokeSync(_WiFiDeactivate, static_cast<void *>(nullptr));
SuccessOrExit(err);

exit:
Expand Down Expand Up @@ -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<void *>(nullptr));
err = PlatformMgrImpl().GLibMatterContextInvokeSync(_WiFiScan, static_cast<void *>(nullptr));
SuccessOrExit(err);
}

Expand Down

0 comments on commit 2ee6abb

Please sign in to comment.