Classes | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
willowgarage::ocean::ocean Class Reference

#include <ocean.h>

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 const 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 (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::ocean ( int  id,
int  debug = 0 
)

Open the required device and establish communications with the OCEAN.

Definition at line 72 of file ocean.cpp.

◆ ~ocean()

ocean::~ocean ( )

Definition at line 83 of file ocean.cpp.

Member Function Documentation

◆ character_discard()

void ocean::character_discard ( )
private

Definition at line 518 of file ocean.cpp.

◆ commTest()

int ocean::commTest ( )
private

Definition at line 190 of file ocean.cpp.

◆ convertStringBase16()

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

Definition at line 148 of file ocean.cpp.

◆ flush()

void ocean::flush ( void  )
private

Flush out the serial buffer.

Definition at line 276 of file ocean.cpp.

◆ get_speed()

int ocean::get_speed ( void  )
private

Definition at line 283 of file ocean.cpp.

◆ gpsd_hexdump()

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

Definition at line 394 of file ocean.cpp.

◆ initialize()

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

Definition at line 98 of file ocean.cpp.

◆ mkgmtime()

time_t willowgarage::ocean::ocean::mkgmtime ( struct tm *  t)
private

◆ nextstate()

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.

◆ nmea_add_checksum()

void ocean::nmea_add_checksum ( char *  sentence)
private

Definition at line 955 of file ocean.cpp.

◆ nmea_parse()

unsigned int ocean::nmea_parse ( )
private

Definition at line 869 of file ocean.cpp.

◆ nmea_send()

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

Definition at line 979 of file ocean.cpp.

◆ packet_accept()

void ocean::packet_accept ( int  packet_type)
private

Definition at line 481 of file ocean.cpp.

◆ packet_discard()

void ocean::packet_discard ( )
private

Definition at line 504 of file ocean.cpp.

◆ packet_get()

ssize_t ocean::packet_get ( )
private

Definition at line 605 of file ocean.cpp.

◆ packet_parse()

ssize_t ocean::packet_parse ( size_t  newdata)
private

Definition at line 537 of file ocean.cpp.

◆ packet_reset()

void ocean::packet_reset ( )
private

Definition at line 624 of file ocean.cpp.

◆ processBattery()

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

Definition at line 803 of file ocean.cpp.

◆ processController()

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

Definition at line 688 of file ocean.cpp.

◆ processSystem()

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

Functions for parsing NMEA sentences.

Definition at line 641 of file ocean.cpp.

◆ read_file()

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

Definition at line 179 of file ocean.cpp.

◆ report()

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

Definition at line 357 of file ocean.cpp.

◆ resetOcean()

void ocean::resetOcean ( )
private

Definition at line 250 of file ocean.cpp.

◆ run()

int ocean::run ( void  )

Definition at line 260 of file ocean.cpp.

◆ set_speed()

void ocean::set_speed ( int  speed)
private

Definition at line 312 of file ocean.cpp.

◆ setDebugLevel()

void ocean::setDebugLevel ( int  level)

Definition at line 92 of file ocean.cpp.

◆ string_send()

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

Definition at line 1009 of file ocean.cpp.

Member Data Documentation

◆ acknowledge

int willowgarage::ocean::ocean::acknowledge
private

Definition at line 96 of file ocean.h.

◆ BAD_PACKET

const int ocean::BAD_PACKET = -1
static

Definition at line 27 of file ocean.h.

◆ char_counter

unsigned long willowgarage::ocean::ocean::char_counter
private

Definition at line 92 of file ocean.h.

◆ currentBattery

int willowgarage::ocean::ocean::currentBattery
private

Definition at line 83 of file ocean.h.

◆ currentBaudRate

int willowgarage::ocean::ocean::currentBaudRate
private

Definition at line 77 of file ocean.h.

◆ currentBaudRateIndex

int willowgarage::ocean::ocean::currentBaudRateIndex
private

Definition at line 78 of file ocean.h.

◆ currentPort

int willowgarage::ocean::ocean::currentPort
private

Definition at line 79 of file ocean.h.

◆ cycleComplete

int willowgarage::ocean::ocean::cycleComplete
private

Definition at line 95 of file ocean.h.

◆ debuglevel

int willowgarage::ocean::ocean::debuglevel
private

Definition at line 81 of file ocean.h.

◆ idString

char* willowgarage::ocean::ocean::idString
private

Definition at line 80 of file ocean.h.

◆ inbuffer

unsigned char willowgarage::ocean::ocean::inbuffer[INPUT_BUF_SIZE+1]
private

Definition at line 88 of file ocean.h.

◆ inbuflen

size_t willowgarage::ocean::ocean::inbuflen
private

Definition at line 90 of file ocean.h.

◆ inbufptr

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

Definition at line 91 of file ocean.h.

◆ INPUT_BUF_SIZE

const int ocean::INPUT_BUF_SIZE = 128
static

Definition at line 24 of file ocean.h.

◆ inputDevice

int willowgarage::ocean::ocean::inputDevice
private

Definition at line 72 of file ocean.h.

◆ MAX_PACKET_LENGTH

const unsigned int ocean::MAX_PACKET_LENGTH = 120
static

Definition at line 26 of file ocean.h.

◆ MAXCHANNELS

const int ocean::MAXCHANNELS = 16
static

Definition at line 22 of file ocean.h.

◆ MAXTAGLEN

const int ocean::MAXTAGLEN = 8
static

Definition at line 21 of file ocean.h.

◆ NMEA_MAX

const int ocean::NMEA_MAX = 120
static

Definition at line 20 of file ocean.h.

◆ NMEA_PACKET

const int ocean::NMEA_PACKET = 1
static

Definition at line 29 of file ocean.h.

◆ NO_PACKET

const int ocean::NO_PACKET = 0
static

Definition at line 28 of file ocean.h.

◆ outbuffer

unsigned char willowgarage::ocean::ocean::outbuffer[OUTPUT_BUF_SIZE+1]
private

Definition at line 89 of file ocean.h.

◆ outbuflen

size_t willowgarage::ocean::ocean::outbuflen
private

Definition at line 90 of file ocean.h.

◆ OUTPUT_BUF_SIZE

const int ocean::OUTPUT_BUF_SIZE = 128
static

Definition at line 25 of file ocean.h.

◆ packetState

int willowgarage::ocean::ocean::packetState
private

Definition at line 86 of file ocean.h.

◆ packetType

int willowgarage::ocean::ocean::packetType
private

Definition at line 86 of file ocean.h.

◆ regList

const struct regPair willowgarage::ocean::ocean::regList[]
static

Definition at line 99 of file ocean.h.

◆ regListLength

const unsigned ocean::regListLength
static

Definition at line 100 of file ocean.h.

◆ sentenceCount

int willowgarage::ocean::ocean::sentenceCount
private

Definition at line 82 of file ocean.h.

◆ sentenceLength

int willowgarage::ocean::ocean::sentenceLength
private

Definition at line 94 of file ocean.h.

◆ server

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

Definition at line 102 of file ocean.h.

◆ tag

char willowgarage::ocean::ocean::tag[MAXTAGLEN]
private

Definition at line 93 of file ocean.h.

◆ ttyset

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 Wed Mar 8 2023 03:37:49