Refactor connecting to SAP service and sending messages in queue

Sending and receiving works correctly, however establishing an SAP connection takes too long
This commit is contained in:
Jan-Christopher Pien
2016-10-07 16:39:02 +02:00
committed by Frank Morgner
parent 023550ac11
commit f2a68c95c1
15 changed files with 217 additions and 117 deletions

View File

@@ -0,0 +1,8 @@
#ifndef __sap_H__
#define __sap_H__
#include <nfc.h>
void send_apdu_response(nfc_se_h handle, unsigned char *resp, unsigned int resp_len);
#endif /* __tcardemulator_H__ */

View File

@@ -9,18 +9,19 @@
#include <stddef.h>
#include <glib.h>
#include <nfc.h>
extern unsigned char *rapdu;
extern size_t rapdu_length;
extern gboolean rapdu_received;
//extern unsigned char *rapdu;
//extern size_t rapdu_length;
//extern gboolean rapdu_received;
#define HELLO_ACC_ASPID "/sample/hello"
#define HELLO_ACC_ASPID "/com/vsmcartcard"
#define HELLO_ACC_CHANNELID 104
void initialize_sap();
gboolean find_peers();
gboolean request_service_connection(void);
gboolean terminate_service_connection(void);
gboolean send_data(void *message, unsigned int message_len);
gboolean send_data(nfc_se_h nfc_handle, void *message, unsigned int message_len);
#endif /* __tcardemulator_H__ */