/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : fuelcellDriver.cc                                             */
/* Author   :  John Rieffel                                                 */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
#include "FuelCell.h"
#include "Syslog.h"
#include <sys/sched.h>
#include <errno.h>
#include "System.h"
#include "Exception.h"

extern "C" {
Boolean debug_flag=FALSE;       // enable debug statements 
nid_t target_node;   
char *ProgramName;    
};

int main( int argc, char **argv )
{
//   target_node = getnid();
   target_node = 11;
   char configFile[256];
    strcpy(configFile, System::configurationFile("fuelcell.cfg"));

   ProgramName = argv[0];
   FuelCell *fuelcell = 0;

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

  try {
    Syslog::write("fuelcellDriver -- creating FuelCell Object\n");
    fuelcell = new FuelCell(configFile);
    Syslog::write("fuelcellDriver -- created FuelCell Object,running\n");
    fuelcell->run();
  }
  catch (Exception e) {
    Syslog::write("fuelcell - caught Exception: %s\n", e.msg);
  }
  catch (...) {
    Syslog::write("fuelcell - caught unknown exception\n");
  }

  delete fuelcell;

  return 0;

}
