mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-18 14:28:33 +03:00
cardem: Add support for USB host based set/clear of card_insert
This way the application on the USB host can control whether the emulator should emulate that the card be inserted or not. We change the reset-default back to 'not inserted' (GPIO output 0) and wait for the application to explicitly request this by issuing CEMU_USB_MSGT_DT_CARDINSERT.
This commit is contained in:
@@ -29,6 +29,7 @@ enum cardemu_usb_msg_type {
|
||||
CEMU_USB_MSGT_DT_SET_ATR, /* Set the ATR stored in simulator */
|
||||
CEMU_USB_MSGT_DT_GET_STATS, /* request DO_STATS */
|
||||
CEMU_USB_MSGT_DT_GET_STATUS, /* request DO_STATUS */
|
||||
CEMU_USB_MSGT_DT_CARDINSERT, /* insert/remove card */
|
||||
|
||||
/* Bulk in pipe */
|
||||
CEMU_USB_MSGT_DO_RX_DATA, /* TPDU data */
|
||||
@@ -54,6 +55,12 @@ struct cardemu_usb_msg_hdr {
|
||||
/* incdicates a PB is present and we should continue with RX */
|
||||
#define CEMU_DATA_F_PB_AND_RX 0x00000008
|
||||
|
||||
/* CEMU_USB_MSGT_DT_CARDINSERT */
|
||||
struct cardemu_usb_msg_cardinsert {
|
||||
struct cardemu_usb_msg_hdr hdr;
|
||||
uint8_t card_insert;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* CEMU_USB_MSGT_DT_SET_ATR */
|
||||
struct cardemu_usb_msg_set_atr {
|
||||
struct cardemu_usb_msg_hdr hdr;
|
||||
|
||||
Reference in New Issue
Block a user