/****************************************************************************/
/* Copyright (c) 2003 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : fastcatServer.cc                                              */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 12/17/2003                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
/*-----------------------------------------------------------------------*
  PROGRAM: fastcatServer

  DESCRIPTION: Binary wrapper for FastCat Server

  AUTHOR: Rich Henthorn

  *-----------------------------------------------------------------------*/

#include "FastCatServer.h"
#include "Syslog.h"
#include "System.h"
#include "SerialParameters.h"

#define SERVER_NAME "FastCat"

int main( int argc, char **argv )
{
  char ctdname[64];
  Boolean hasName = False;

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

  SerialDevice *dev = 0;
  FastCatServer *fastcatServer = 0;

  try {
    SerialParameters params(&argc, argv);
    fastcatServer = new FastCatServer(SERVER_NAME, &params);
    fastcatServer->run();
  }
  catch( SharedObject::Error e ) {
    Syslog::write("fastcatServer -- Caught SharedObject exception: %s\n", e.msg );
  }
  catch( Exception e ) {
    Syslog::write("fastcatServer -- Caught exception: %s\n", e.msg );
  }
  catch( ... ) {
    Syslog::write("fastcatServer -- Caught exception!\n");
  }

  delete fastcatServer;
  delete dev;
  
  return 0;
}
