#ifndef __servocmd
#define __servocmd

#include <unistd.h>
#define _GNU_SOURCE
#include <string.h>

typedef enum servoFlags_e {
   ENGCACHE = 0,
   SERVOON  ,
   SERVOOFF , 
   CMD2CUR  
} servoFlags_t;

typedef struct servoBus_s {
  int busFD;   // bus file descriptor, aka serial port
  unsigned int lastGet; // the last servo data was requested from none = 256
} servoBus_t;

void botcmd(unsigned char * buffer, unsigned int command, unsigned int argument);

void Listen            ( servoBus_t * this, unsigned int servo );
void Ignore            ( servoBus_t * this, unsigned int servo );
void OneTimeListen     ( servoBus_t * this, unsigned int servo );
void ChainListen       ( servoBus_t * this, unsigned int startServo );

void SetFlags          ( servoBus_t * this, servoFlags_t flags );
void SetServoPostion   ( servoBus_t * this, unsigned int position );
void SetCachedPosition ( servoBus_t * this, unsigned int position );

void GetServoCurrent   ( servoBus_t * this, unsigned int servo );
void GetServoPosition  ( servoBus_t * this, unsigned int servo );
void GetDeviceModel    ( servoBus_t * this, unsigned int servo );


#endif 
