Просмотр исходного кода

correct when to add success status word to response

Eric Betts 9 месяцев назад
Родитель
Сommit
8d26609f9f
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      seos_emulator.c

+ 8 - 1
seos_emulator.c

@@ -617,7 +617,14 @@ NfcCommand seos_worker_listener_callback(NfcGenericEvent event, void* context) {
 
 
         if(bit_buffer_get_size_bytes(seos_emulator->tx_buffer) >
         if(bit_buffer_get_size_bytes(seos_emulator->tx_buffer) >
            offset) { // contents belong iso framing
            offset) { // contents belong iso framing
-            bit_buffer_append_bytes(tx_buffer, success, sizeof(success));
+
+            if(memcmp(
+                   FILE_NOT_FOUND,
+                   bit_buffer_get_data(tx_buffer) + bit_buffer_get_size_bytes(tx_buffer) -
+                       sizeof(FILE_NOT_FOUND),
+                   sizeof(FILE_NOT_FOUND)) != 0) {
+                bit_buffer_append_bytes(tx_buffer, success, sizeof(success));
+            }
 
 
             iso14443_crc_append(Iso14443CrcTypeA, tx_buffer);
             iso14443_crc_append(Iso14443CrcTypeA, tx_buffer);