annotate pcm-br/showbuf.c @ 40:e1eabf554a75

libhr: small subset of WIP libgsmhr1
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 30 Aug 2024 16:41:56 +0000
parents 499d065ee591
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
35
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
2 * Here we implement stdin commands that display current instantaneous
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
3 * state of each read channel.
6
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 */
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include <stdint.h>
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include <stdbool.h>
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #include <stdio.h>
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 #include <stdlib.h>
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 #include <osmocom/core/select.h>
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 #include "globals.h"
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14
35
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
15 void cmd_show_a(int argc, char **argv)
6
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 {
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 int i, j, off;
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 off = 0;
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 for (i = 0; i < 10; i++) {
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 for (j = 0; j < 16; j++)
35
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
22 printf(" %02X", readbuf_a[off++]);
6
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 putchar('\n');
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 }
631f2db08538 pcm: implement print-rx and record commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 }
35
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
26
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
27 void cmd_show_b(int argc, char **argv)
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
28 {
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
29 int i, j, off;
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
30
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
31 off = 0;
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
32 for (i = 0; i < 10; i++) {
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
33 for (j = 0; j < 16; j++)
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
34 printf(" %02X", readbuf_b[off++]);
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
35 putchar('\n');
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
36 }
499d065ee591 new program itt-pcm-br (PCM bridge)
Mychaela Falconia <falcon@freecalypso.org>
parents: 6
diff changeset
37 }