f18d2db
diff --git a/CMakeLists.txt b/CMakeLists.txt
f18d2db
index b68dd9a..ff109b0 100644
f18d2db
--- a/CMakeLists.txt
f18d2db
+++ b/CMakeLists.txt
f18d2db
@@ -1,5 +1,7 @@
f18d2db
 cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
f18d2db
 
f18d2db
+set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
f18d2db
+
f18d2db
 project(HokuyoAIST)
f18d2db
 string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
f18d2db
 include(${PROJECT_SOURCE_DIR}/cmake/hokuyoaist_utils.cmake)
f18d2db
diff --git a/doc/content/index.txt b/doc/content/index.txt
f18d2db
index a398d49..84a2720 100644
f18d2db
--- a/doc/content/index.txt
f18d2db
+++ b/doc/content/index.txt
f18d2db
@@ -29,7 +29,7 @@ separately.
f18d2db
 Flexiport is available from GitHub_.
f18d2db
 
f18d2db
 .. _github:
f18d2db
-   http://www.gibhub.com/gbiggs/flexiport
f18d2db
+   http://www.github.com/gbiggs/flexiport
f18d2db
 
f18d2db
 
f18d2db
 Examples
f18d2db
diff --git a/include/hokuyoaist/hokuyo_errors.h b/include/hokuyoaist/hokuyo_errors.h
f18d2db
index a007361..5615ab3 100644
f18d2db
--- a/include/hokuyoaist/hokuyo_errors.h
f18d2db
+++ b/include/hokuyoaist/hokuyo_errors.h
f18d2db
@@ -72,7 +72,7 @@ class HOKUYOAIST_EXPORT BaseError : public std::exception
f18d2db
         */
f18d2db
         BaseError(unsigned int desc_code, char const* error_type);
f18d2db
         BaseError(BaseError const& rhs);
f18d2db
-        virtual ~BaseError() throw() {};
f18d2db
+        virtual ~BaseError() throw() {}
f18d2db
 
f18d2db
         virtual unsigned int desc_code() const throw()
f18d2db
             { return desc_code_; }
f18d2db
@@ -80,18 +80,15 @@ class HOKUYOAIST_EXPORT BaseError : public std::exception
f18d2db
         virtual char const* error_type() const throw()
f18d2db
             { return error_type_; }
f18d2db
 
f18d2db
-#if __cplusplus >= 201103L
f18d2db
         virtual const char* what() const throw();
f18d2db
-#else
f18d2db
-        virtual const char* what() throw();
f18d2db
-#endif
f18d2db
 
f18d2db
     protected:
f18d2db
         /** Description code for use with the error string table. */
f18d2db
         unsigned int desc_code_;
f18d2db
 
f18d2db
         /** Formatted description of the error. */
f18d2db
-        std::stringstream ss;
f18d2db
+        std::string error_str_;
f18d2db
+
f18d2db
         /** String representation of the error. */
f18d2db
         char error_type_[32];
f18d2db
 }; //class BaseError
f18d2db
@@ -127,7 +124,7 @@ class HOKUYOAIST_EXPORT RuntimeError : public BaseError
f18d2db
         RuntimeError(unsigned int desc_code, char const* error_type)
f18d2db
             : BaseError(desc_code, error_type)
f18d2db
         {}
f18d2db
-        virtual ~RuntimeError() throw() {};
f18d2db
+        virtual ~RuntimeError() throw() {}
f18d2db
 }; // class RuntimeError
f18d2db
 
f18d2db
 
f18d2db
@@ -164,22 +161,12 @@ class HOKUYOAIST_EXPORT BaudrateError: public RuntimeError
f18d2db
         /** @brief Baud rate error constructor.
f18d2db
 
f18d2db
         @param baud The bad baud rate. */
