/****************************************************************************/
/* Copyright (c) 2005 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : _dockServer.cc                                           */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 11/28/2005                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
/*-----------------------------------------------------------------------*
  PROGRAM: dockServer

  DESCRIPTION: Binary wrapper for Dock Server

  AUTHOR: Rich Henthorn

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

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

int main( int argc, char **argv )
{
  // Set task priority
  if (System::setTaskPriority(CriticalServerPriority) == -1)
    return 1;
  //
  // Assume the command line contains two serial port specifications.  See
  // the comment in _dockTest.cc
  argc=3;
  try {
    SerialParameters serialParamsVehicle(&argc, argv);
    printf("_dockServer - Vehicle: %s\n", serialParamsVehicle.string() );
    SerialParameters serialParamsDock(&argc, argv+2);
    printf("_dockServer - Dock: %s\n", serialParamsDock.string() );

    DockServer *server = new DockServer(&serialParamsVehicle, 
					&serialParamsDock);
    server->run();
  }
  catch( Exception e ) {
    Syslog::write("dockServer -- Caught exception: %s\n", e.msg );
  }
  catch( ... ) {
    Syslog::write("dockServer -- Caught exception!\n");
  }

  return 0;
}
