Skip to content

Commit 0588165

Browse files
authored
[Telink] Fix certification tests (#33419)
* [Telink] Fix EnableKey parameter of factory data * [Telink] Add Shell Identify and TriggerEffect commands * [Telink] Use LED for Identify * [Telink] Event struct cleanup * [Telink] restyled * [Telink] use OTATestEventTriggerHandler for OtaSoftwareUpdateRequestor cluster only
1 parent 7451315 commit 0588165

File tree

18 files changed

+441
-168
lines changed

18 files changed

+441
-168
lines changed

examples/bridge-app/telink/include/AppEvent.h

-64
This file was deleted.

examples/bridge-app/telink/src/AppTask.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2023 Project CHIP Authors
3+
* Copyright (c) 2023-2024 Project CHIP Authors
44
* All rights reserved.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -539,10 +539,10 @@ void AppTask::LightingActionEventHandler(AppEvent * aEvent)
539539
Action_t action = INVALID_ACTION;
540540
int32_t actor = 0;
541541

542-
if (aEvent->Type == AppEvent::kEventType_Lighting)
542+
if (aEvent->Type == AppEvent::kEventType_DeviceAction)
543543
{
544-
action = static_cast<Action_t>(aEvent->LightingEvent.Action);
545-
actor = aEvent->LightingEvent.Actor;
544+
action = static_cast<Action_t>(aEvent->DeviceEvent.Action);
545+
actor = aEvent->DeviceEvent.Actor;
546546
}
547547
else if (aEvent->Type == AppEvent::kEventType_Button)
548548
{

examples/contact-sensor-app/telink/src/AppTask.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2022-2023 Project CHIP Authors
3+
* Copyright (c) 2022-2024 Project CHIP Authors
44
* All rights reserved.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -67,9 +67,9 @@ void AppTask::OnStateChanged(ContactSensorManager::State aState)
6767
void AppTask::PostContactActionRequest(ContactSensorManager::Action aAction)
6868
{
6969
AppEvent event;
70-
event.Type = AppEvent::kEventType_Contact;
71-
event.ContactEvent.Action = static_cast<uint8_t>(aAction);
72-
event.Handler = ContactActionEventHandler;
70+
event.Type = AppEvent::kEventType_DeviceAction;
71+
event.DeviceEvent.Action = static_cast<uint8_t>(aAction);
72+
event.Handler = ContactActionEventHandler;
7373

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

9696
ChipLogProgress(NotSpecified, "ContactActionEventHandler");
9797

98-
if (aEvent->Type == AppEvent::kEventType_Contact)
98+
if (aEvent->Type == AppEvent::kEventType_DeviceAction)
9999
{
100-
action = static_cast<ContactSensorManager::Action>(aEvent->ContactEvent.Action);
100+
action = static_cast<ContactSensorManager::Action>(aEvent->DeviceEvent.Action);
101101
}
102102
else if (aEvent->Type == AppEvent::kEventType_Button)
103103
{

examples/contact-sensor-app/telink/src/ContactSensorManager.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2022 Project CHIP Authors
3+
* Copyright (c) 2022-2024 Project CHIP Authors
44
* All rights reserved.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -54,15 +54,15 @@ bool ContactSensorManager::IsContactClosed()
5454
void ContactSensorManager::InitiateAction(Action aAction)
5555
{
5656
AppEvent event;
57-
event.Type = AppEvent::kEventType_Contact;
58-
event.ContactEvent.Action = static_cast<uint8_t>(aAction);
59-
event.Handler = HandleAction;
57+
event.Type = AppEvent::kEventType_DeviceAction;
58+
event.DeviceEvent.Action = static_cast<uint8_t>(aAction);
59+
event.Handler = HandleAction;
6060
GetAppTask().PostEvent(&event);
6161
}
6262

6363
void ContactSensorManager::HandleAction(AppEvent * aEvent)
6464
{
65-
Action action = static_cast<Action>(aEvent->ContactEvent.Action);
65+
Action action = static_cast<Action>(aEvent->DeviceEvent.Action);
6666
// Change current state based on action:
6767
// - if state is closed and action is signal lost, change state to opened
6868
// - if state is opened and action is signal detected, change state to closed

0 commit comments

Comments
 (0)