comparison pcm/read_ts.c @ 2:c03ec046471f

pcm: initial version compiles and links
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 23 Jun 2024 08:35:46 +0000
parents
children 631f2db08538
comparison
equal deleted inserted replaced
1:570252e22630 2:c03ec046471f
1 /*
2 * The function in this module gets called from Osmocom select loop
3 * whenever the data socket to osmo-e1d is ready for reading.
4 */
5
6 #include <stdint.h>
7 #include <stdbool.h>
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <unistd.h>
11
12 #include <osmocom/core/select.h>
13
14 #include "globals.h"
15
16 uint8_t readbuf[160];
17
18 int ts_fd_cb(struct osmo_fd *ofd, unsigned int what)
19 {
20 int rc;
21
22 rc = read(ts_fd, readbuf, 160);
23 if (rc != 160) {
24 fprintf(stderr,
25 "error: read from ts returned %d instead of 160\n",
26 rc);
27 exit(1);
28 }
29 return 0;
30 }