f18d2db
-        BaudrateError(unsigned int baud)
f18d2db
-            : RuntimeError(6, "BaudrateError"), baud_(baud)
f18d2db
-        {}
f18d2db
-        BaudrateError(BaudrateError const& rhs)
f18d2db
-            : RuntimeError(rhs), baud_(rhs.baud())
f18d2db
-        {}
f18d2db
+        BaudrateError(unsigned int baud);
f18d2db
+        BaudrateError(BaudrateError const& rhs);
f18d2db
 
f18d2db
         unsigned int baud() const throw()
f18d2db
             { return baud_; }
f18d2db
 
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-        virtual const char* what() const throw();
f18d2db
-#else
f18d2db
-        virtual const char* what() throw();
f18d2db
-#endif
f18d2db
-
f18d2db
     protected:
f18d2db
         /** Baud rate that caused the error. */
f18d2db
         unsigned int baud_;
f18d2db
@@ -361,14 +348,8 @@ class HOKUYOAIST_EXPORT ChecksumError: public ProtocolError
f18d2db
 
f18d2db
         @param expected The expected checksum.
f18d2db
         @param calculated The calculated checksum. */
f18d2db
-        ChecksumError(int expected, int calculated)
f18d2db
-            : ProtocolError(24, "ChecksumError"), expected_(expected),
f18d2db
-            calculated_(calculated)
f18d2db
-        {}
f18d2db
-        ChecksumError(ChecksumError const& rhs)
f18d2db
-            : ProtocolError(rhs), expected_(rhs.expected()),
f18d2db
-            calculated_(rhs.calculated())
f18d2db
-        {}
f18d2db
+        ChecksumError(int expected, int calculated);
f18d2db
+        ChecksumError(ChecksumError const& rhs);
f18d2db
 
f18d2db
         virtual int expected() const throw()
f18d2db
             { return expected_; }
f18d2db
@@ -376,12 +357,6 @@ class HOKUYOAIST_EXPORT ChecksumError: public ProtocolError
f18d2db
         virtual int calculated() const throw()
f18d2db
             { return calculated_; }
f18d2db
 
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-        virtual const char* what() const throw();
f18d2db
-#else
f18d2db
-        virtual const char* what() throw();
f18d2db
-#endif
f18d2db
-
f18d2db
     protected:
f18d2db
         /** Expected checksum value. */
f18d2db
         int expected_;
f18d2db
@@ -423,12 +398,6 @@ class HOKUYOAIST_EXPORT UnknownLineError: public ProtocolError
f18d2db
         virtual char const* const line() const throw()
f18d2db
             { return line_; }
f18d2db
 
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-        virtual const char* what() const throw();
f18d2db
-#else
f18d2db
-        virtual const char* what() throw();
f18d2db
-#endif
f18d2db
-
f18d2db
     protected:
f18d2db
         /** The mystery line. */
f18d2db
         char line_[128];
f18d2db
@@ -452,12 +421,6 @@ class HOKUYOAIST_EXPORT ParseError: public ProtocolError
f18d2db
         virtual char const* const type() const throw()
f18d2db
             { return type_; }
f18d2db
 
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-        virtual const char* what() const throw();
f18d2db
-#else
f18d2db
-        virtual const char* what() throw();
f18d2db
-#endif
f18d2db
-
f18d2db
     protected:
f18d2db
         /** The bad line. */
f18d2db
         char line_[128];
f18d2db
@@ -484,20 +447,8 @@ class HOKUYOAIST_EXPORT ResponseError: public ProtocolError
f18d2db
 
f18d2db
         @param error The two-byte error code received.
f18d2db
         @param cmd The command that caused the error. */
f18d2db
-        ResponseError(char const* const error, char const* const cmd)
f18d2db
-            : ProtocolError(30, "ResponseError")
f18d2db
-        {
f18d2db
-            error_[0] = error[0]; error_[1] = error[1];
f18d2db
-            cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
f18d2db
-        }
f18d2db
-        ResponseError(ResponseError const& rhs)
f18d2db
-            : ProtocolError(rhs)
f18d2db
-        {
f18d2db
-            error_[0] = rhs.error_code()[0];
f18d2db
-            error_[1] = rhs.error_code()[1];
f18d2db
-            cmd_[0] = rhs.cmd_code()[0];
f18d2db
-            cmd_[1] = rhs.cmd_code()[1];
f18d2db
-        }
f18d2db
+        ResponseError(char const* const error, char const* const cmd);
f18d2db
+        ResponseError(ResponseError const& rhs);
f18d2db
 
