29#ifndef HOKUYO_ERRORS_H__
30#define HOKUYO_ERRORS_H__
35 typedef unsigned char uint8_t;
36 typedef unsigned int uint32_t;
37 #if defined(HOKUYOAIST_STATIC)
38 #define HOKUYOAIST_EXPORT
39 #elif defined(hokuyoaist_EXPORTS)
40 #define HOKUYOAIST_EXPORT __declspec(dllexport)
42 #define HOKUYOAIST_EXPORT __declspec(dllimport)
46 #define HOKUYOAIST_EXPORT
58 char const*
const cmd);
83 virtual const char*
what()
const throw();
167 unsigned int baud()
const throw()
398 virtual char const*
const line()
const throw()
418 virtual char const*
const line()
const throw()
421 virtual char const*
const type()
const throw()
553 virtual int num()
const throw()
ArgError(unsigned int desc_code, char const *error_type)
ArgError(unsigned int desc_code)
Argument error constructor.
BaseError(unsigned int desc_code, char const *error_type)
Hokuyo error constructor.
std::string error_str_
Formatted description of the error.
BaseError(BaseError const &rhs)
char error_type_[32]
String representation of the error.
virtual unsigned int desc_code() const
virtual char const * error_type() const
unsigned int desc_code_
Description code for use with the error string table.
virtual const char * what() const
BaudrateError(unsigned int baud)
Baud rate error constructor.
unsigned int baud_
Baud rate that caused the error.
unsigned int baud() const
BaudrateError(BaudrateError const &rhs)
int calculated_
Calculated checksum value.
virtual int expected() const
ChecksumError(ChecksumError const &rhs)
ChecksumError(int expected, int calculated)
Checksum error constructor.
int expected_
Expected checksum value.
virtual int calculated() const
char cmd_[2]
Command that triggered the error, from SCIP2 (two bytes).
virtual char const *const cmd_code() const
Get the two-byte command code as a non-null-terminated array.
CommandEchoError(char const *const cmd, char const *const echo)
Command echo error constructor.
CommandEchoError(CommandEchoError const &rhs)
char echo_[2]
Received echo.
virtual char const *const cmd_echo() const
Get the two-byte command echo as a non-null-terminated array.
InsufficientBytesError(InsufficientBytesError const &rhs)
int line_length_
Length of the line.
InsufficientBytesError(int num, int line_length)
Insufficient bytes error constructor.
int num_
Number of bytes available.
virtual int line_length() const
virtual int expected() const
int expected_
The expected line length.
int length_
The received line length.
virtual int length() const
LineLengthError(int length, int expected)
Line length error constructor.
LineLengthError(LineLengthError const &rhs)
LogicError(unsigned int desc_code, char const *error_type)
LogicError(unsigned int desc_code)
Logic error constructor.
virtual char const *const cmd_code() const
Get the two-byte command code as a non-null-terminated array.
ParamEchoError(char const *const cmd)
Parameter echo error constructor.
char cmd_[2]
Command that triggered the error, from SCIP2 (two bytes).
ParamEchoError(ParamEchoError const &rhs)
ParseError(ParseError const &rhs)
virtual char const *const type() const
virtual char const *const line() const
char line_[128]
The bad line.
char type_[16]
The type of line.
ParseError(char const *const line, char const *const type)
Parse error constructor.
ProtocolError(unsigned int desc_code, char const *error_type)
ProtocolError(unsigned int desc_code)
Protocol error constructor.
ReadError(unsigned int desc_code)
Read error constructor.
virtual char const *const error_code() const
Get the two-byte error code as a non-null-terminated array.
ResponseError(ResponseError const &rhs)
char error_[2]
Error code as defined in SCIP2 (two bytes).
ResponseError(char const *const error, char const *const cmd)
Response error constructor.
char cmd_[2]
Command that triggered the error, from SCIP2 (two bytes).
virtual char const *const cmd_code() const
Get the two-byte command code as a non-null-terminated array.
RuntimeError(unsigned int desc_code, char const *error_type)
RuntimeError(unsigned int desc_code)
Runtime error constructor.
virtual char error_code() const
Get the one-byte error code.
char error_
Error code as defined in SCIP2 (two bytes).
char cmd_
Command that triggered the error, from SCIP2 (two bytes).
virtual char cmd_code() const
Get the one-byte command code.
Scip1ResponseError(char error, char cmd)
Response error constructor.
Scip1ResponseError(Scip1ResponseError const &rhs)
virtual char const *const line() const
UnknownLineError(UnknownLineError const &rhs)
UnknownLineError(char const *const line)
Unknown line error constructor.
char line_[128]
The mystery line.
UnknownScipVersionError()
UnsupportedError(unsigned int desc_code)
Unsupported error constructor.
WriteError(unsigned int desc_code)
Write error constructor.
#define HOKUYOAIST_EXPORT
std::string desc_code_to_string(unsigned int code)
Translates an error description code into a string.
std::string scip2_error_to_string(char const *const error, char const *const cmd)
Translates a SCIP2 error code into a string.