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);
56 class 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()
67 {
return desc_code_; }
69 virtual char const* error_type()
const throw()
70 {
return error_type_; }
72 virtual const char* what()
throw();
95 LogicError(
unsigned int desc_code,
char const* error_type)
112 RuntimeError(
unsigned int desc_code,
char const* error_type)
159 unsigned int baud()
const throw()
162 const char* what()
throw();
243 ArgError(
unsigned int desc_code,
char const* error_type)
330 ProtocolError(
unsigned int desc_code,
char const* error_type)
347 calculated_(calculated)
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();
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();
459 error_[0] = error[0]; error_[1] = error[1];
460 cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
479 const char* what()
throw();
499 error_(error), cmd_(cmd)
514 const char* what()
throw();
535 cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
536 echo_[0] = echo[0]; echo_[1] = echo[1];
555 const char* what()
throw();
575 cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
588 const char* what()
throw();
606 num_(num), line_length_(line_length)
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();
639 length_(length), expected_(expected)
643 expected_(rhs.expected())
646 virtual int length()
const throw()
649 virtual int expected()
const throw()
650 {
return expected_; }
652 const char* what()
throw();
665 #endif // HOKUYO_ERRORS_H__ ChecksumError(int expected, int calculated)
Checksum error constructor.
Definition: hokuyo_errors.h:345
Insufficient bytes to calculate checksum error.
Definition: hokuyo_errors.h:597
LogicError(unsigned int desc_code)
Logic error constructor.
Definition: hokuyo_errors.h:92
RuntimeError(unsigned int desc_code)
Runtime error constructor.
Definition: hokuyo_errors.h:109
Close error class.
Definition: hokuyo_errors.h:171
Baudrate error class.
Definition: hokuyo_errors.h:146
virtual char error_code() const
Get the one-byte error code.
Definition: hokuyo_errors.h:507
UnknownLine error.
Definition: hokuyo_errors.h:391
InsufficientBytesError(int num, int line_length)
Insufficient bytes error constructor.
Definition: hokuyo_errors.h:604
Bad argument error class.
Definition: hokuyo_errors.h:234
BaudrateError(unsigned int baud)
Baud rate error constructor.
Definition: hokuyo_errors.h:152
Incorrect number of data sets read error.
Definition: hokuyo_errors.h:371
Misplaced line feed error.
Definition: hokuyo_errors.h:381
ReadError(unsigned int desc_code)
Read error constructor.
Definition: hokuyo_errors.h:126
No data error class.
Definition: hokuyo_errors.h:251
Command echo error.
Definition: hokuyo_errors.h:525
Bad end step error class.
Definition: hokuyo_errors.h:311
ArgError(unsigned int desc_code)
Argument error constructor.
Definition: hokuyo_errors.h:240
int line_length_
Definition: hokuyo_errors.h:625
Bad firmware error class.
Definition: hokuyo_errors.h:191
Set IP error class.
Definition: hokuyo_errors.h:281
Bad start step error class.
Definition: hokuyo_errors.h:301
WriteError(unsigned int desc_code)
Write error constructor.
Definition: hokuyo_errors.h:139
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 cmd_echo() const
Get the two-byte command echo as a non-null-terminated array.
Definition: hokuyo_errors.h:552
ProtocolError(unsigned int desc_code)
Protocol error constructor.
Definition: hokuyo_errors.h:327
Base protocol error.
Definition: hokuyo_errors.h:321
int expected_
Definition: hokuyo_errors.h:658
Hokuyo laser scanner driver name space.
virtual char const *const cmd_code() const
Get the two-byte command code as a non-null-terminated array.
Definition: hokuyo_errors.h:585
SCIP version error class.
Definition: hokuyo_errors.h:201
virtual char const *const cmd_code() const
Get the two-byte command code as a non-null-terminated array.
Definition: hokuyo_errors.h:548
No destination error class.
Definition: hokuyo_errors.h:181
Not a serial connection error class.
Definition: hokuyo_errors.h:261
std::string desc_code_to_string(unsigned int code)
Translates an error description code into a string.
Definition: hokuyo_errors.cpp:279
Read error class.
Definition: hokuyo_errors.h:120
Bad response error - may be sent in response to any command.
Definition: hokuyo_errors.h:449
CommandEchoError(char const *const cmd, char const *const echo)
Command echo error constructor.
Definition: hokuyo_errors.h:532
Incorrect line length error.
Definition: hokuyo_errors.h:630
unsigned int baud_
Definition: hokuyo_errors.h:166
Parameter echo error.
Definition: hokuyo_errors.h:566
char cmd_
Definition: hokuyo_errors.h:520
General error class.
Definition: hokuyo_errors.h:56
int calculated_
Definition: hokuyo_errors.h:366
Runtime error class.
Definition: hokuyo_errors.h:103
std::stringstream ss
Definition: hokuyo_errors.h:79
int expected_
Definition: hokuyo_errors.h:364
Logic error class.
Definition: hokuyo_errors.h:86
Write error class.
Definition: hokuyo_errors.h:133
ParamEchoError(char const *const cmd)
Parameter echo error constructor.
Definition: hokuyo_errors.h:572
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
Bad checksum error.
Definition: hokuyo_errors.h:338
Parse error.
Definition: hokuyo_errors.h:412
Scip1ResponseError(char error, char cmd)
Response error constructor.
Definition: hokuyo_errors.h:497
UnsupportedError(unsigned int desc_code)
Unsupported error constructor.
Definition: hokuyo_errors.h:227
unsigned int desc_code_
Definition: hokuyo_errors.h:76
virtual char const *const error_code() const
Get the two-byte error code as a non-null-terminated array.
Definition: hokuyo_errors.h:472
Bad index error class.
Definition: hokuyo_errors.h:271
virtual char cmd_code() const
Get the one-byte command code.
Definition: hokuyo_errors.h:511
Unsupported feature error class.
Definition: hokuyo_errors.h:221
LineLengthError(int length, int expected)
Line length error constructor.
Definition: hokuyo_errors.h:637
int num_
Definition: hokuyo_errors.h:623
Bad response error (SCIP1 version)
Definition: hokuyo_errors.h:490
Invalid motor speed error class.
Definition: hokuyo_errors.h:291
Unknown SCIP version error class.
Definition: hokuyo_errors.h:211
Missing firmware specification error.
Definition: hokuyo_errors.h:439
ResponseError(char const *const error, char const *const cmd)
Response error constructor.
Definition: hokuyo_errors.h:456
int length_
Definition: hokuyo_errors.h:656
char error_
Definition: hokuyo_errors.h:518