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

[Telink] Fix certification tests #33419

Merged
merged 6 commits into from
May 15, 2024
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
64 changes: 0 additions & 64 deletions examples/bridge-app/telink/include/AppEvent.h

This file was deleted.

8 changes: 4 additions & 4 deletions examples/bridge-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2023 Project CHIP Authors
* Copyright (c) 2023-2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -539,10 +539,10 @@ void AppTask::LightingActionEventHandler(AppEvent * aEvent)
Action_t action = INVALID_ACTION;
int32_t actor = 0;

if (aEvent->Type == AppEvent::kEventType_Lighting)
if (aEvent->Type == AppEvent::kEventType_DeviceAction)
{
action = static_cast<Action_t>(aEvent->LightingEvent.Action);
actor = aEvent->LightingEvent.Actor;
action = static_cast<Action_t>(aEvent->DeviceEvent.Action);
actor = aEvent->DeviceEvent.Actor;
}
else if (aEvent->Type == AppEvent::kEventType_Button)
{
Expand Down
12 changes: 6 additions & 6 deletions examples/contact-sensor-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2022-2023 Project CHIP Authors
* Copyright (c) 2022-2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -67,9 +67,9 @@ void AppTask::OnStateChanged(ContactSensorManager::State aState)
void AppTask::PostContactActionRequest(ContactSensorManager::Action aAction)
{
AppEvent event;
event.Type = AppEvent::kEventType_Contact;
event.ContactEvent.Action = static_cast<uint8_t>(aAction);
event.Handler = ContactActionEventHandler;
event.Type = AppEvent::kEventType_DeviceAction;
event.DeviceEvent.Action = static_cast<uint8_t>(aAction);
event.Handler = ContactActionEventHandler;

sAppTask.PostEvent(&event);
}
Expand All @@ -95,9 +95,9 @@ void AppTask::ContactActionEventHandler(AppEvent * aEvent)

ChipLogProgress(NotSpecified, "ContactActionEventHandler");

if (aEvent->Type == AppEvent::kEventType_Contact)
if (aEvent->Type == AppEvent::kEventType_DeviceAction)
{
action = static_cast<ContactSensorManager::Action>(aEvent->ContactEvent.Action);
action = static_cast<ContactSensorManager::Action>(aEvent->DeviceEvent.Action);
}
else if (aEvent->Type == AppEvent::kEventType_Button)
{
Expand Down
10 changes: 5 additions & 5 deletions examples/contact-sensor-app/telink/src/ContactSensorManager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2022 Project CHIP Authors
* Copyright (c) 2022-2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -54,15 +54,15 @@ bool ContactSensorManager::IsContactClosed()
void ContactSensorManager::InitiateAction(Action aAction)
{
AppEvent event;
event.Type = AppEvent::kEventType_Contact;
event.ContactEvent.Action = static_cast<uint8_t>(aAction);
event.Handler = HandleAction;
event.Type = AppEvent::kEventType_DeviceAction;
event.DeviceEvent.Action = static_cast<uint8_t>(aAction);
event.Handler = HandleAction;
GetAppTask().PostEvent(&event);
}

void ContactSensorManager::HandleAction(AppEvent * aEvent)
{
Action action = static_cast<Action>(aEvent->ContactEvent.Action);
Action action = static_cast<Action>(aEvent->DeviceEvent.Action);
// Change current state based on action:
// - if state is closed and action is signal lost, change state to opened
// - if state is opened and action is signal detected, change state to closed
Expand Down
Loading
Loading