mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
firmware: allow to change the sim presence pin polarity
The sim presence pin allows the simtrace2 to inform the modem about the presence of the simcard. On a generic simcard slot a button is pressed by the simcard which generate a high or low voltage level. Even though there are specifications of minipcie or ngff defining this signal, certain modems behave different. Certain modems require different signals from the specification. Extend the usb protocol to set the behaviour at runtime. Related: SYS#6946 Change-Id: I77118114ba873fdf0778137402888b40f2442456
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "trace.h"
|
||||
#include "iso7816_fidi.h"
|
||||
#include "card_emu.h"
|
||||
#include "simtrace.h"
|
||||
#include "simtrace_prot.h"
|
||||
#include "usb_buf.h"
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
@@ -1096,7 +1097,7 @@ static void card_emu_report_config(struct card_handle *ch)
|
||||
#else
|
||||
cfg->slot_mux_nr = 0;
|
||||
#endif
|
||||
|
||||
cfg->pres_pol = mode_cardemu_get_presence_pol(ch->num) | CEMU_CONFIG_PRES_POL_VALID;
|
||||
|
||||
usb_buf_upd_len_and_submit(msg);
|
||||
}
|
||||
@@ -1270,6 +1271,11 @@ int card_emu_set_config(struct card_handle *ch, const struct cardemu_usb_msg_con
|
||||
}
|
||||
#endif
|
||||
|
||||
if (scfg_len >= sizeof(uint32_t)+sizeof(uint8_t)+sizeof(uint8_t)) {
|
||||
if (scfg->pres_pol & CEMU_CONFIG_PRES_POL_VALID)
|
||||
mode_cardemu_set_presence_pol(ch->num, scfg->pres_pol & CEMU_CONFIG_PRES_POL_PRES_H);
|
||||
}
|
||||
|
||||
/* send back a report of our current configuration */
|
||||
card_emu_report_config(ch);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user