FreeCalypso > hg > fc-pcsc-tools
diff simtool/writecmd.c @ 78:702c2c40e51a
fc-simtool update-rec-prev command implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 17 Feb 2021 05:07:54 +0000 |
parents | 2071b28cd0c7 |
children | a1aa8ee2da85 |
line wrap: on
line diff
--- a/simtool/writecmd.c Wed Feb 17 01:17:00 2021 +0000 +++ b/simtool/writecmd.c Wed Feb 17 05:07:54 2021 +0000 @@ -63,3 +63,19 @@ } return update_rec_op(recno, 0x04, data, curfile_record_len); } + +cmd_update_rec_prev(argc, argv) + char **argv; +{ + u_char data[255]; + int rc; + + rc = read_hex_data_file(argv[1], data); + if (rc < 0) + return(rc); + if (rc != curfile_record_len) { + fprintf(stderr, "error: hex data length != EF record length\n"); + return(-1); + } + return update_rec_op(0, 0x03, data, curfile_record_len); +}