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

Test Event Trigger implementation for General Diagnostics Cluster #18807

Merged
merged 5 commits into from
May 26, 2022
Merged
Changes from 4 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
52 changes: 52 additions & 0 deletions src/app/TestEventTriggerDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright (c) 2022 Project CHIP Authors
*
tehampson marked this conversation as resolved.
Show resolved Hide resolved
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include <lib/core/CHIPError.h>
#include <lib/support/Span.h>
#include <stddef.h>
#include <stdint.h>

namespace chip {

class TestEventTriggerDelegate
{
public:
/**
* Checks to see if `enableKey` provided matches value choosen by by the manufacturer.
tehampson marked this conversation as resolved.
Show resolved Hide resolved
*
* @param[in] enableKey Buffer of the key to verify.
*/
virtual bool DoesEnableKeyMatch(const ByteSpan & enableKey) const = 0;

/**
* Expectation is that the caller has already validated the enable key before calling this.
* Handles the test event trigger based on `eventTrigger` provided.
*
* @param[in] eventTrigger Event trigger to handle.
*
* @return CHIP_ERROR_INVALID_ARGUMENT when eventTrigger is not a valid test event trigger.
*/
virtual CHIP_ERROR HandleEventTrigger(uint64_t eventTrigger) = 0;

/**
* Get the count of all configured test event triggers.
*/
virtual size_t ConfiguredEventTriggerCount() const = 0;
tehampson marked this conversation as resolved.
Show resolved Hide resolved
};

} // namespace chip