Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix webos BUILD Error #19258

Merged
merged 2 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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