22 #include <sys/ioctl.h> 44 uint8_t byte_buffer = 0;
59 while (byte_buffer != 0x02);
62 int payload_length = 0;
69 while (payload_buffer[payload_length-1] != 0x03);
77 sick_message.BuildMessage(payload_buffer,payload_length);
103 int num_bytes_waiting = 0;
106 if (ioctl(
_sick_fd,FIONREAD,&num_bytes_waiting)) {
107 throw SickIOException(
"SickLMS1xxBufferMonitor::_flushTCPRecvBuffer: ioctl() failed!");
111 for (
int i = 0; i < num_bytes_waiting; i++) {
114 if (read(
_sick_fd,&null_byte,1) != 1) {
115 throw SickIOException(
"SickLMS1xxBufferMonitor::_flushTCPRecvBuffer: ioctl() failed!");
Contains some simple exception classes.
Defines a class for monitoring the receive buffer when interfacing w/ a Sick LMS 1xx laser range find...
Defines simple utility functions for working with the Sick LMS 1xx laser range finder units...
#define DEFAULT_SICK_LMS_1XX_BYTE_TIMEOUT
Max allowable time between consecutive bytes.