f18d2db
         /// Get the two-byte error code as a non-null-terminated array.
f18d2db
         virtual char const* const error_code() const throw()
f18d2db
@@ -507,12 +458,6 @@ class HOKUYOAIST_EXPORT ResponseError: public ProtocolError
f18d2db
         virtual char const* const cmd_code() const throw()
f18d2db
             { return cmd_; }
f18d2db
 
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-        virtual const char* what() const throw();
f18d2db
-#else
f18d2db
-        virtual const char* what() throw();
f18d2db
-#endif
f18d2db
-
f18d2db
     protected:
f18d2db
         /** Error code as defined in SCIP2 (two bytes). */
f18d2db
         char error_[2];
f18d2db
@@ -529,15 +474,8 @@ class HOKUYOAIST_EXPORT Scip1ResponseError: public ProtocolError
f18d2db
 
f18d2db
         @param error The two-byte error code received.
f18d2db
         @param cmd The command that caused the error. */
f18d2db
-        Scip1ResponseError(char error, char cmd)
f18d2db
-            : ProtocolError(30, "Scip1ResponseError"),
f18d2db
-            error_(error), cmd_(cmd)
f18d2db
-        {}
f18d2db
-        Scip1ResponseError(Scip1ResponseError const& rhs)
f18d2db
-            : ProtocolError(rhs), error_(rhs.error_code()),
f18d2db
-            cmd_(rhs.cmd_code())
f18d2db
-        {}
f18d2db
-
f18d2db
+        Scip1ResponseError(char error, char cmd);
f18d2db
+        Scip1ResponseError(Scip1ResponseError const& rhs);
f18d2db
         /// Get the one-byte error code.
f18d2db
         virtual char error_code() const throw()
f18d2db
             { return error_; }
f18d2db
@@ -546,12 +484,6 @@ class HOKUYOAIST_EXPORT Scip1ResponseError: public ProtocolError
f18d2db
         virtual char cmd_code() const throw()
f18d2db
             { return cmd_; }
f18d2db
 
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-        virtual const char* what() const throw();
f18d2db
-#else
f18d2db
-        virtual const char* what() throw();
f18d2db
-#endif
f18d2db
-
f18d2db
     protected:
f18d2db
         /** Error code as defined in SCIP2 (two bytes). */
f18d2db
         char error_;
f18d2db
@@ -568,20 +500,8 @@ class HOKUYOAIST_EXPORT CommandEchoError: public ProtocolError
f18d2db
 
f18d2db
         @param cmd The two-byte command code expected.
f18d2db
         @param echo The two-byte command echo received. */
f18d2db
-        CommandEchoError(char const* const cmd, char const* const echo)
f18d2db
-            : ProtocolError(31, "CommandEchoError")
f18d2db
-        {
f18d2db
-            cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
f18d2db
-            echo_[0] = echo[0]; echo_[1] = echo[1];
f18d2db
-        }
f18d2db
-        CommandEchoError(CommandEchoError const& rhs)
f18d2db
-            : ProtocolError(rhs)
f18d2db
-        {
f18d2db
-            cmd_[0] = rhs.cmd_code()[0];
f18d2db
-            cmd_[1] = rhs.cmd_code()[1];
f18d2db
-            echo_[0] = rhs.cmd_echo()[0];
f18d2db
-            echo_[1] = rhs.cmd_echo()[1];
f18d2db
-        }
f18d2db
+        CommandEchoError(char const* const cmd, char const* const echo);
f18d2db
+        CommandEchoError(CommandEchoError const& rhs);
f18d2db
 
