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

#ifndef __CrossbowIF_SK_H
#define __CrossbowIF_SK_H

#include "TaskServer.h"
#include "CrossbowIF.h"
#include "AhrsIF_SK.h"

class CrossbowIF_SK : public AhrsIF_SK {

  public:

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

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

  virtual ~CrossbowIF_SK();
  
  protected:

  // These methods must be defined in subclass
  virtual DeviceIF::Status acceleration(double *accelX, double *accelY, double *accelZ, TimeIF::TimeSpec *sampleTime) = 0;
  virtual DeviceIF::Status magneticVector(double *magX, double *magY, double *magZ, TimeIF::TimeSpec *sampleTime) = 0;
  virtual DeviceIF::Status all(AhrsIF::Attitude *attitude, double *accelX, double *accelY, double *accelZ, double *magX, double *magY, double *magZ, double *temperature, TimeIF::TimeSpec *sampleTime) = 0;
  
  // Declare callbacks corresponding to each method
  Boolean accelerationCallback(Request *request, int nReqBytes,
                 Reply **reply, int *nReplyBytes);

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

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

  
  // Message structure pointer for each method
  CrossbowIF::AccelerationMsg *_accelerationMsg;
  CrossbowIF::MagneticVectorMsg *_magneticVectorMsg;
  CrossbowIF::AllMsg *_allMsg;
  
  // 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

