1
0
mirror of https://github.com/wjwwood/serial.git synced 2026-01-22 11:44:53 +08:00

Fixing compile errors with serial listener.

This commit is contained in:
William Woodall 2012-01-14 21:01:55 -06:00
parent 4afa6e2e7c
commit ae3e4a1f51
2 changed files with 6 additions and 0 deletions

View File

@ -792,10 +792,12 @@ private:
// Tokenizer // Tokenizer
TokenizerType tokenize; TokenizerType tokenize;
#if 0
// Logging handlers // Logging handlers
LoggingCallback warn; LoggingCallback warn;
LoggingCallback info; LoggingCallback info;
LoggingCallback debug; LoggingCallback debug;
#endif
// Exception handler // Exception handler
ExceptionCallback handle_exc; ExceptionCallback handle_exc;

View File

@ -2,6 +2,7 @@
/***** Inline Functions *****/ /***** Inline Functions *****/
#if 0
inline void defaultWarningCallback(const std::string& msg) { inline void defaultWarningCallback(const std::string& msg) {
std::cout << "SerialListener Warning: " << msg << std::endl; std::cout << "SerialListener Warning: " << msg << std::endl;
} }
@ -13,6 +14,7 @@ inline void defaultDebugCallback(const std::string& msg) {
inline void defaultInfoCallback(const std::string& msg) { inline void defaultInfoCallback(const std::string& msg) {
std::cout << "SerialListener Info: " << msg << std::endl; std::cout << "SerialListener Info: " << msg << std::endl;
} }
#endif
inline void defaultExceptionCallback(const std::exception &error) { inline void defaultExceptionCallback(const std::exception &error) {
std::cerr << "SerialListener Unhandled Exception: " << error.what(); std::cerr << "SerialListener Unhandled Exception: " << error.what();
@ -36,9 +38,11 @@ SerialListener::default_handler(const std::string &token) {
SerialListener::SerialListener() : listening(false), chunk_size_(5) { SerialListener::SerialListener() : listening(false), chunk_size_(5) {
// Set default callbacks // Set default callbacks
this->handle_exc = defaultExceptionCallback; this->handle_exc = defaultExceptionCallback;
#if 0
this->info = defaultInfoCallback; this->info = defaultInfoCallback;
this->debug = defaultDebugCallback; this->debug = defaultDebugCallback;
this->warn = defaultWarningCallback; this->warn = defaultWarningCallback;
#endif
// Default handler stuff // Default handler stuff
this->_default_handler = NULL; this->_default_handler = NULL;