FreeCalypso > hg > vband-misc
annotate dhf/emit-dhfbin-0610.c @ 51:914eeb3ab866
efr-sid OS#6538: generate test frames in hex form
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 12 Aug 2024 03:06:17 +0000 |
parents | e4c6fc4e30f4 |
children |
rev | line source |
---|---|
35
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
36
e4c6fc4e30f4
dhf: generate binary form of FR1 DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
35
diff
changeset
|
2 * This program emits a binary file containing one GSM 06.10 DHF. |
35
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 */ |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <stdio.h> |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <stdint.h> |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <stdlib.h> |
36
e4c6fc4e30f4
dhf: generate binary form of FR1 DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
35
diff
changeset
|
8 #include <tw_gsmfr.h> |
35
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 main(argc, argv) |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 char **argv; |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 { |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 FILE *outf; |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 if (argc != 2) { |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 fprintf(stderr, "usage: %s out-bin-file\n", argv[0]); |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 exit(1); |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 } |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 outf = fopen(argv[1], "w"); |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 if (!outf) { |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 perror(argv[1]); |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 exit(1); |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 } |
36
e4c6fc4e30f4
dhf: generate binary form of FR1 DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
35
diff
changeset
|
24 fwrite(gsmfr_decoder_homing_frame, 1, 33, outf); |
35
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 fclose(outf); |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 exit(0); |
6bb1651f8c11
dhf: generate binary form of EFR DHF
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 } |