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:
parent
4afa6e2e7c
commit
ae3e4a1f51
@ -792,10 +792,12 @@ private:
|
||||
// Tokenizer
|
||||
TokenizerType tokenize;
|
||||
|
||||
#if 0
|
||||
// Logging handlers
|
||||
LoggingCallback warn;
|
||||
LoggingCallback info;
|
||||
LoggingCallback debug;
|
||||
#endif
|
||||
|
||||
// Exception handler
|
||||
ExceptionCallback handle_exc;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user