willowgarage::ocean::ocean Class Reference

#include <ocean.h>

List of all members.

Classes

struct  regPair

Public Member Functions

void initialize (const std::string &input_dev)
 ocean (int id, int debug=0)
void read_file (const std::string &input)
int run ()
void setDebugLevel (int)
 ~ocean ()

Public Attributes

pr2_msgs::BatteryServer2 server

Static Public Attributes

static const int BAD_PACKET = -1
static const int INPUT_BUF_SIZE = 128
static const unsigned int MAX_PACKET_LENGTH = 120
static const int MAXCHANNELS = 16
static const int MAXTAGLEN = 8
static const int NMEA_MAX = 120
static const int NMEA_PACKET = 1
static const int NO_PACKET = 0
static const int OUTPUT_BUF_SIZE = 128
static struct regPair regList []
static const unsigned regListLength

Private Member Functions

void character_discard ()
int commTest ()
void flush (void)
int get_speed (void)
char * gpsd_hexdump (void *binbuf, size_t binbuflen)
time_t mkgmtime (register struct tm *t)
void nextstate (unsigned char c)
void nmea_add_checksum (char *sentence)
unsigned int nmea_parse ()
int nmea_send (const char *fmt,...)
void packet_accept (int packet_type)
void packet_discard ()
ssize_t packet_get ()
ssize_t packet_parse (size_t newdata)
void packet_reset ()
unsigned int processBattery (int count, char *field[])
unsigned int processController (int count, char *field[])
unsigned int processSystem (int count, char *field[])
void report (int errlevel, const char *fmt,...)
void resetOcean ()
void set_speed (int speed)
int string_send (const char *fmt,...)

Private Attributes

int acknowledge
unsigned long char_counter
int currentBattery
int currentBaudRate
int currentBaudRateIndex
int currentPort
int cycleComplete
int debuglevel
char * idString
unsigned char inbuffer [INPUT_BUF_SIZE+1]
size_t inbuflen
unsigned char * inbufptr
int inputDevice
unsigned char outbuffer [OUTPUT_BUF_SIZE+1]
size_t outbuflen
int packetState
int packetType
int sentenceCount
int sentenceLength
char tag [MAXTAGLEN]
struct termios ttyset

Detailed Description

Definition at line 17 of file ocean.h.


Constructor & Destructor Documentation

ocean::ocean ( int  id,
int  debug = 0 
)

Open the required device and establish communications with the OCEAN.

Definition at line 73 of file ocean.cpp.

ocean::~ocean (  ) 

Definition at line 84 of file ocean.cpp.


Member Function Documentation

void ocean::character_discard (  )  [private]

Definition at line 489 of file ocean.cpp.

int ocean::commTest (  )  [private]

Definition at line 161 of file ocean.cpp.

void ocean::flush ( void   )  [private]

Flush out the serial buffer.

Definition at line 247 of file ocean.cpp.

int ocean::get_speed ( void   )  [private]

Definition at line 254 of file ocean.cpp.

char * ocean::gpsd_hexdump ( void *  binbuf,
size_t  binbuflen 
) [private]

Definition at line 365 of file ocean.cpp.

void ocean::initialize ( const std::string &  input_dev  ) 

Definition at line 99 of file ocean.cpp.

time_t willowgarage::ocean::ocean::mkgmtime ( register struct tm *  t  )  [private]
void ocean::nextstate ( unsigned char  c  )  [private]

A sentence looks something like this: $GPRMC,224759.85,A,3713.45089,N,12145.99453,W,000.04,161.59,280805,14.95,E,A*22 $GPRMC,224759.90,A,3713.45088,N,12145.99453,W,000.07,162.37,280805,14.95,E,A*2F

Definition at line 389 of file ocean.cpp.

void ocean::nmea_add_checksum ( char *  sentence  )  [private]

Definition at line 916 of file ocean.cpp.

unsigned int ocean::nmea_parse (  )  [private]

Definition at line 828 of file ocean.cpp.

int ocean::nmea_send ( const char *  fmt,
  ... 
) [private]

Definition at line 940 of file ocean.cpp.

