Changeset 196 in flair-src for trunk/lib/FlairSensorActuator/src/Mb800.cpp
- Timestamp:
- Sep 12, 2017, 11:26:33 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSensorActuator/src/Mb800.cpp
r194 r196 43 43 44 44 void Mb800::Run(void) { 45 char response[200] = {0}; 46 int size,written; 45 int written; 47 46 48 47 /** Debut config **/ … … 103 102 /** Debut running loop **/ 104 103 WarnUponSwitches(true); 105 104 106 105 while (!ToBeStopped()) { 107 //SleepMS(10);??108 size = 0;106 char response[1024] = {0}; 107 int size = 0; 109 108 while (!ToBeStopped()) { 110 109 ssize_t read = serialport->Read(&response[size], 1); … … 113 112 } 114 113 115 if (response[size] == 0x0a) 116 break; 114 if (response[size] == 0x0a ) break; 117 115 size++; 116 if (size==sizeof(response)) break; 118 117 } 119 size++; 120 parseFrame(response, size); 118 if (size!=sizeof(response)) { 119 size++; 120 parseFrame(response, size); 121 } else { 122 Thread::Warn("frame too long for buffer\n"); 123 } 121 124 } 125 122 126 /** fin running loop **/ 123 127 WarnUponSwitches(false);
Note:
See TracChangeset
for help on using the changeset viewer.