f18d2db
         /// Get the two-byte command code as a non-null-terminated array.
f18d2db
         virtual char const* const cmd_code() const throw()
f18d2db
@@ -591,12 +511,6 @@ class HOKUYOAIST_EXPORT CommandEchoError: public ProtocolError
f18d2db
         virtual char const* const cmd_echo() const throw()
f18d2db
             { return echo_; }
f18d2db
 
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-        virtual const char* what() const throw();
f18d2db
-#else
f18d2db
-        virtual const char* what() throw();
f18d2db
-#endif
f18d2db
-
f18d2db
     protected:
f18d2db
         /** Command that triggered the error, from SCIP2 (two bytes). */
f18d2db
         char cmd_[2];
f18d2db
@@ -612,28 +526,13 @@ class HOKUYOAIST_EXPORT ParamEchoError: public ProtocolError
f18d2db
         /** @brief Parameter echo error constructor.
f18d2db
 
f18d2db
         @param cmd The two-byte command code sent. */
f18d2db
-        ParamEchoError(char const* const cmd)
f18d2db
-            : ProtocolError(32, "ParamEchoError")
f18d2db
-        {
f18d2db
-            cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
f18d2db
-        }
f18d2db
-        ParamEchoError(ParamEchoError const& rhs)
f18d2db
-            : ProtocolError(rhs)
f18d2db
-        {
f18d2db
-            cmd_[0] = rhs.cmd_code()[0];
f18d2db
-            cmd_[1] = rhs.cmd_code()[1];
f18d2db
-        }
f18d2db
+        ParamEchoError(char const* const cmd);
f18d2db
+        ParamEchoError(ParamEchoError const& rhs);
f18d2db
 
f18d2db
         /// Get the two-byte command code as a non-null-terminated array.
f18d2db
         virtual char const* const cmd_code() const throw()
f18d2db
             { return cmd_; }
f18d2db
 
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-        virtual const char* what() const throw();
f18d2db
-#else
f18d2db
-        virtual const char* what() throw();
f18d2db
-#endif
f18d2db
-
f18d2db
     protected:
f18d2db
         /** Command that triggered the error, from SCIP2 (two bytes). */
f18d2db
         char cmd_[2];
f18d2db
@@ -648,14 +547,8 @@ class HOKUYOAIST_EXPORT InsufficientBytesError: public ProtocolError
f18d2db
 
f18d2db
         @param num The number of bytes received.
f18d2db
         @param line_length The length of the line. */
f18d2db
-        InsufficientBytesError(int num, int line_length)
f18d2db
-            : ProtocolError(33, "InsufficientBytesError"),
f18d2db
-            num_(num), line_length_(line_length)
f18d2db
-        {}
f18d2db
-        InsufficientBytesError(InsufficientBytesError const& rhs)
f18d2db
-            : ProtocolError(rhs), num_(rhs.num()),
f18d2db
-            line_length_(rhs.line_length())
f18d2db
-        {}
f18d2db
+        InsufficientBytesError(int num, int line_length);
f18d2db
+        InsufficientBytesError(InsufficientBytesError const& rhs);
f18d2db
 
f18d2db
         virtual int num() const throw()
f18d2db
             { return num_; }
f18d2db
@@ -663,12 +556,6 @@ class HOKUYOAIST_EXPORT InsufficientBytesError: public ProtocolError
f18d2db
         virtual int line_length() const throw()
f18d2db
             { return line_length_; }
f18d2db
 
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-        virtual const char* what() const throw();
f18d2db
-#else
f18d2db
-        virtual const char* what() throw();
f18d2db
-#endif
f18d2db
-
f18d2db
     protected:
f18d2db
         /** Number of bytes available. */
f18d2db
         int num_;
f18d2db
@@ -685,14 +572,8 @@ class HOKUYOAIST_EXPORT LineLengthError: public ProtocolError
f18d2db
 
f18d2db
         @param length The number of bytes received.
f18d2db
         @param expected The expected length of the line. */
