Classes | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes
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 ()
long int convertStringBase16 (const char *input)
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 72 of file ocean.cpp.

Definition at line 83 of file ocean.cpp.


Member Function Documentation

void ocean::character_discard ( ) [private]

Definition at line 518 of file ocean.cpp.

int ocean::commTest ( ) [private]

Definition at line 190 of file ocean.cpp.

long int ocean::convertStringBase16 ( const char *  input) [private]

Definition at line 148 of file ocean.cpp.

void ocean::flush ( void  ) [private]

Flush out the serial buffer.

Definition at line 276 of file ocean.cpp.

int ocean::get_speed ( void  ) [private]

Definition at line 283 of file ocean.cpp.

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

Definition at line 394 of file ocean.cpp.

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

Definition at line 98 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 418 of file ocean.cpp.

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

Definition at line 955 of file ocean.cpp.

unsigned int ocean::nmea_parse ( ) [private]

Definition at line 869 of file ocean.cpp.

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

Definition at line 979 of file ocean.cpp.

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

Definition at line 481 of file ocean.cpp.

void ocean::packet_discard ( ) [private]

Definition at line 504 of file ocean.cpp.

ssize_t ocean::packet_get ( ) [private]

Definition at line 605 of file ocean.cpp.

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

Definition at line 537 of file ocean.cpp.

void ocean::packet_reset ( ) [private]

Definition at line 624 of file ocean.cpp.

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

Definition at line 803 of file ocean.cpp.

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

Definition at line 688 of file ocean.cpp.

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

Functions for parsing NMEA sentences.

Definition at line 641 of file ocean.cpp.

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

Definition at line 179 of file ocean.cpp.

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

Definition at line 357 of file ocean.cpp.

void ocean::resetOcean ( ) [private]

Definition at line 250 of file ocean.cpp.

int ocean::run ( void  )

Definition at line 260 of file ocean.cpp.

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

Definition at line 312 of file ocean.cpp.

void ocean::setDebugLevel ( int  level)

Definition at line 92 of file ocean.cpp.

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

Definition at line 1009 of file ocean.cpp.


Member Data Documentation

Definition at line 96 of file ocean.h.

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

Definition at line 27 of file ocean.h.

Definition at line 92 of file ocean.h.

Definition at line 83 of file ocean.h.

Definition at line 77 of file ocean.h.

Definition at line 78 of file ocean.h.

Definition at line 79 of file ocean.h.

Definition at line 95 of file ocean.h.

Definition at line 81 of file ocean.h.

Definition at line 80 of file ocean.h.

Definition at line 88 of file ocean.h.

Definition at line 90 of file ocean.h.

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

Definition at line 91 of file ocean.h.

const int ocean::INPUT_BUF_SIZE = 128 [static]

Definition at line 24 of file ocean.h.

Definition at line 72 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 89 of file ocean.h.

Definition at line 90 of file ocean.h.

const int ocean::OUTPUT_BUF_SIZE = 128 [static]

Definition at line 25 of file ocean.h.

Definition at line 86 of file ocean.h.

Definition at line 86 of file ocean.h.

Definition at line 99 of file ocean.h.

const unsigned ocean::regListLength [static]

Definition at line 100 of file ocean.h.

Definition at line 82 of file ocean.h.

Definition at line 94 of file ocean.h.

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

Definition at line 102 of file ocean.h.

Definition at line 93 of file ocean.h.

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

Definition at line 76 of file ocean.h.


The documentation for this class was generated from the following files:


ocean_battery_driver
Author(s): Tully Foote, Curt Meyers
autogenerated on Thu Jun 6 2019 21:10:57