/* LarkVCB.h
   L. Stewart August 15, 1983  3:06 PM
 */

/* requires
   Pup.h
   Queue.h
   Encrypt.h
 */

struct VCB {  /* extra fields */
  /* common fields */
  int active;
  struct Port lport;		/* local port for tx or rx */
  struct Port rport;
  int numPackets;		/* number of packets transmitted */
  int lastEndTime;
  char *bufbase;		/* pointer to buffer */
  struct Queue vpq;
  struct Queue pq;
  int pqlength;			/* number buffers on pq */

  /* transmit fields */
  struct ECB loECB, hiECB;
  struct ECB floECB, fhiECB;
  int now;
  int silThresh;			/* definition of silence */
  int *silVal;			/* slave CPU silence value */
  int encIndex;
  int squelchTail;

  /* receive fields */
  int expPlayTime;		/* play time according to TX Lark */
  int firstPacket;		/* BOOL first packet ever */
  struct ECB daECB, dbECB;	/* for decryption */
  int lsoc;			/* pup socket handle */
  int dtimer;			/* timer for lost pbis */
  int gainChannel;		/* 0 => off, & 1 or & 2 for controlled channel */
  int lastEnergy;		/* shift register for filtering */
  int gainCount;		/* time to go before decay */
  int decayTime;		/* time per decay step */
  int gainLevel;		/* current gain */
  int gainTable[5];
  int expPktID;		/* expected ID */
  };

#define lenVCB (sizeof (struct VCB)/2)

/* structure of a Lark originated voice packet */

struct LLPkt {
  char mode;
  char encIndex;
  int energy;
  int silenceMS;
  int blank2;
  char data[2];
  };

#define MaxSilenceMS 200
#define MaxPlaybackPkts 10
#define MaxPQL 14