20#ifndef HOKUYO_ERRORS_H__
21#define HOKUYO_ERRORS_H__
26 typedef unsigned char uint8_t;
27 typedef unsigned int uint32_t;
28 #if defined(HOKUYO_AIST_STATIC)
29 #define HOKUYO_AIST_EXPORT
30 #elif defined(HOKUYO_AIST_EXPORTS)
31 #define HOKUYO_AIST_EXPORT __declspec(dllexport)
33 #define HOKUYO_AIST_EXPORT __declspec(dllimport)
37 #define HOKUYO_AIST_EXPORT
49 char const*
const cmd);
56class HOKUYO_AIST_EXPORT
BaseError :
public std::exception
62 BaseError(
unsigned int desc_code,
char const* error_type);
66 virtual unsigned int desc_code()
const throw()
69 virtual char const* error_type()
const throw()
72 virtual const char* what()
throw();
95 LogicError(
unsigned int desc_code,
char const* error_type)
98 virtual ~LogicError() throw() {};
112 RuntimeError(
unsigned int desc_code,
char const* error_type)
115 virtual ~RuntimeError() throw() {};
159 unsigned int baud()
const throw()
162 const char* what() throw();
214 UnknownScipVersionError()
243 ArgError(
unsigned int desc_code,
char const* error_type)
246 virtual ~ArgError() throw() {};
291class HOKUYO_AIST_EXPORT MotorSpeedError:
public ArgError
301class HOKUYO_AIST_EXPORT StartStepError:
public ArgError
311class HOKUYO_AIST_EXPORT EndStepError:
public ArgError
330 ProtocolError(
unsigned int desc_code,
char const* error_type)
333 virtual ~ProtocolError() throw() {}
351 calculated_(rhs.calculated())
354 virtual int expected()
const throw()
355 {
return expected_; }
357 virtual int calculated()
const throw()
358 {
return calculated_; }
360 const char* what() throw();
384 MisplacedLineFeedError()
400 virtual char const*
const line()
const throw()
403 const char* what()
throw();
419 ParseError(
char const*
const line,
char const*
const type);
422 virtual char const*
const line()
const throw()
425 virtual char const*
const type()
const throw()
428 const char* what()
throw();
442 MissingFirmSpecError()
479 const char* what() throw();
514 const char* what() throw();
555 const char* what() throw();
588 const char* what() throw();
610 line_length_(rhs.line_length())
613 virtual int num()
const throw()
616 virtual int line_length()
const throw()
617 {
return line_length_; }
619 const char* what() throw();
643 expected_(rhs.expected())
646 virtual int length()
const throw()
649 virtual int expected()
const throw()
650 {
return expected_; }
652 const char* what() throw();
Bad argument error class.
Definition hokuyo_errors.h:235
ArgError(unsigned int desc_code)
Argument error constructor.
Definition hokuyo_errors.h:240
General error class.
Definition hokuyo_errors.h:57
std::stringstream ss
Definition hokuyo_errors.h:79
BaseError(unsigned int desc_code, char const *error_type)
Hokuyo error constructor.
Definition hokuyo_errors.cpp:327
unsigned int desc_code_
Definition hokuyo_errors.h:76
char error_type_[32]
Definition hokuyo_errors.h:81
Baudrate error class.
Definition hokuyo_errors.h:147
BaudrateError(unsigned int baud)
Baud rate error constructor.
Definition hokuyo_errors.h:152
unsigned int baud_
Definition hokuyo_errors.h:166
Bad checksum error.
Definition hokuyo_errors.h:339
int calculated_
Definition hokuyo_errors.h:366
int expected_
Definition hokuyo_errors.h:364
ChecksumError(int expected, int calculated)
Checksum error constructor.
Definition hokuyo_errors.h:345
Command echo error.
Definition hokuyo_errors.h:526
CommandEchoError(char const *const cmd, char const *const echo)
Command echo error constructor.
Definition hokuyo_errors.h:532
virtual char const *const cmd_echo() const
Get the two-byte command echo as a non-null-terminated array.
Definition hokuyo_errors.h:552
char echo_[2]
Definition hokuyo_errors.h:561
char cmd_[2]
Definition hokuyo_errors.h:559
virtual char const *const cmd_code() const
Get the two-byte command code as a non-null-terminated array.
Definition hokuyo_errors.h:548
Insufficient bytes to calculate checksum error.
Definition hokuyo_errors.h:598
int line_length_
Definition hokuyo_errors.h:625
InsufficientBytesError(int num, int line_length)
Insufficient bytes error constructor.
Definition hokuyo_errors.h:604
int num_
Definition hokuyo_errors.h:623
Incorrect line length error.
Definition hokuyo_errors.h:631
int expected_
Definition hokuyo_errors.h:658
LineLengthError(int length, int expected)
Line length error constructor.
Definition hokuyo_errors.h:637
int length_
Definition hokuyo_errors.h:656
Logic error class.
Definition hokuyo_errors.h:87
LogicError(unsigned int desc_code)
Logic error constructor.
Definition hokuyo_errors.h:92
Parameter echo error.
Definition hokuyo_errors.h:567
virtual char const *const cmd_code() const
Get the two-byte command code as a non-null-terminated array.
Definition hokuyo_errors.h:585
char cmd_[2]
Definition hokuyo_errors.h:592
ParamEchoError(char const *const cmd)
Parameter echo error constructor.
Definition hokuyo_errors.h:572
char type_[16]
Definition hokuyo_errors.h:434
ParseError(char const *const line, char const *const type)
Parse error constructor.
Definition hokuyo_errors.cpp:387
char line_[128]
Definition hokuyo_errors.h:432
Base protocol error.
Definition hokuyo_errors.h:322
ProtocolError(unsigned int desc_code)
Protocol error constructor.
Definition hokuyo_errors.h:327
ReadError(unsigned int desc_code)
Read error constructor.
Definition hokuyo_errors.h:126
Bad response error - may be sent in response to any command.
Definition hokuyo_errors.h:450
char cmd_[2]
Definition hokuyo_errors.h:485
ResponseError(char const *const error, char const *const cmd)
Response error constructor.
Definition hokuyo_errors.h:456
char error_[2]
Definition hokuyo_errors.h:483
virtual char const *const cmd_code() const
Get the two-byte command code as a non-null-terminated array.
Definition hokuyo_errors.h:476
virtual char const *const error_code() const
Get the two-byte error code as a non-null-terminated array.
Definition hokuyo_errors.h:472
Runtime error class.
Definition hokuyo_errors.h:104
RuntimeError(unsigned int desc_code)
Runtime error constructor.
Definition hokuyo_errors.h:109
Bad response error (SCIP1 version)
Definition hokuyo_errors.h:491
char error_
Definition hokuyo_errors.h:518
char cmd_
Definition hokuyo_errors.h:520
virtual char error_code() const
Get the one-byte error code.
Definition hokuyo_errors.h:507
virtual char cmd_code() const
Get the one-byte command code.
Definition hokuyo_errors.h:511
Scip1ResponseError(char error, char cmd)
Response error constructor.
Definition hokuyo_errors.h:497
char line_[128]
Definition hokuyo_errors.h:407
UnknownLineError(char const *const line)
Unknown line error constructor.
Definition hokuyo_errors.cpp:365
UnsupportedError(unsigned int desc_code)
Unsupported error constructor.
Definition hokuyo_errors.h:227
WriteError(unsigned int desc_code)
Write error constructor.
Definition hokuyo_errors.h:139
Hokuyo laser scanner driver name space.
std::string desc_code_to_string(unsigned int code)
Translates an error description code into a string.
Definition hokuyo_errors.cpp:279
std::string scip2_error_to_string(char const *const error, char const *const cmd)
Translates a SCIP2 error code into a string.
Definition hokuyo_errors.cpp:29