Listing 4 This listing shows the code or sending a

static boolean
fgsend control (ixxx, iyyy)
    int ixxx;
    int iyyy;
{
  char ab[CFRAMELEN];
  int ict1;
  unsigned short icheck;

  ab[IFRAME_DLE] = DLE;
  ab[IFRAME_K] = KCONTROL;

  ict1 = (CONTROL << 6) | (ixxx << 3) | iyyy;
  icheck = (unsigned short) (0xaaaa - ict1);
  ab[IFRAME_CHECKLOW] = (char) (icheck & 0xff);
  ab[IFRAME_CHECKHIGH] = (char) (icheck >> 8);

  ab[IFRAME_CONTROL] = (char) ict1;

  ab[IFRAME_XOR] = (char) (ab[IFRAME_K]
                 ^ ab[IFRAME_CHECKLOW]
                 ^ ab[IFRAME_CHECKHIGH]
                 ^ ab[IFRAME_CONTROL]);

  return fsend_data (ab, CFRAMELEN, TRUE);
}

/* End of File */