/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : Seabird25p.h                                                         */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/* 09/08/2014 Renamed file from original Seabird files, and began           */
/* 			  refactoring so that this driver can support the seabird       */
/*            25plus system.  EJM                                           */
/****************************************************************************/
#ifndef _Seabird25pTask_H
#define _Seabird25pTask_H

#include "ourTypes.h"

#include "StreamSerialDriver.h"
#include "DepthSensorIF.h"
#include "Attributes.h"
/*
CLASS 
Ctd

DESCRIPTION
Seabird Device Driver Interface

AUTHOR
John Rieffel

COMMENTS: Large sections of this code lifted directly from Odyssey
code file cond_temp.h and .c.  Thank you very much.

*/
#define    SBE_PRES_RANGE 0  //Altex configured vehicle appears not to ask
                             // JAR 12/09/99
#define MAXNAMELEN 20
#define MAXTAGLEN 10

#define MaxRecordBytes 256

#define ExpectedRecordBytes 62

class Seabird25p;

class Seabird25pTask : public StreamSerialDriver {
  
public:

  Seabird25pTask(SerialDevice *serialDevice, char *configFile,
    char *instName);

  virtual ~Seabird25pTask();

protected:

  Seabird25p *_sbe25p;
  time_t _lastFlush;
  time_t _flushInterval;
  char _recordBuf[MaxRecordBytes];
  int _nBytes;

  ////////////////////////////////////////////////////////////////////
  // initialization routine
  // Simply clears serial port
  virtual DeviceIF::Status initialize();

  virtual DeviceIF::Status readRecord(unsigned char *record,
				     int maxRecordBytes,
				     const char *recordTerminator,
				     unsigned readTimeout,
				     int *nBytesRead);

  ////////////////////////////////////////////////////////////////////
  // Process a record
  virtual DeviceIF::Status  processRecord(unsigned char *record, int nRecordBytes);

  ////////////////////////////////////////////////////////////////////
  // EventCode to trigger when device has been initialized
  //  virtual EventCode initializedEventCode();

  // currently no way to access these two fns for now
  void standby(void);
  void halt(void);
  
};

#endif
