/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : kvhInclinoDriver.cc                                           */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "System.h"
#include "Syslog.h"
#include "Exception.h"
#include "SerialDevice.h"
#include "SerialParameters.h"
#include "KvhInclinoDriver.h"

// Update rate in hz
#define UpdateRate 5

int main(int argc, char **argv)
{
  // if (System::setTaskPriority(CriticalDriverPriority) == -1) {
  //  return 1;
  // }
  
  SerialDevice *device = 0;

  KvhInclinoDriver *driver = 0;

  try {
    SerialParameters serialParams(&argc, argv);
    device = new SerialDevice(&serialParams);
    driver = new KvhInclinoDriver(device, UpdateRate);
    driver->run();
  }
  catch (Exception e) {
    Syslog::write("%s caught Exception:\n%s\n", argv[0], e.msg);
  }
  catch (...) {  
    Syslog::write("%s aught unknown exception", argv[0]);
  }

  delete driver;
  delete device;
  return 0;
}
