|
| 1 | +/* |
| 2 | + * |
| 3 | + * Copyright (c) 2024 Project CHIP Authors |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + */ |
| 17 | + |
| 18 | +#pragma once |
| 19 | + |
| 20 | +#include <app-common/zap-generated/cluster-objects.h> |
| 21 | + |
| 22 | +namespace chip { |
| 23 | +namespace app { |
| 24 | +namespace Clusters { |
| 25 | +namespace DoorLock { |
| 26 | + |
| 27 | +static constexpr size_t kAliroReaderVerificationKeySize = 65; |
| 28 | + |
| 29 | +static constexpr size_t kAliroReaderGroupIdentifierSize = 16; |
| 30 | + |
| 31 | +static constexpr size_t kAliroReaderGroupSubIdentifierSize = 16; |
| 32 | + |
| 33 | +static constexpr size_t kAliroGroupResolvingKeySize = 16; |
| 34 | + |
| 35 | +static constexpr size_t kAliroProtocolVersionSize = 2; |
| 36 | + |
| 37 | +static constexpr size_t kAliroSigningKeySize = 32; |
| 38 | + |
| 39 | +/** @brief |
| 40 | + * Defines methods for implementing application-specific logic for the door lock cluster. |
| 41 | + * It defines the interfaces that a door lock should implement to support Aliro provisioning attributes. |
| 42 | + */ |
| 43 | + |
| 44 | +class Delegate |
| 45 | +{ |
| 46 | +public: |
| 47 | + Delegate() = default; |
| 48 | + |
| 49 | + virtual ~Delegate() = default; |
| 50 | + |
| 51 | + /** |
| 52 | + * @brief Get the Aliro verification key component of the Reader's key pair. |
| 53 | + * |
| 54 | + * @param[out] verificationKey The MutableByteSpan to copy the verification key into. On success, |
| 55 | + * the callee must update the length to the length of the copied data. If the value of |
| 56 | + * the attribute is null, the callee must set the MutableByteSpan to empty. |
| 57 | + */ |
| 58 | + virtual CHIP_ERROR GetAliroReaderVerificationKey(MutableByteSpan & verificationKey) = 0; |
| 59 | + |
| 60 | + /** |
| 61 | + * @brief Get the Aliro Reader's group identifier |
| 62 | + * |
| 63 | + * @param[out] groupIdentifier The MutableByteSpan to copy the group identifier into. On success, |
| 64 | + * the callee must update the length to the length of the copied data. If the value of |
| 65 | + * the attribute is null, the callee must set the MutableByteSpan to empty. |
| 66 | + */ |
| 67 | + virtual CHIP_ERROR GetAliroReaderGroupIdentifier(MutableByteSpan & groupIdentifier) = 0; |
| 68 | + |
| 69 | + /** |
| 70 | + * @brief Get the Aliro Reader's group subidentifier |
| 71 | + * |
| 72 | + * @param[out] groupSubIdentifier The MutableByteSpan to copy the group subidentifier into. On success, |
| 73 | + * the callee must update the length to the length of the copied data. The MutableByteSpan |
| 74 | + * must not be empty since the attribute is not nullable. |
| 75 | + */ |
| 76 | + virtual CHIP_ERROR GetAliroReaderGroupSubIdentifier(MutableByteSpan & groupSubIdentifier) = 0; |
| 77 | + |
| 78 | + /** |
| 79 | + * @brief Get the Aliro expedited transaction supported protocol version at the given index. |
| 80 | + * |
| 81 | + * @param[in] index The index of the protocol version in the list. |
| 82 | + * @param[out] protocolVersion The MutableByteSpan to copy the expedited transaction supported protocol version at the given |
| 83 | + * index into. On success, the callee must update the length to the length of the copied data. |
| 84 | + * @return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED if the index is out of range for the attribute list. |
| 85 | + */ |
| 86 | + virtual CHIP_ERROR GetAliroExpeditedTransactionSupportedProtocolVersionAtIndex(size_t index, |
| 87 | + MutableByteSpan & protocolVersion) = 0; |
| 88 | + |
| 89 | + /** |
| 90 | + * @brief Get the Reader's group resolving key. |
| 91 | + * |
| 92 | + * @param[out] groupResolvingKey The MutableByteSpan to copy the group resolving key into. On success, |
| 93 | + * the callee must update the length to the length of the copied data. If the value of |
| 94 | + * the attribute is null, the callee must set the MutableByteSpan to empty. |
| 95 | + */ |
| 96 | + virtual CHIP_ERROR GetAliroGroupResolvingKey(MutableByteSpan & groupResolvingKey) = 0; |
| 97 | + |
| 98 | + /** |
| 99 | + * @brief Get the Aliro supported BLE UWB protocol version at the given index. |
| 100 | + * |
| 101 | + * @param[in] index The index of the protocol version in the list. |
| 102 | + * @param[out] protocolVersion The MutableByteSpan to copy the supported BLE UWB protocol version at the given index into. |
| 103 | + * On success, the callee must update the length to the length of the copied data. |
| 104 | + * @return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED if the index is out of range for the attribute list. |
| 105 | + */ |
| 106 | + virtual CHIP_ERROR GetAliroSupportedBLEUWBProtocolVersionAtIndex(size_t index, MutableByteSpan & protocolVersion) = 0; |
| 107 | + |
| 108 | + /** |
| 109 | + * @brief Get the Aliro BLE Advertising Version. |
| 110 | + * |
| 111 | + * @return The BLE Advertising Version. |
| 112 | + */ |
| 113 | + virtual uint8_t GetAliroBLEAdvertisingVersion() = 0; |
| 114 | + |
| 115 | + /** |
| 116 | + * @brief Get the maximum number of Aliro credential issuer keys supported. |
| 117 | + * |
| 118 | + * @return The max number of Aliro credential issuer keys supported. |
| 119 | + */ |
| 120 | + virtual uint16_t GetNumberOfAliroCredentialIssuerKeysSupported() = 0; |
| 121 | + |
| 122 | + /** |
| 123 | + * @brief Get the maximum number of Aliro endpoint keys supported. |
| 124 | + * |
| 125 | + * @return The max number of Aliro endpoint keys supported. |
| 126 | + */ |
| 127 | + virtual uint16_t GetNumberOfAliroEndpointKeysSupported() = 0; |
| 128 | +}; |
| 129 | + |
| 130 | +} // namespace DoorLock |
| 131 | +} // namespace Clusters |
| 132 | +} // namespace app |
| 133 | +} // namespace chip |
0 commit comments