• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  /*
2  ** Licensed under the Apache License, Version 2.0 (the "License");
3  ** you may not use this file except in compliance with the License.
4  ** You may obtain a copy of the License at
5  **
6  ** http://www.apache.org/licenses/LICENSE-2.0
7  **
8  ** Unless required by applicable law or agreed to in writing, software
9  ** distributed under the License is distributed on an "AS IS" BASIS,
10  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11  ** See the License for the specific language governing permissions and
12  ** limitations under the License.
13  **
14  ** Copyright 2020-2021 NXP
15  **
16  */
17 #ifndef __ESE_TRANSPORT_CONFIG__
18 #define __ESE_TRANSPORT_CONFIG__
19 #include <vector>
20 
21 namespace keymint::javacard {
22 
23 #define MAX_GET_SERVICE_RETRY 10
24 #define ONE_SEC  1000*1000*1
25 #define LOGICAL_CH_NOT_SUPPORTED_SW1 0x68
26 #define LOGICAL_CH_NOT_SUPPORTED_SW2 0x81
27 #define APDU_INS_OFFSET 1      // INS offset in command APDU
28 #define SELECT_P2_VALUE_0 0    // Select command P2 value 0
29 #define SELECT_P2_VALUE_2 2    // Select command P2 value 2
30 #define MAX_RETRY_COUNT 3      // Number of retry in case of failure
31 
32 // Helper method to dump vector contents
33 static bool debug_omapi = true;
34 #define LOGD_OMAPI(x) \
35   if(debug_omapi) { \
36     LOG(INFO) <<"("<<__FUNCTION__ <<")"<<" "<<x; \
37   }
38 
39 #define LOGE_OMAPI(x) \
40     LOG(INFO) <<"("<<__FUNCTION__ <<")"<<" "<<x;
41 std::ostream& operator<<(std::ostream& os, const std::vector<uint8_t>& vec);
42 
43 } // namespace keymint::javacard
44 #endif /* __ESE_TRANSPORT_CONFIG__ */
45