23 #ifndef LMS1XX_LMS_BUFFER_H_ 24 #define LMS1XX_LMS_BUFFER_H_ 26 #include "console_bridge/console.h" 31 #define LMS_BUFFER_SIZE 50000 35 #define logWarn CONSOLE_BRIDGE_logWarn 36 #define logError CONSOLE_BRIDGE_logError 37 #define logDebug CONSOLE_BRIDGE_logDebug 38 #define logInform CONSOLE_BRIDGE_logInform 59 logWarn(
"Buffer read() returned error.");
68 logDebug(
"Empty buffer, nothing to return.");
76 if (start_of_message == NULL)
82 else if (
buffer_ != start_of_message)
85 logWarn(
"Shifting buffer, dropping %d bytes, %d bytes remain.",
95 logDebug(
"No ETX found, nothing to return.");
119 if (remaining_length > 0)
121 memmove(
buffer_, new_start, remaining_length);
132 #endif // LMS1XX_LMS_BUFFER_H_
char * end_of_first_message_
void shiftBuffer(char *new_start)
char buffer_[LMS_BUFFER_SIZE]