diff options
Diffstat (limited to 'src/wallet.h')
-rw-r--r-- | src/wallet.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/wallet.h b/src/wallet.h new file mode 100644 index 0000000..4d51088 --- /dev/null +++ b/src/wallet.h @@ -0,0 +1,57 @@ +/* + This file is part of TALER + Copyright (C) 2019 GNUnet e.V. + + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + + You should have received a copy of the GNU General Public License +along with + TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> +*/ + +/** +* @file wallet.h +* @brief functions to communicate with taler wallet over nfc +* @author BOSS Marco +*/ + +#ifndef WALLET_H +#define WALLET_H + +#include <nfc/nfc.h> + + +// New AID +// static uint8_t taler_aid[] = { 0xF0, 0x00, 0x54, 0x41, 0x4c, 0x45, 0x52 }; + +// Demo AID until uptade +static const uint8_t taler_aid[] = { 0xA0, 0x00, 0x00, 0x02, 0x47, 0x10, 0x01 }; + +#define TRANSMIT_TIMEOUT 500 + +// APDU commands +#define APDU_SUCCESS "\x90\x00" +static const uint8_t select_file[] = { 0x00, 0xA4, 0x04, 0x00, 0x07 }; +static const uint8_t put_data[] = { 0x00, 0xDA, 0x01, 0x00, 0x7c, 0x01 }; + + + +int wallet_select_aid( nfc_device *pnd ); + +int wallet_put_message( nfc_device *pnd, const char *msg, size_t msgSize ); + +int wallet_transmit( nfc_device* pnd, const char *msg, size_t msgLen ); + +int concat_message( const uint8_t* command, size_t commandSize, const uint8_t *message, uint8_t *retMsg, size_t returnSize ); + +int check_response( uint8_t *response, uint8_t responseLen ); + +#endif // WALLET_H |