2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.bluetooth.bluegiga.internal.enumeration;
15 import java.util.HashMap;
19 * Class to implement the BlueGiga Enumeration <b>SmpIoCapabilities</b>.
21 * Security Manager I/O Capabilities
23 * Note that this code is autogenerated. Manual changes may be overwritten.
25 * @author Chris Jackson - Initial contribution of Java code generator
27 public enum SmpIoCapabilities {
29 * Default unknown value
36 SM_IO_CAPABILITY_DISPLAYONLY(0x0000),
39 * [1] Display with Yes/No-buttons
41 SM_IO_CAPABILITY_DISPLAYYESNO(0x0001),
46 SM_IO_CAPABILITY_KEYBOARDONLY(0x0002),
49 * [3] No Input and No Output
51 SM_IO_CAPABILITY_NOINPUTNOOUTPUT(0x0003),
54 * [4] Display with Keyboard
56 SM_IO_CAPABILITY_KEYBOARDDISPLAY(0x0004);
59 * A mapping between the integer code and its corresponding type to
60 * facilitate lookup by code.
62 private static Map<Integer, SmpIoCapabilities> codeMapping;
66 private SmpIoCapabilities(int key) {
70 private static void initMapping() {
71 codeMapping = new HashMap<>();
72 for (SmpIoCapabilities s : values()) {
73 codeMapping.put(s.key, s);
78 * Lookup function based on the type code. Returns null if the code does not exist.
80 * @param smpIoCapabilities
82 * @return enumeration value.
84 public static SmpIoCapabilities getSmpIoCapabilities(int smpIoCapabilities) {
85 if (codeMapping == null) {
89 if (codeMapping.get(smpIoCapabilities) == null) {
93 return codeMapping.get(smpIoCapabilities);
97 * Returns the BlueGiga protocol defined value for this enum
99 * @return the BGAPI enumeration key
101 public int getKey() {