1
0
mirror of https://github.com/wjwwood/serial.git synced 2026-01-23 04:04:54 +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
TokenizerType tokenize;
#if 0
// Logging handlers
LoggingCallback warn;
LoggingCallback info;
LoggingCallback debug;
#endif
// Exception handler
ExceptionCallback handle_exc;

View File

@ -2,6 +2,7 @@
/***** Inline Functions *****/
#if 0
inline void defaultWarningCallback(const std::string& msg) {
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) {
std::cout << "SerialListener Info: " << msg << std::endl;
}
#endif
inline void defaultExceptionCallback(const std::exception &error) {
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) {
// Set default callbacks
this->handle_exc = defaultExceptionCallback;
#if 0
this->info = defaultInfoCallback;
this->debug = defaultDebugCallback;
this->warn = defaultWarningCallback;
#endif
// Default handler stuff
this->_default_handler = NULL;