Skip to content

Commit

Permalink
Fix webos BUILD Error (#19258)
Browse files Browse the repository at this point in the history
* Fix webos default toolchain path

* [webOS] Remove HandleSwitchEvent in webos/platformManagerImpl
  • Loading branch information
Jeonghwan Kim authored and pull[bot] committed Aug 14, 2023
1 parent 6db7cb6 commit 2196992
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 86 deletions.
3 changes: 2 additions & 1 deletion build/config/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ if (_chip_defaults.custom_toolchain != "") {
"${_build_overrides.build_root}/toolchain/tizen:tizen_${target_cpu}"
} else if (target_os == "webos") {
if (target_cpu == "arm" || target_cpu == "arm64") {
_default_toolchain = "//build/toolchain/webos"
_default_toolchain =
"${_build_overrides.build_root}/toolchain/webos"
} else {
assert(false,
"Unsupported target_cpu: ${current_cpu}. Shall be arm for webOS")
Expand Down
84 changes: 0 additions & 84 deletions src/platform/webos/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ void SignalHandler(int signum)
case SIGTTIN:
PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::NetworkFaultChange::Id);
break;
case SIGTSTP:
PlatformMgrImpl().HandleSwitchEvent(Switch::Events::SwitchLatched::Id);
break;
default:
break;
}
Expand Down Expand Up @@ -323,88 +320,7 @@ void PlatformManagerImpl::HandleSoftwareFault(uint32_t EventId)
}
}

void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId)
{
SwitchDeviceControlDelegate * delegate = DeviceControlServer::DeviceControlSvr().GetSwitchDelegate();

if (delegate == nullptr)
{
ChipLogError(DeviceLayer, "No delegate registered to handle Switch event");
return;
}

if (EventId == Switch::Events::SwitchLatched::Id)
{
uint8_t newPosition = 0;

#if CHIP_CONFIG_TEST
newPosition = 100;
#endif
delegate->OnSwitchLatched(newPosition);
}
else if (EventId == Switch::Events::InitialPress::Id)
{
uint8_t newPosition = 0;

#if CHIP_CONFIG_TEST
newPosition = 100;
#endif
delegate->OnInitialPressed(newPosition);
}
else if (EventId == Switch::Events::LongPress::Id)
{
uint8_t newPosition = 0;

#if CHIP_CONFIG_TEST
newPosition = 100;
#endif
delegate->OnLongPressed(newPosition);
}
else if (EventId == Switch::Events::ShortRelease::Id)
{
uint8_t previousPosition = 0;

#if CHIP_CONFIG_TEST
previousPosition = 50;
#endif
delegate->OnShortReleased(previousPosition);
}
else if (EventId == Switch::Events::LongRelease::Id)
{
uint8_t previousPosition = 0;

#if CHIP_CONFIG_TEST
previousPosition = 50;
#endif
delegate->OnLongReleased(previousPosition);
}
else if (EventId == Switch::Events::MultiPressOngoing::Id)
{
uint8_t newPosition = 0;
uint8_t currentNumberOfPressesCounted = 0;

#if CHIP_CONFIG_TEST
newPosition = 10;
currentNumberOfPressesCounted = 5;
#endif
delegate->OnMultiPressOngoing(newPosition, currentNumberOfPressesCounted);
}
else if (EventId == Switch::Events::MultiPressComplete::Id)
{
uint8_t newPosition = 0;
uint8_t totalNumberOfPressesCounted = 0;

#if CHIP_CONFIG_TEST
newPosition = 10;
totalNumberOfPressesCounted = 5;
#endif
delegate->OnMultiPressComplete(newPosition, totalNumberOfPressesCounted);
}
else
{
ChipLogError(DeviceLayer, "Unknow event ID:%d", EventId);
}
}

#if CHIP_WITH_GIO
GDBusConnection * PlatformManagerImpl::GetGDBusConnection()
Expand Down
1 change: 0 additions & 1 deletion src/platform/webos/PlatformManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener

void HandleGeneralFault(uint32_t EventId);
void HandleSoftwareFault(uint32_t EventId);
void HandleSwitchEvent(uint32_t EventId);

private:
// ===== Methods that implement the PlatformManager abstract interface.
Expand Down

0 comments on commit 2196992

Please sign in to comment.