changeset 199:7ecc08e55d39

fc-simtool fplmn-write-list command implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 07 Mar 2021 02:55:35 +0000
parents 3bde063234aa
children bca0f86d9efe
files simtool/dispatch.c simtool/fplmn.c
diffstat 2 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/simtool/dispatch.c	Sun Mar 07 02:48:12 2021 +0000
+++ b/simtool/dispatch.c	Sun Mar 07 02:55:35 2021 +0000
@@ -27,6 +27,7 @@
 extern int cmd_fplmn_erase();
 extern int cmd_fplmn_erase_all();
 extern int cmd_fplmn_write();
+extern int cmd_fplmn_write_list();
 extern int cmd_get_response();
 extern int cmd_grcard1_set_adm();
 extern int cmd_grcard1_set_ki();
@@ -146,6 +147,7 @@
 	{"fplmn-erase", 1, 2, 0, cmd_fplmn_erase},
 	{"fplmn-erase-all", 0, 0, 0, cmd_fplmn_erase_all},
 	{"fplmn-write", 2, 2, 0, cmd_fplmn_write},
+	{"fplmn-write-list", 1, 1, 0, cmd_fplmn_write_list},
 	{"get-response", 1, 1, 1, cmd_get_response},
 	{"grcard1-set-adm1", 2, 2, 0, cmd_grcard1_set_adm},
 	{"grcard1-set-adm2", 2, 2, 0, cmd_grcard1_set_adm},
--- a/simtool/fplmn.c	Sun Mar 07 02:48:12 2021 +0000
+++ b/simtool/fplmn.c	Sun Mar 07 02:55:35 2021 +0000
@@ -90,6 +90,21 @@
 	return update_bin_op(idx * 3, rec, 3);
 }
 
+cmd_fplmn_write_list(argc, argv)
+	char **argv;
+{
+	int rc;
+	u_char buf[12];
+
+	rc = select_ef_fplmn();
+	if (rc < 0)
+		return(rc);
+	rc = read_plmn_list_from_file(argv[1], buf, 12);
+	if (rc < 0)
+		return(rc);
+	return update_bin_op(0, buf, 12);
+}
+
 cmd_fplmn_erase(argc, argv)
 	char **argv;
 {