# HG changeset patch # User Mychaela Falconia # Date 1613542515 0 # Node ID 51f26fd967e2d0c80324666aa093a22407c94ca4 # Parent 07e395fddfe191bd19bcbfb57dec834372cf029b lnd-erase command implemented diff -r 07e395fddfe1 -r 51f26fd967e2 simtool/dispatch.c --- a/simtool/dispatch.c Wed Feb 17 06:08:28 2021 +0000 +++ b/simtool/dispatch.c Wed Feb 17 06:15:15 2021 +0000 @@ -26,6 +26,7 @@ extern int cmd_iccid(); extern int cmd_imsi(); extern int cmd_lnd_dump(); +extern int cmd_lnd_erase(); extern int cmd_lnd_write(); extern int cmd_opl_dump(); extern int cmd_pb_dump(); @@ -114,6 +115,7 @@ {"iccid", 0, 0, cmd_iccid}, {"imsi", 0, 0, cmd_imsi}, {"lnd-dump", 0, 1, cmd_lnd_dump}, + {"lnd-erase", 0, 0, cmd_lnd_erase}, {"lnd-write", 1, 2, cmd_lnd_write}, {"opl-dump", 0, 0, cmd_opl_dump}, {"pb-dump", 1, 2, cmd_pb_dump}, diff -r 07e395fddfe1 -r 51f26fd967e2 simtool/lndwrite.c --- a/simtool/lndwrite.c Wed Feb 17 06:08:28 2021 +0000 +++ b/simtool/lndwrite.c Wed Feb 17 06:15:15 2021 +0000 @@ -31,3 +31,22 @@ } return update_rec_op(0, 0x03, record, curfile_record_len); } + +cmd_lnd_erase(argc, argv) + char **argv; +{ + int rc; + u_char record[255]; + unsigned count; + + rc = select_ef_lnd(); + if (rc < 0) + return(rc); + memset(record, 0xFF, curfile_record_len); + for (count = 0; count < curfile_record_count; count++) { + rc = update_rec_op(0, 0x03, record, curfile_record_len); + if (rc < 0) + return(rc); + } + return(0); +}