FreeCalypso > hg > fc-pcsc-tools
comparison simtool/lndwrite.c @ 83:07e395fddfe1
lnd-write command implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 17 Feb 2021 06:08:28 +0000 |
parents | simtool/pbupd_imm.c@52ec2d3eb851 |
children | 51f26fd967e2 |
comparison
equal
deleted
inserted
replaced
82:fe660c7ea97f | 83:07e395fddfe1 |
---|---|
1 /* | |
2 * This module implements lnd-write and lnd-erase commands. | |
3 */ | |
4 | |
5 #include <sys/types.h> | |
6 #include <string.h> | |
7 #include <strings.h> | |
8 #include <stdio.h> | |
9 #include <stdlib.h> | |
10 #include "curfile.h" | |
11 | |
12 cmd_lnd_write(argc, argv) | |
13 char **argv; | |
14 { | |
15 int rc; | |
16 u_char record[255], *fixp; | |
17 | |
18 rc = select_ef_lnd(); | |
19 if (rc < 0) | |
20 return(rc); | |
21 memset(record, 0xFF, curfile_record_len); | |
22 fixp = record + curfile_record_len - 14; | |
23 rc = encode_phone_number_arg(argv[1], fixp, 0); | |
24 if (rc < 0) | |
25 return(rc); | |
26 if (argv[2]) { | |
27 rc = qstring_arg_to_gsm7(argv[2], record, | |
28 curfile_record_len - 14); | |
29 if (rc < 0) | |
30 return(rc); | |
31 } | |
32 return update_rec_op(0, 0x03, record, curfile_record_len); | |
33 } |