void ocean::packet_accept ( int  packet_type  )  [private]

Definition at line 452 of file ocean.cpp.

void ocean::packet_discard (  )  [private]

Definition at line 475 of file ocean.cpp.

ssize_t ocean::packet_get (  )  [private]

Definition at line 576 of file ocean.cpp.

ssize_t ocean::packet_parse ( size_t  newdata  )  [private]

Definition at line 508 of file ocean.cpp.

void ocean::packet_reset (  )  [private]

Definition at line 595 of file ocean.cpp.

unsigned int ocean::processBattery ( int  count,
char *  field[] 
) [private]

Definition at line 770 of file ocean.cpp.

unsigned int ocean::processController ( int  count,
char *  field[] 
) [private]

Definition at line 656 of file ocean.cpp.

unsigned int ocean::processSystem ( int  count,
char *  field[] 
) [private]

Functions for parsing NMEA sentences.

Definition at line 612 of file ocean.cpp.

void ocean::read_file ( const std::string &  input  ) 

Definition at line 150 of file ocean.cpp.

void ocean::report ( int  errlevel,
const char *  fmt,
  ... 
) [private]

Definition at line 328 of file ocean.cpp.

void ocean::resetOcean (  )  [private]

Definition at line 221 of file ocean.cpp.

int ocean::run ( void   ) 

Definition at line 231 of file ocean.cpp.

void ocean::set_speed ( int  speed  )  [private]

Definition at line 283 of file ocean.cpp.

void ocean::setDebugLevel ( int  level  ) 

Definition at line 93 of file ocean.cpp.

int ocean::string_send ( const char *  fmt,
  ... 
) [private]

Definition at line 970 of file ocean.cpp.


Member Data Documentation

Definition at line 95 of file ocean.h.

const int ocean::BAD_PACKET = -1 [static]

Definition at line 27 of file ocean.h.

Definition at line 91 of file ocean.h.

Definition at line 82 of file ocean.h.

Definition at line 76 of file ocean.h.

Definition at line 77 of file ocean.h.

Definition at line 78 of file ocean.h.

Definition at line 94 of file ocean.h.

Definition at line 80 of file ocean.h.

Definition at line 79 of file ocean.h.

Definition at line 87 of file ocean.h.

Definition at line 89 of file ocean.h.

unsigned char* willowgarage::ocean::ocean::inbufptr [private]

Definition at line 90 of file ocean.h.

const int ocean::INPUT_BUF_SIZE = 128 [static]

Definition at line 24 of file ocean.h.

Definition at line 71 of file ocean.h.

const unsigned int ocean::MAX_PACKET_LENGTH = 120 [static]

Definition at line 26 of file ocean.h.

const int ocean::MAXCHANNELS = 16 [static]

Definition at line 22 of file ocean.h.

const int ocean::MAXTAGLEN = 8 [static]

Definition at line 21 of file ocean.h.

const int ocean::NMEA_MAX = 120 [static]

Definition at line 20 of file ocean.h.

const int ocean::NMEA_PACKET = 1 [static]

Definition at line 29 of file ocean.h.

const int ocean::NO_PACKET = 0 [static]

Definition at line 28 of file ocean.h.

Definition at line 88 of file ocean.h.

Definition at line 89 of file ocean.h.

const int ocean::OUTPUT_BUF_SIZE = 128 [static]

Definition at line 25 of file ocean.h.

Definition at line 85 of file ocean.h.

Definition at line 85 of file ocean.h.

Definition at line 98 of file ocean.h.

const unsigned ocean::regListLength [static]

Definition at line 99 of file ocean.h.

Definition at line 81 of file ocean.h.

Definition at line 93 of file ocean.h.

pr2_msgs::BatteryServer2 willowgarage::ocean::ocean::server

Definition at line 101 of file ocean.h.

Definition at line 92 of file ocean.h.

struct termios willowgarage::ocean::ocean::ttyset [private]

Definition at line 75 of file ocean.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerator Defines


ocean_battery_driver
Author(s): Tully Foote, Curt Meyers
autogenerated on Fri Jan 11 09:33:08 2013