Files
Momentum-Firmware/targets/furi_hal_include/furi_hal_usb_ccid.h
Filipe Paz Rodrigues 1510d8773b CCID: Improve request and response data handling (#3741)
* CCID: Improve request and response data handling
  - Add iso7816_set_response function: serves a helpers to set SW1 and SW2 values
  - improved iso7816_read_response_apdu by correctly parsing Lc and Le values
  - add client script to make testing easier
* lint and rename
* Format
* Review changes: pragma once, typedef
* Move command/response data and datalen into respective structures
* Remove conditional for Lc=0
* Fix comment: Le
* Make PVS happy and fix spelling

Co-authored-by: あく <alleteam@gmail.com>
2024-07-06 12:08:44 +01:00

39 lines
911 B
C

#pragma once
#include "hid_usage_desktop.h"
#include "hid_usage_button.h"
#include "hid_usage_keyboard.h"
#include "hid_usage_consumer.h"
#include "hid_usage_led.h"
#define CCID_SHORT_APDU_SIZE (0xFF)
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
uint16_t vid;
uint16_t pid;
char manuf[32];
char product[32];
} FuriHalUsbCcidConfig;
typedef struct {
void (*icc_power_on_callback)(uint8_t* dataBlock, uint32_t* dataBlockLen, void* context);
void (*xfr_datablock_callback)(
const uint8_t* pcToReaderDataBlock,
uint32_t pcToReaderDataBlockLen,
uint8_t* readerToPcDataBlock,
uint32_t* readerToPcDataBlockLen,
void* context);
} CcidCallbacks;
void furi_hal_ccid_set_callbacks(CcidCallbacks* cb, void* context);
void furi_hal_ccid_ccid_insert_smartcard(void);
void furi_hal_ccid_ccid_remove_smartcard(void);
#ifdef __cplusplus
}
#endif