//=========================================================================
// Summary  : Reson 6046
// Filename : Reson6046Command.h
// Author   : Reed Christenson reed@bluefinrobotics.com
// Project  : Reson 6046 Driver
// Revision : 0.0
// Created  : 2002.03.21
// Modified : 2002.03.21
//=========================================================================
// Description : Reson 6046
//=========================================================================

#ifndef _DATABROADCASTERCOMMAND_H
#define _DATABROADCASTERCOMMAND_H

#include "DriverCommand.h"
#include "Reson6046IF.h"

#define Reson6046CommandName "reson6046Command"
#define MAXCOMMANDS 10

class Reson6046Command : public DriverCommand {
 public:
    enum Requests {
	None = CHILD_COMMANDS_BEGIN_HERE,
	DataLoggingOn,
	DataLoggingOff,
	// PLC Command ID 0
	StartSubsystem,
	StopSubsystem,
	SetPulseFilename,
	SetPingRange,
	SetPingRate,
	SetPingPower,
	// PLC Command ID 1
	StartLogging,
	StopLogging,
	// PLC Command ID 4
	GetVersion,
	// PLC Command ID 10
	GetSonarStatus,
	// PLC Command 11
	SetVerboseMode,
	// PLC Command ID 14
	GetModules,
	// PLC Command ID 15
	GetRunList,
	// PLC Command ID 20
	SetTime
    };

/*     struct Command { */
/*           //enum Requests request; */
/*           Reson6046Commands cmd; */
/*           union { */
/*                int iVal; */
/*                float fVal; */
/*           }; */

/*           Command( ) */
/*                { cmd = None; iVal = 0; } */
/*           Command( Reson6046Command::Reson6046Commands inCmd, int newIVal = 0 ) */
/*                { cmd = inCmd; iVal = newIVal; } */
/*           Command( Reson6046Command::Reson6046Commands inCmd, int newIVal = 0, float newFVal = 0.0 ) */
/*                { cmd = inCmd; iVal = newIVal; fVal = newFVal; } */
/*     }; */

    struct Command : Command_Skel {
	int request;
	int iVal;
	float fVal;
	Reson6046IF::String32 sVal;

	Command( )
	{
	    request = (Requests)DriverCommand::None;
	    iVal = 0;
	};

	Command(int req) {
	    request = req;
	    iVal = 0;
	};

	Command(int req, int intVal )
	{
	    request = req;
	    iVal = intVal;
	};
	
	Command(int req, int intVal, float floatVal)
	{
	    request = req;
	    iVal = intVal;
	    fVal = floatVal;
	};

	Command(int req, int intVal, Reson6046IF::String32 stringVal)
	{
	    request = req;
	    iVal = intVal;
	    //sVal = stringVal;
	    memcpy(&sVal[0],&stringVal[0],32);
	};
    };

    Reson6046Command( MessageQueue::Access access = NoAccess );
    ~Reson6046Command();

    //int read( Command *cmd );
    //int write( Command *cmd );

 protected:

 private:

};

#endif
