/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : kvhDriver.cc                                                  */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
/*-----------------------------------------------------------------------*
  PROGRAM: kvhDriver

  DESCRIPTION: Binary wrapped for KvhDriver class

  $Id: _kvhDriver.cc,v 1.1 2001/09/11 20:49:28 hthomas Exp $
  *-----------------------------------------------------------------------*/

#include <stdio.h>
#include <string.h>
#include <sys/sched.h>
#include <errno.h>
#include "System.h"
#include "Syslog.h"
#include "Exception.h"
#include "SerialDevice.h"

#include "KvhDriver.h"

#define COMPASS_NAME "/dev/ser3"
#define INCLINO_NAME "/dev/ser4"

int main(int argc, char **argv)
{
  // Set task priority
  if (System::setTaskPriority(CriticalDriverPriority) == -1)
    return 1;
  
  SerialDevice *compassDev = new SerialDevice( COMPASS_NAME ),
    *inclinoDev = new SerialDevice( INCLINO_NAME );

  try
  {
    KvhDriver *_kvhDriver = new KvhDriver( compassDev, inclinoDev );
    
    _kvhDriver->run();

    delete _kvhDriver;
  }
  catch (Exception e)
  {
    Syslog::write("KvhCompassDriver Exception %s\n", e.msg);
  }
  
  delete compassDev;
  delete inclinoDev;

  return 0;
}