f18d2db
-        LineLengthError(int length, int expected)
f18d2db
-            : ProtocolError(34, "LineLengthError"),
f18d2db
-            length_(length), expected_(expected)
f18d2db
-        {}
f18d2db
-        LineLengthError(LineLengthError const& rhs)
f18d2db
-            : ProtocolError(rhs), length_(rhs.length()),
f18d2db
-            expected_(rhs.expected())
f18d2db
-        {}
f18d2db
+        LineLengthError(int length, int expected);
f18d2db
+        LineLengthError(LineLengthError const& rhs);
f18d2db
 
f18d2db
         virtual int length() const throw()
f18d2db
             { return length_; }
f18d2db
@@ -700,12 +581,6 @@ class HOKUYOAIST_EXPORT LineLengthError: public ProtocolError
f18d2db
         virtual int expected() const throw()
f18d2db
             { return expected_; }
f18d2db
 
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-        virtual const char* what() const throw();
f18d2db
-#else
f18d2db
-        virtual const char* what() throw();
f18d2db
-#endif
f18d2db
-
f18d2db
     protected:
f18d2db
         /** The received line length. */
f18d2db
         int length_;
f18d2db
@@ -713,7 +588,7 @@ class HOKUYOAIST_EXPORT LineLengthError: public ProtocolError
f18d2db
         int expected_;
f18d2db
 }; // class LineLengthError
f18d2db
 
f18d2db
-}; // namespace hokuyoaist
f18d2db
+} // namespace hokuyoaist
f18d2db
 
f18d2db
 /** @} */
f18d2db
 
f18d2db
diff --git a/python/hokuyo_aist.cpp b/python/hokuyo_aist.cpp
f18d2db
index 3922980..4201d45 100644
f18d2db
--- a/python/hokuyo_aist.cpp
f18d2db
+++ b/python/hokuyo_aist.cpp
f18d2db
@@ -43,8 +43,7 @@ class BaseErrorWrap
f18d2db
         {
f18d2db
             return BaseError::error_type();
f18d2db
         }
f18d2db
-
f18d2db
-        const char* what() throw()
f18d2db
+        const char* what() const throw()
f18d2db
         {
f18d2db
             if (boost::python::override f = get_override("what"))
f18d2db
             {
f18d2db
@@ -52,7 +51,7 @@ class BaseErrorWrap
f18d2db
             }
f18d2db
             return BaseError::what();
f18d2db
         }
f18d2db
-        const char* default_what() throw()
f18d2db
+        const char* default_what() const throw()
f18d2db
         {
f18d2db
             return BaseError::what();
f18d2db
         }
f18d2db
diff --git a/src/hokuyo_errors.cpp b/src/hokuyo_errors.cpp
f18d2db
index dd76a8d..884e624 100644
f18d2db
--- a/src/hokuyo_errors.cpp
f18d2db
+++ b/src/hokuyo_errors.cpp
f18d2db
@@ -367,56 +367,46 @@ BaseError::BaseError(unsigned int desc_code, char const* error_type)
f18d2db
     : desc_code_(desc_code)
f18d2db
 {
f18d2db
     strncpy(error_type_, error_type, 32);
f18d2db
+    std::stringstream ss;
f18d2db
+    ss << error_type_ << " (" << desc_code_ << "): " <<
f18d2db
+        desc_code_to_string(desc_code_);
f18d2db
+    error_str_ = ss.str();
f18d2db
 }
f18d2db
 
f18d2db
 
f18d2db
 BaseError::BaseError(BaseError const& rhs)
f18d2db
-    : desc_code_(rhs.desc_code())
f18d2db
+    : desc_code_(rhs.desc_code()),
f18d2db
+    error_str_(rhs.error_str_)
f18d2db
 {
f18d2db
     strncpy(error_type_, rhs.error_type(), 32);
f18d2db
 }
f18d2db
 
f18d2db
-
f18d2db
-#if __cplusplus >= 201103L
f18d2db
 const char* BaseError::what() const throw()
