blob: db27f6f24b3a7c68c6f41700b60c2dec8217af66 [file] [log] [blame]
Andre Eisenbach38003282017-11-17 16:52:05 -08001/*
2 * Copyright 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include <string>
19#include <vector>
20
21#include <config.h>
22
Andre Eisenbacha34d7d12017-11-27 13:16:18 -080023#define NAME_NFC_DEBUG_ENABLED "NFC_DEBUG_ENABLED"
24#define NAME_POLLING_TECH_MASK "POLLING_TECH_MASK"
25#define NAME_NFA_DM_CFG "NFA_DM_CFG"
26#define NAME_SCREEN_OFF_POWER_STATE "SCREEN_OFF_POWER_STATE"
27#define NAME_NFA_STORAGE "NFA_STORAGE"
28#define NAME_UICC_LISTEN_TECH_MASK "UICC_LISTEN_TECH_MASK"
29#define NAME_NFA_DM_DISC_DURATION_POLL "NFA_DM_DISC_DURATION_POLL"
30#define NAME_AID_FOR_EMPTY_SELECT "AID_FOR_EMPTY_SELECT"
31#define NAME_PRESERVE_STORAGE "PRESERVE_STORAGE"
32#define NAME_NFA_MAX_EE_SUPPORTED "NFA_MAX_EE_SUPPORTED"
33#define NAME_POLL_FREQUENCY "POLL_FREQUENCY"
34#define NAME_PRESENCE_CHECK_ALGORITHM "PRESENCE_CHECK_ALGORITHM"
35#define NAME_DEVICE_HOST_WHITE_LIST "DEVICE_HOST_WHITE_LIST"
36#define NAME_NFA_POLL_BAIL_OUT_MODE "NFA_POLL_BAIL_OUT_MODE"
37#define NAME_NFA_PROPRIETARY_CFG "NFA_PROPRIETARY_CFG"
38#define NAME_NFA_AID_BLOCK_ROUTE "NFA_AID_BLOCK_ROUTE"
39#define NAME_ISO_DEP_MAX_TRANSCEIVE "ISO_DEP_MAX_TRANSCEIVE"
Ruchi Kandoi7aa67062018-01-29 12:49:17 -080040#define NAME_OFF_HOST_ESE_PIPE_ID "OFF_HOST_ESE_PIPE_ID"
41#define NAME_OFF_HOST_SIM_PIPE_ID "OFF_HOST_SIM_PIPE_ID"
Andre Eisenbacha34d7d12017-11-27 13:16:18 -080042
Andre Eisenbach38003282017-11-17 16:52:05 -080043class NfcConfig {
44 public:
45 static bool hasKey(const std::string& key);
46 static std::string getString(const std::string& key);
Andre Eisenbacha34d7d12017-11-27 13:16:18 -080047 static std::string getString(const std::string& key,
48 std::string default_value);
Andre Eisenbach38003282017-11-17 16:52:05 -080049 static unsigned getUnsigned(const std::string& key);
Andre Eisenbacha34d7d12017-11-27 13:16:18 -080050 static unsigned getUnsigned(const std::string& key, unsigned default_value);
Andre Eisenbach38003282017-11-17 16:52:05 -080051 static std::vector<uint8_t> getBytes(const std::string& key);
Andre Eisenbacha34d7d12017-11-27 13:16:18 -080052 static void clear();
Andre Eisenbach38003282017-11-17 16:52:05 -080053
54 private:
55 static NfcConfig& getInstance();
56 NfcConfig();
57
58 ConfigFile config_;
59};