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

int main( int argc, char **argv )
{

  Syslog::write("ctdDriver RUNNING...\n");
     char configFile[256];

     strcpy(configFile, System::configurationFile("ctd.cfg"));

  // Set task priority
  if (System::setTaskPriority(NonCriticalDriverPriority) == -1)
    return 1;

  Ctd *ctd;
  SerialDevice *device = new SerialDevice( "/dev/ser7" );

  try {
    ctd = new Ctd(device, configFile);
    Syslog::write("ctdDriver -- constructor succeeded\n");
    ctd->run();
  }
  
  
    
  catch (Exception e) {
    Syslog::write("Caught Exception: %s\n", e.msg);
  }
  catch (...) {
    Syslog::write("Caught unknown exception\n");
  }
  
  delete device;
  delete ctd;

  return 0;

}



