Skip to content

Commit

Permalink
chore(driver): set pcsc and curl as default drivers. (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
damonto authored Aug 1, 2024
1 parent 3bde4a1 commit c86edd5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion driver/apdu/qmi_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void qmi_apdu_interface_disconnect(struct euicc_ctx *ctx)

void qmi_cleanup(struct qmi_data *qmi_priv)
{
if (qmi_priv->lastChannelId != -1)
if (qmi_priv->lastChannelId > 0)
{
fprintf(stderr, "Cleaning up leaked APDU channel %d\n", qmi_priv->lastChannelId);
qmi_apdu_interface_logic_channel_close(NULL, qmi_priv->lastChannelId);
Expand Down
14 changes: 13 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,19 @@ int main(int argc, char **argv)

memset(&euicc_ctx, 0, sizeof(euicc_ctx));

if (euicc_driver_init(getenv("LPAC_APDU"), getenv("LPAC_HTTP")))
const char *apdu_driver = getenv("LPAC_APDU");
if (apdu_driver == NULL)
{
apdu_driver = "pcsc";
}

const char *http_driver = getenv("LPAC_HTTP");
if (http_driver == NULL)
{
http_driver = "curl";
}

if (euicc_driver_init(apdu_driver, http_driver))
{
return -1;
}
Expand Down

0 comments on commit c86edd5

Please sign in to comment.