FreeCalypso > hg > fc-sim-tools
comparison simtool/miscadm.c @ 101:1888d88478c4
fc-simtool write-hplmn-timer new command
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 14 May 2022 22:54:19 +0000 |
parents | ddd767f6e15b |
children |
comparison
equal
deleted
inserted
replaced
100:dc772132b5c9 | 101:1888d88478c4 |
---|---|
212 rc = qstring_arg_to_gsm7(argv[2], binrec + 1, 16); | 212 rc = qstring_arg_to_gsm7(argv[2], binrec + 1, 16); |
213 if (rc < 0) | 213 if (rc < 0) |
214 return(rc); | 214 return(rc); |
215 return write_spn_bin(binrec); | 215 return write_spn_bin(binrec); |
216 } | 216 } |
217 | |
218 static | |
219 write_hplmn_bin(binrec) | |
220 u_char *binrec; | |
221 { | |
222 int rc; | |
223 | |
224 rc = select_op(DF_GSM); | |
225 if (rc < 0) | |
226 return(rc); | |
227 rc = select_op(EF_HPLMN); | |
228 if (rc < 0) | |
229 return(rc); | |
230 rc = parse_ef_select_response(); | |
231 if (rc < 0) | |
232 return(rc); | |
233 if (curfile_structure != 0x00 || curfile_total_size != 1) { | |
234 fprintf(stderr, | |
235 "error: EF_HPLMN is not a transparent EF of 1 byte\n"); | |
236 return(-1); | |
237 } | |
238 return update_bin_op(0, binrec, 1); | |
239 } | |
240 | |
241 cmd_write_hplmn_timer(argc, argv) | |
242 char **argv; | |
243 { | |
244 u_char datum; | |
245 | |
246 datum = strtoul(argv[1], 0, 0); | |
247 return write_hplmn_bin(&datum); | |
248 } |