f18d2db
-#else
f18d2db
-const char* BaseError::what() throw()
f18d2db
-#endif
f18d2db
 {
f18d2db
-    ss << error_type_ << " (" << desc_code_ << "): " <<
f18d2db
-        desc_code_to_string(desc_code_);
f18d2db
-    return ss.str().c_str();
f18d2db
+    return error_str_.c_str();
f18d2db
 }
f18d2db
 
f18d2db
-
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-const char* BaudrateError::what() const throw()
f18d2db
-#else
f18d2db
-const char* BaudrateError::what() throw()
f18d2db
-#endif
f18d2db
+BaudrateError::BaudrateError(unsigned int baud)
f18d2db
+    : RuntimeError(6, "BaudrateError"), baud_(baud)
f18d2db
 {
f18d2db
-    RuntimeError::what();
f18d2db
+    std::stringstream ss;
f18d2db
     ss << baud_;
f18d2db
-    return ss.str().c_str();
f18d2db
+    error_str_ += ss.str();
f18d2db
 }
f18d2db
 
f18d2db
-
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-const char* ChecksumError::what() const throw()
f18d2db
-#else
f18d2db
-const char* ChecksumError::what() throw()
f18d2db
-#endif
f18d2db
+ChecksumError::ChecksumError(int expected, int calculated)
f18d2db
+    : ProtocolError(24, "ChecksumError"), expected_(expected), calculated_(calculated)
f18d2db
 {
f18d2db
-    ProtocolError::what();
f18d2db
+    std::stringstream ss;
f18d2db
     ss << "expected " << expected_ << ", calculated " << calculated_;
f18d2db
-    return ss.str().c_str();
f18d2db
+    error_str_ += ss.str();
f18d2db
 }
f18d2db
 
f18d2db
-
f18d2db
 UnknownLineError::UnknownLineError(char const* const line)
f18d2db
     : ProtocolError(27, "UnknownLineError")
f18d2db
 {
f18d2db
     strncpy(line_, line, 128);
f18d2db
+    error_str_ += std::string(line);
f18d2db
 }
f18d2db
 
f18d2db
 
f18d2db
@@ -426,24 +416,14 @@ UnknownLineError::UnknownLineError(UnknownLineError const& rhs)
f18d2db
     strncpy(line_, rhs.line(), 128);
f18d2db
 }
f18d2db
 
f18d2db
-
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-const char* UnknownLineError::what() const throw()
f18d2db
-#else
f18d2db
-const char* UnknownLineError::what() throw()
f18d2db
-#endif
f18d2db
-{
f18d2db
-    ProtocolError::what();
f18d2db
-    ss << line_;
f18d2db
-    return ss.str().c_str();
f18d2db
-}
f18d2db
-
f18d2db
-
f18d2db
 ParseError::ParseError(char const* const line, char const* const type)
f18d2db
     : ProtocolError(28, "ParseError")
f18d2db
 {
f18d2db
     strncpy(line_, line, 128);
f18d2db
     strncpy(type_, type, 16);
f18d2db
+    std::stringstream ss;
f18d2db
+    ss << "Line type: " << type_ << ". Line: " << line_;
f18d2db
+    error_str_ += ss.str();
f18d2db
 }
f18d2db
 
f18d2db
 
f18d2db
@@ -454,95 +434,107 @@ ParseError::ParseError(ParseError const& rhs)
f18d2db
     strncpy(type_, rhs.type(), 16);
f18d2db
 }
f18d2db
 
