3 * Copyright (c) 2020 Project CHIP Authors
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 * This file describes a Manual Entry Code Generator based on the
23 * The encoding of the binary data to a decimal string is split
24 * into 5 chunks <1-digit/3-bits><5 digits/16-bits><4-digits/13-bits><5-digits/16-bits><5-digits/16-bits>:
25 * - <1 digit> Represents:
26 * - <bits 1..0> Discriminator <bits 11.10>
27 * - <bit 2> VID/PID present flag
28 * - <5 digits> Represents:
29 * - <bits 13..0> PIN Code <bits 13..0>
30 * - <bits 15..14> Discriminator <bits 9..8>
31 * - <4 digits> Represents:
32 * - <bits 12..0> PIN Code <bits 26..14>
33 * - <5 digits> Vendor ID
34 * - <5 digits> Product ID
40 #include "SetupPayload.h"
42 #include <core/CHIPError.h>
48 class ManualSetupPayloadGenerator
51 SetupPayload mSetupPayload;
54 ManualSetupPayloadGenerator(const SetupPayload & payload) : mSetupPayload(payload) {}
56 // Populates decimal string representation of the payload into outDecimalString
57 CHIP_ERROR payloadDecimalStringRepresentation(std::string & outDecimalString);