diff --git a/src/app/TestEventTriggerDelegate.h b/src/app/TestEventTriggerDelegate.h new file mode 100644 index 00000000000000..c0ec5213b22794 --- /dev/null +++ b/src/app/TestEventTriggerDelegate.h @@ -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 +#include +#include +#include + +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