/*
 * hifi.c:
 *
 * Copyright (c) 2000 James McKenzie <james@fishsoup.dhs.org>.
 * All rights reserved.
 *
 * $Log: hifi.c,v $
 * Revision 1.4  2000/10/07 17:57:01  root
 * #
 *
 * Revision 1.3  2000/10/06 19:52:20  root
 * #
 *
 * Revision 1.2  2000/09/19 05:08:18  root
 * #
 *
 * Revision 1.1  2000/09/08 00:35:27  root
 * #
 *
 * Revision 1.5  2000/02/21 04:11:27  root
 * #
 *
 * Revision 1.4  2000/02/21 04:01:00  root
 * #
 *
 * Revision 1.3  2000/02/20 03:03:57  root
 * #
 *
 * Revision 1.2  2000/02/20 03:03:53  root
 * #
 *
 * Revision 1.1  2000/02/20 02:52:13  root
 * #
 *
 *
 */



static char rcsid[] = "$Id: hifi.c,v 1.4 2000/10/07 17:57:01 root Exp $";

#include "project.h"


void
hifi_valid_cmd (Byte sclass, Byte sunit, Byte dclass, Byte dunit, Word cmd,
                Byte * data, Word len)
{

  switch (dclass)
    {
    case HIFI_CLASS_MPEG:
      mpeg_cmdst_message (dunit, cmd, data, len);
      break;
    }

}

void
hifi_dispatch ()
{
  extern void *msglib;

  Byte buf[1024];
  int len;
  int i;

  Word w, l;
  Byte class, unit, d;


  len = hifimsg_recv (msglib, buf, sizeof (buf));
  if (len <= 0)
    return;


#ifdef DEBUG
  {
    putchar ('>');
    for (i = 0; i < len; ++i)
      {
        printf (" %02x", buf[i]);
      }
    putchar ('\n');
    fflush (stdout);
  }
#endif

  hifi_new_packet (msglib, buf, len, hifi_valid_cmd);

}
