29 #ifndef INCLUDE_HOKUYOAIST_HOKUYO_ERRORS_H__ 30 #define INCLUDE_HOKUYOAIST_HOKUYO_ERRORS_H__ 36 typedef unsigned char uint8_t;
37 typedef unsigned int uint32_t;
38 #if defined(HOKUYOAIST_STATIC) 39 #define HOKUYOAIST_EXPORT 40 #elif defined(hokuyoaist_EXPORTS) 41 #define HOKUYOAIST_EXPORT __declspec(dllexport) 43 #define HOKUYOAIST_EXPORT __declspec(dllimport) 47 #define HOKUYOAIST_EXPORT 58 char const*
const cmd);
73 BaseError(
unsigned int desc_code,
char const* error_type);
78 {
return desc_code_; }
81 {
return error_type_; }
83 virtual const char* what()
const throw();
107 explicit LogicError(
unsigned int desc_code,
char const* error_type)
167 unsigned int baud()
const throw()
251 ArgError(
unsigned int desc_code,
char const* error_type)
357 {
return expected_; }
360 {
return calculated_; }
400 virtual char const*
const line()
const throw()
417 ParseError(
char const*
const line,
char const*
const type);
420 virtual char const*
const line()
const throw()
423 virtual char const*
const type()
const throw()
452 ResponseError(
char const*
const error,
char const*
const cmd);
555 virtual int num()
const throw()
559 {
return line_length_; }
584 {
return expected_; }
597 #endif // INCLUDE_HOKUYOAIST_HOKUYO_ERRORS_H__
ProtocolError(unsigned int desc_code)
Protocol error constructor.
RuntimeError(unsigned int desc_code, char const *error_type)
virtual char const *const error_code() const
Get the two-byte error code as a non-null-terminated array.
Incorrect line length error.
unsigned int baud() const
unsigned int baud_
Baud rate that caused the error.
ArgError(unsigned int desc_code)
Argument error constructor.
int line_length_
Length of the line.
virtual int length() const
unsigned int desc_code_
Description code for use with the error string table.
int length_
The received line length.
virtual char cmd_code() const
Get the one-byte command code.
Insufficient bytes to calculate checksum error.
ProtocolError(unsigned int desc_code, char const *error_type)
Unknown SCIP version error class.
Bad firmware error class.
LogicError(unsigned int desc_code, char const *error_type)
char cmd_
Command that triggered the error, from SCIP2 (two bytes).
Bad response error (SCIP1 version)
virtual char const *const cmd_code() const
Get the two-byte command code as a non-null-terminated array.
LogicError(unsigned int desc_code)
Logic error constructor.
std::string desc_code_to_string(unsigned int code)
Translates an error description code into a string.
#define HOKUYOAIST_EXPORT
ReadError(unsigned int desc_code)
Read error constructor.
No destination error class.
virtual int calculated() const
UnsupportedError(unsigned int desc_code)
Unsupported error constructor.
SCIP version error class.
virtual char const * error_type() const
virtual char error_code() const
Get the one-byte error code.
int calculated_
Calculated checksum value.
virtual char const *const line() const
int expected_
Expected checksum value.
virtual int expected() const
virtual char const *const type() const
Bad argument error class.
std::string error_str_
Formatted description of the error.
Invalid motor speed error class.
virtual char const *const cmd_code() const
Get the two-byte command code as a non-null-terminated array.
RuntimeError(unsigned int desc_code)
Runtime error constructor.
WriteError(unsigned int desc_code)
Write error constructor.
virtual int expected() const
Unsupported feature error class.
UnknownScipVersionError()
Bad response error - may be sent in response to any command.
virtual unsigned int desc_code() const
int expected_
The expected line length.
Bad start step error class.
std::string scip2_error_to_string(char const *const error, char const *const cmd)
Translates a SCIP2 error code into a string.
Not a serial connection error class.
virtual char const *const cmd_code() const
Get the two-byte command code as a non-null-terminated array.
Incorrect number of data sets read error.
Misplaced line feed error.
virtual char const *const cmd_echo() const
Get the two-byte command echo as a non-null-terminated array.
char error_
Error code as defined in SCIP2 (two bytes).
Bad end step error class.
Missing firmware specification error.
virtual char const *const line() const
virtual int line_length() const
int num_
Number of bytes available.
ArgError(unsigned int desc_code, char const *error_type)