f18d2db
-
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-const char* ParseError::what() const throw()
f18d2db
-#else
f18d2db
-const char* ParseError::what() throw()
f18d2db
-#endif
f18d2db
+ResponseError::ResponseError(char const* const error, char const* const cmd)
f18d2db
+    : ProtocolError(30, "ResponseError")
f18d2db
 {
f18d2db
-    ProtocolError::what();
f18d2db
-    ss << "Line type: " << type_ << ". Line: " << line_;
f18d2db
-    return ss.str().c_str();
f18d2db
-}
f18d2db
-
f18d2db
-
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-const char* ResponseError::what() const throw()
f18d2db
-#else
f18d2db
-const char* ResponseError::what() throw()
f18d2db
-#endif
f18d2db
-{
f18d2db
-    ProtocolError::what();
f18d2db
+    error_[0] = error[0]; error_[1] = error[1];
f18d2db
+    cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
f18d2db
+    std::stringstream ss;
f18d2db
     ss << " Command: " << cmd_[0] << cmd_[1];
f18d2db
     ss << " Error : (" << error_[0] << error_[1] << ") " <<
f18d2db
         scip2_error_to_string(error_, cmd_);
f18d2db
-    return ss.str().c_str();
f18d2db
+    error_str_ += ss.str();
f18d2db
+}
f18d2db
+ResponseError::ResponseError(ResponseError const& rhs)
f18d2db
+    : ProtocolError(rhs)
f18d2db
+{
f18d2db
+    error_[0] = rhs.error_code()[0];
f18d2db
+    error_[1] = rhs.error_code()[1];
f18d2db
+    cmd_[0] = rhs.cmd_code()[0];
f18d2db
+    cmd_[1] = rhs.cmd_code()[1];
f18d2db
 }
f18d2db
 
f18d2db
-
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-const char* Scip1ResponseError::what() const throw()
f18d2db
-#else
f18d2db
-const char* Scip1ResponseError::what() throw()
f18d2db
-#endif
f18d2db
+Scip1ResponseError::Scip1ResponseError(char error, char cmd)
f18d2db
+    : ProtocolError(30, "Scip1ResponseError"),
f18d2db
+    error_(error), cmd_(cmd)
f18d2db
 {
f18d2db
-    ProtocolError::what();
f18d2db
+    std::stringstream ss;
f18d2db
     ss << " Command: " << cmd_;
f18d2db
     ss << " Error : " << error_;
f18d2db
-    return ss.str().c_str();
f18d2db
+    error_str_ += ss.str();
f18d2db
+}
f18d2db
+Scip1ResponseError::Scip1ResponseError(Scip1ResponseError const& rhs)
f18d2db
+    : ProtocolError(rhs), error_(rhs.error_code()),
f18d2db
+    cmd_(rhs.cmd_code())
f18d2db
+{
f18d2db
 }
f18d2db
 
f18d2db
-
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-const char* CommandEchoError::what() const throw()
f18d2db
-#else
f18d2db
-const char* CommandEchoError::what() throw()
f18d2db
-#endif
f18d2db
+CommandEchoError::CommandEchoError(char const* const cmd, char const* const echo)
f18d2db
+    : ProtocolError(31, "CommandEchoError")
f18d2db
 {
f18d2db
-    ProtocolError::what();
f18d2db
+    cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
f18d2db
+    echo_[0] = echo[0]; echo_[1] = echo[1];
f18d2db
+    std::stringstream ss;
f18d2db
     ss << " Command: " << cmd_[0] << cmd_[1];
f18d2db
     ss << " Received echo: " << echo_[0] << echo_[1];
f18d2db
-    return ss.str().c_str();
f18d2db
-}
f18d2db
+    error_str_ += ss.str();
f18d2db
 
f18d2db
+}
f18d2db
+CommandEchoError::CommandEchoError(CommandEchoError const& rhs)
f18d2db
+    : ProtocolError(rhs)
f18d2db
+{
f18d2db
+    cmd_[0] = rhs.cmd_code()[0];
f18d2db
+    cmd_[1] = rhs.cmd_code()[1];
f18d2db
+    echo_[0] = rhs.cmd_echo()[0];
f18d2db
+    echo_[1] = rhs.cmd_echo()[1];
f18d2db
+}
f18d2db
 
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-const char* ParamEchoError::what() const throw()
f18d2db
-#else
f18d2db
-const char* ParamEchoError::what() throw()
f18d2db
-#endif
f18d2db
+ParamEchoError::ParamEchoError(char const* const cmd)
f18d2db
+    : ProtocolError(32, "ParamEchoError")
f18d2db
 {
f18d2db
-    ProtocolError::what();
f18d2db
+    cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
f18d2db
+    std::stringstream ss;
f18d2db
     ss << " Command: " << cmd_[0] << cmd_[1];
f18d2db
-    return ss.str().c_str();
f18d2db
+    error_str_ += ss.str();
f18d2db
 }
