/*
********************************************************
Copyright 2000 MBARI.
MBARI Proprietary Information. All rights reserved.
NOTE: This file is automatically generated.
DO NOT MODIFY.
********************************************************
*/

#ifndef __UsblIF_SK_H
#define __UsblIF_SK_H

#include "TaskServer.h"
#include "UsblIF.h"
#include "InstrumentIF_SK.h"

class UsblIF_SK : public InstrumentIF_SK {

  public:

  // Constructor for server with default name
  UsblIF_SK();

  // Constructor for server with specific name
  UsblIF_SK(const char *serverName);

  virtual ~UsblIF_SK();
  
  protected:

  // These methods must be defined in subclass
  virtual Boolean ready() = 0;
  virtual DeviceIF::Status get_range_data(float *range, float *x, float *y, float *z, short *turnAroundTime, TimeIF::TimeSpec *sampleTime, UsblIF::UsblDataStatus *status) = 0;
  virtual DeviceIF::Status set_beacon(UsblIF::String32 newBeaconName) = 0;
  virtual DeviceIF::Status start() = 0;
  virtual DeviceIF::Status stop() = 0;
  
  // Declare callbacks corresponding to each method
  Boolean readyCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean get_range_dataCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean set_beaconCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean startCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  Boolean stopCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

  
  // Message structure pointer for each method
  UsblIF::ReadyMsg *_readyMsg;
  UsblIF::Get_range_dataMsg *_get_range_dataMsg;
  UsblIF::Set_beaconMsg *_set_beaconMsg;
  UsblIF::StartMsg *_startMsg;
  UsblIF::StopMsg *_stopMsg;
  
  // Determine max bytes required for message buffer
  virtual size_t maxRequestBytes();

  // Allocate buffer for messages, set pointers, etc
  virtual void allocateBuffers();

  private:

  // Initializer method called by constructors
  int init();

};

#endif

