/**
 * comm.h
 * 
 * Communication module header. Defines communication-specific constants
 * and exports module function prototypes.
 * 
 * Author   : Sajid Sadi
 * Last Mod : January 15, 2002
 * Purpose  : Communications module for the CLIC Video Automation Project
 * Professor: Henning Schulzrinne
 * Mentor   : Xiaotao Wu
 *
 * Copyright (c) 2002 by Columbia University. All rights reserved.
 */

#ifndef __COMM_H
#define __COMM_H

#define NUM_PORTS 3
#define PORT_NAME_MAX 50

typedef struct {
  char          port[PORT_NAME_MAX + 1]; /* name of port */
  int	        tty_fd;   /* fd of this tty after open */
  struct termio tio_old;  /* Store old settings for port */
} ttyData;

typedef enum { 
  PORT_FRONT, 
  PORT_BACK, 
  PORT_IR
} ttyNum;

extern ttyData commPortSettings[NUM_PORTS];

extern void commReadPortAssignments();
extern void commSetupTTY(ttyData *tty_data);
extern void commResetTTY(ttyData *tty_data);
extern void commSendKnoxSettings(matSavedState *m);
extern void commSendExtronSettings(matSavedState *m);
extern void commReadKnoxSettings(matSavedState *m);
extern void commReadExtronSettings(matSavedState *m);
extern void commSendSlinkeCommand(char *codefile, char *cmd);
#endif

