changeset 125:e5d534fa5924

fc-simtool: {inval,rehab}-adn commands implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 20 Feb 2021 19:21:40 +0000
parents d0d1c0b35831
children 7faec607500f
files simtool/dispatch.c simtool/inval_rehab.c
diffstat 2 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/simtool/dispatch.c	Sat Feb 20 19:05:48 2021 +0000
+++ b/simtool/dispatch.c	Sat Feb 20 19:21:40 2021 +0000
@@ -30,6 +30,7 @@
 extern int cmd_grcard2_set_super_hex();
 extern int cmd_iccid();
 extern int cmd_imsi();
+extern int cmd_inval_adn();
 extern int cmd_lnd_dump();
 extern int cmd_lnd_erase();
 extern int cmd_lnd_restore();
@@ -52,6 +53,7 @@
 extern int cmd_readbin();
 extern int cmd_readef();
 extern int cmd_readrec();
+extern int cmd_rehab_adn();
 extern int cmd_restore_file();
 extern int cmd_savebin();
 extern int cmd_save_sms_bin();
@@ -135,6 +137,7 @@
 	{"grcard2-set-super-hex", 1, 1, 0, cmd_grcard2_set_super_hex},
 	{"iccid", 0, 0, 1, cmd_iccid},
 	{"imsi", 0, 0, 1, cmd_imsi},
+	{"inval-adn", 0, 0, 0, cmd_inval_adn},
 	{"lnd-dump", 0, 0, 1, cmd_lnd_dump},
 	{"lnd-erase", 0, 0, 0, cmd_lnd_erase},
 	{"lnd-restore", 1, 1, 0, cmd_lnd_restore},
@@ -158,6 +161,7 @@
 	{"readbin", 2, 2, 1, cmd_readbin},
 	{"readef", 1, 1, 1, cmd_readef},
 	{"readrec", 1, 2, 1, cmd_readrec},
+	{"rehab-adn", 0, 0, 0, cmd_rehab_adn},
 	{"restore-file", 2, 2, 0, cmd_restore_file},
 	{"savebin", 2, 2, 0, cmd_savebin},
 	{"save-sms-bin", 1, 1, 0, cmd_save_sms_bin},
--- a/simtool/inval_rehab.c	Sat Feb 20 19:05:48 2021 +0000
+++ b/simtool/inval_rehab.c	Sat Feb 20 19:21:40 2021 +0000
@@ -6,6 +6,7 @@
 #include <sys/types.h>
 #include <stdio.h>
 #include "simresp.h"
+#include "file_id.h"
 
 current_ef_inval()
 {
@@ -50,3 +51,29 @@
 	}
 	return(0);
 }
+
+cmd_inval_adn()
+{
+	int rc;
+
+	rc = select_op(DF_TELECOM);
+	if (rc < 0)
+		return(rc);
+	rc = select_op(EF_ADN);
+	if (rc < 0)
+		return(rc);
+	return current_ef_inval();
+}
+
+cmd_rehab_adn()
+{
+	int rc;
+
+	rc = select_op(DF_TELECOM);
+	if (rc < 0)
+		return(rc);
+	rc = select_op(EF_ADN);
+	if (rc < 0)
+		return(rc);
+	return current_ef_rehab();
+}