Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers iso7816_app.h Source File

iso7816_app.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2015-2018, ARM Limited, All Rights Reserved
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00006  * not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  * http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00013  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 /**
00018  * \file iso7816_app.h
00019  * \copyright Copyright (c) ARM Ltd 2015
00020  * \author Donatien Garnier
00021  */
00022 #ifndef TECH_ISO7816_ISO7816_APP_H_
00023 #define TECH_ISO7816_ISO7816_APP_H_
00024 
00025 #include "stack/nfc_common.h"
00026 #include "iso7816.h"
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00032 struct nfc_tech_iso7816;
00033 struct nfc_tech_iso7816_app;
00034 
00035 typedef void (*nfc_tech_iso7816_app_cb)(nfc_tech_iso7816_app_t *pIso7816App, void *pUserData);
00036 
00037 struct nfc_tech_iso7816_app {
00038     nfc_tech_iso7816_t *pIso7816;
00039 
00040     const uint8_t *aid;
00041     size_t aidSize;
00042 
00043     nfc_tech_iso7816_app_cb selected;
00044     nfc_tech_iso7816_app_cb deselected;
00045     nfc_tech_iso7816_app_cb apdu;
00046 
00047     void *pUserData;
00048 
00049     nfc_tech_iso7816_app_t *pNext;
00050 };
00051 
00052 void nfc_tech_iso7816_app_init(nfc_tech_iso7816_app_t *pIso7816App, nfc_tech_iso7816_t *pIso7816, const uint8_t *aid, size_t aidSize,
00053                                nfc_tech_iso7816_app_cb selected,
00054                                nfc_tech_iso7816_app_cb deselected,
00055                                nfc_tech_iso7816_app_cb apdu,
00056                                void *pUserData
00057                               );
00058 
00059 inline static nfc_err_t nfc_tech_iso7816_app_reply(nfc_tech_iso7816_app_t *pIso7816App)
00060 {
00061     return nfc_tech_iso7816_reply(pIso7816App->pIso7816);
00062 }
00063 
00064 inline static nfc_tech_iso7816_c_apdu_t *nfc_tech_iso7816_app_c_apdu(nfc_tech_iso7816_app_t *pIso7816App)
00065 {
00066     return nfc_tech_iso7816_c_apdu(pIso7816App->pIso7816);
00067 }
00068 
00069 inline static nfc_tech_iso7816_r_apdu_t *nfc_tech_iso7816_app_r_apdu(nfc_tech_iso7816_app_t *pIso7816App)
00070 {
00071     return nfc_tech_iso7816_r_apdu(pIso7816App->pIso7816);
00072 }
00073 
00074 #ifdef __cplusplus
00075 }
00076 #endif
00077 
00078 #endif /* TECH_ISO7816_ISO7816_APP_H_ */