/* udp_common.h
 * UDP Babyphone
 * Andre Adrian
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <linux/soundcard.h>

#define BABYPHONE_PORT 26002      // Der Babyphone well known Port

#define BUFSIZELD 9               // Groesse Soundcard Buffer, Minimum ist 4
#define BUFSIZE   (1<<BUFSIZELD)      

#define AUDIOBUFS     3           // Anzahl Soundcard Buffer, Minimum ist 2
#define AUDIOFORMAT   AFMT_MU_LAW // Audio Codec G.711 u-Law
#define AUDIOSPEED    16000       // Abtastfrequenz
#define AUDIOCHANNELS 1           // 1 ist Mono, 2 ist Stereo

#define exit_if(expr) \
if(expr) { \
  fprintf(stderr, "%s(%d) %s\n", __FILE__, __LINE__, strerror(errno)); \
  exit(1); \
}