f18d2db
 
f18d2db
+ParamEchoError::ParamEchoError(ParamEchoError const& rhs)
f18d2db
+    : ProtocolError(rhs)
f18d2db
+{
f18d2db
+    cmd_[0] = rhs.cmd_code()[0];
f18d2db
+    cmd_[1] = rhs.cmd_code()[1];
f18d2db
+}
f18d2db
 
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-const char* InsufficientBytesError::what() const throw()
f18d2db
-#else
f18d2db
-const char* InsufficientBytesError::what() throw()
f18d2db
-#endif
f18d2db
+InsufficientBytesError::InsufficientBytesError(int num, int line_length)
f18d2db
+    : ProtocolError(33, "InsufficientBytesError"),
f18d2db
+    num_(num), line_length_(line_length)
f18d2db
 {
f18d2db
-    ProtocolError::what();
f18d2db
+    std::stringstream ss;
f18d2db
     ss << " Number of bytes: " << num_;
f18d2db
     ss << " Line length: " << line_length_;
f18d2db
-    return ss.str().c_str();
f18d2db
+    error_str_ += ss.str();
f18d2db
+}
f18d2db
+InsufficientBytesError::InsufficientBytesError(InsufficientBytesError const& rhs)
f18d2db
+    : ProtocolError(rhs), num_(rhs.num()),
f18d2db
+    line_length_(rhs.line_length())
f18d2db
+{
f18d2db
 }
f18d2db
 
f18d2db
-
f18d2db
-#if __cplusplus >= 201103L
f18d2db
-const char* LineLengthError::what() const throw()
f18d2db
-#else
f18d2db
-const char* LineLengthError::what() throw()
f18d2db
-#endif
f18d2db
+LineLengthError::LineLengthError(int length, int expected)
f18d2db
+    : ProtocolError(34, "LineLengthError"),
f18d2db
+    length_(length), expected_(expected)
f18d2db
 {
f18d2db
-    ProtocolError::what();
f18d2db
+    std::stringstream ss;
f18d2db
     ss << " Received length: " << length_;
f18d2db
     ss << " Expected line length: " << expected_;
f18d2db
-    return ss.str().c_str();
f18d2db
+    error_str_ += ss.str();
f18d2db
+}
f18d2db
+
f18d2db
+LineLengthError::LineLengthError(LineLengthError const& rhs)
f18d2db
+    : ProtocolError(rhs), length_(rhs.length()),
f18d2db
+    expected_(rhs.expected())
f18d2db
+{
f18d2db
 }
f18d2db
 
f18d2db
-}; // namespace hokuyoaist
f18d2db
+} // namespace hokuyoaist
f18d2db
 
f18d2db
diff --git a/src/sensor.cpp b/src/sensor.cpp
f18d2db
index fa2a042..6e207d8 100644
f18d2db
--- a/src/sensor.cpp
f18d2db
+++ b/src/sensor.cpp
f18d2db
@@ -1772,7 +1772,7 @@ void Sensor::find_model(char const* buffer)
f18d2db
     {
f18d2db
         model_ = MODEL_UHG08LX;
f18d2db
     }
f18d2db
-    else if(strstr(buffer, "UTM-30LX") != 0)
f18d2db
+    else if(strstr(buffer, "UTM-30LX") != 0 || strstr(buffer, "UTM-X002S") != 0)
f18d2db
     {
f18d2db
         model_ = MODEL_UTM30LX;
f18d2db
         // Also enable the work around for a checksum problem in this