From 8b1f24a29ebc7651437c01990215a55b1136dae0 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 18 Jan 2017 15:19:38 +0900 Subject: scd: Add "card_list" sub command for GETINFO. * scd/app.c (app_send_card_list): New. * scd/command.c (cmd_getinfo): Fix "status" sub command. Add "card_list" sub command. Signed-off-by: NIIBE Yutaka --- scd/app.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'scd/app.c') diff --git a/scd/app.c b/scd/app.c index 06850d87f..681acb822 100644 --- a/scd/app.c +++ b/scd/app.c @@ -1103,3 +1103,21 @@ app_list_finish (void) { npth_mutex_unlock (&app_list_lock); } + +void +app_send_card_list (ctrl_t ctrl) +{ + app_t a; + char buf[65]; + + npth_mutex_lock (&app_list_lock); + for (a = app_top; a; a = a->next) + { + if (DIM (buf) < 2 * a->serialnolen + 1) + continue; + + bin2hex (a->serialno, a->serialnolen, buf); + send_status_direct (ctrl, "SERIALNO", buf); + } + npth_mutex_unlock (&app_list_lock); +} -- cgit v1.2.3