23 #ifndef LMS1XX_LMS_BUFFER_H_ 24 #define LMS1XX_LMS_BUFFER_H_ 26 #include "console_bridge/console.h" 31 #define LMS_BUFFER_SIZE 50000 49 logDebug(
"Read %d bytes from fd, total length is %d.", ret,
total_length_);
54 logWarn(
"Buffer read() returned error.");
63 logDebug(
"Empty buffer, nothing to return.");
71 if (start_of_message == NULL)
74 logWarn(
"No STX found, dropping %d bytes from buffer.",
total_length_);
77 else if (
buffer_ != start_of_message)
80 logWarn(
"Shifting buffer, dropping %d bytes, %d bytes remain.",
90 logDebug(
"No ETX found, nothing to return.");
114 if (remaining_length > 0)
116 memmove(
buffer_, new_start, remaining_length);
127 #endif // LMS1XX_LMS_BUFFER_H_
char * end_of_first_message_
void shiftBuffer(char *new_start)
char buffer_[LMS_BUFFER_SIZE]