Skip to content

Commit

Permalink
Test Event Trigger interface for General Diagnostics Cluster (#18807)
Browse files Browse the repository at this point in the history
Add TestEventTrigger Interface
  • Loading branch information
tehampson authored and pull[bot] committed Feb 19, 2024
1 parent fca7a83 commit 6cfb7e9
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/app/TestEventTriggerDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2022 Project CHIP Authors
* All rights reserved.
*
* 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 chosen by the manufacturer.
*
* @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;
};

} // namespace chip

0 comments on commit 6cfb7e9

Please sign in to comment.