FreeCalypso > hg > ice1-trau-tester
view pcm/read_ts.c @ 24:f49e57b0d1a2
ater: implement activ command
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 24 Jun 2024 18:48:36 +0000 |
parents | ca351324187a |
children |
line wrap: on
line source
/* * The function in this module gets called from Osmocom select loop * whenever the data socket to osmo-e1d is ready for reading. */ #include <stdint.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <osmocom/core/select.h> #include "globals.h" uint8_t readbuf[160]; FILE *record_file; int ts_fd_cb(struct osmo_fd *ofd, unsigned int what) { int rc; rc = read(ts_fd, readbuf, 160); if (rc != 160) { fprintf(stderr, "error: read from ts returned %d instead of 160\n", rc); exit(1); } if (record_file) fwrite(readbuf, 1, 160, record_file); transmit_pcm_20ms(); return 0; }