comparison frtest/dlcap-parse.c @ 178:5fe0b3eb35c1

gsmfr-dlcap-parse: also parse hex output from fc-vm2hex
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 27 Dec 2022 06:44:29 +0000
parents 80c93ef82a51
children 251aed72925e
comparison
equal deleted inserted replaced
177:ecce11a4890c 178:5fe0b3eb35c1
74 } 74 }
75 for (lineno = 1; fgets(linebuf, sizeof linebuf, inf); lineno++) { 75 for (lineno = 1; fgets(linebuf, sizeof linebuf, inf); lineno++) {
76 /* support both old and new formats */ 76 /* support both old and new formats */
77 if (isxdigit(linebuf[0]) && isxdigit(linebuf[1]) && 77 if (isxdigit(linebuf[0]) && isxdigit(linebuf[1]) &&
78 isxdigit(linebuf[2]) && isxdigit(linebuf[3])) { 78 isxdigit(linebuf[2]) && isxdigit(linebuf[3])) {
79 /* also support parsing output from fc-vm2hex */
80 if (linebuf[4] == '\n') {
81 printf("#%d: fn=0 DSP %.4s\n", lineno, linebuf);
82 continue;
83 }
79 rc = parse_dlcap_common(linebuf, status_words, 84 rc = parse_dlcap_common(linebuf, status_words,
80 tidsp_bytes); 85 tidsp_bytes);
81 if (rc < 0) { 86 if (rc < 0) {
82 invalid: fprintf(stderr, 87 invalid: fprintf(stderr,
83 "error: %s is not in the expected format\n", 88 "error: %s is not in the expected format\n",