command to change fidi send by host
diff --git a/firmware/src_simtrace/host_communication.c b/firmware/src_simtrace/host_communication.c
index fcec1c1..990119f 100644
--- a/firmware/src_simtrace/host_communication.c
+++ b/firmware/src_simtrace/host_communication.c
@@ -1,14 +1,14 @@
#include "board.h"
static volatile bool write_to_host_in_progress = false;
-static struct iso7816_3_handle ih = {0};
static bool check_for_pts = false;
-static enum pts_state state;
+
+static struct Usart_info usart_info = {.base = USART_PHONE, .id = ID_USART_PHONE, .state = USART_RCV};
void USB_write_callback(uint8_t *pArg, uint8_t status, uint32_t transferred, uint32_t remaining)
{
if (status != USBD_STATUS_SUCCESS) {
- TRACE_ERROR("USB err status: %d (%s)\n", __FUNCTION__, status);
+ TRACE_ERROR("USB err status: %d(%s)\n", __FUNCTION__, status);
}
write_to_host_in_progress = false;
TRACE_DEBUG("WR_CB\n");
@@ -40,26 +40,6 @@
if((rbuf_is_empty(&sim_rcv_buf) || write_to_host_in_progress == true)) {
return ret;
}
- if ((check_for_pts == false) && (rbuf_peek(&sim_rcv_buf) == 0xff)) {
-// FIXME: set var to false
- check_for_pts = true;
- ih = (struct iso7816_3_handle){0};
- }
- if (check_for_pts == true) {
- while (!rbuf_is_empty(&sim_rcv_buf) && (ih.pts_state != PTS_END)) {
- state = process_byte_pts(&ih, rbuf_read(&sim_rcv_buf));
- }
- if (ih.pts_bytes_processed > 6 && ih.pts_state != PTS_END) {
- int i;
- for (i = 0; i < ih.pts_bytes_processed; i++)
- printf("s: %x", ih.pts_req[i]);
- check_for_pts = false;
- rbuf_write(&sim_rcv_buf, ih.pts_req[i]);
- } else {
- printf("fin pts\n", ih.pts_state);
- check_for_pts = false;
- }
- }
ret = send_to_host();
return ret;
}