Revision 1282
Fixes: robot_read_bom_all
comm_robot.c | ||
---|---|---|
13 | 13 |
#define received_state_received 3 |
14 | 14 |
#define received_state_uninitialized 4 |
15 | 15 |
|
16 |
uint8_t received_buffer[10]; // Maximum length of a packet to be handled |
|
16 |
#define MAX_PACKET_LENGTH 32 |
|
17 |
|
|
18 |
uint8_t received_buffer[MAX_PACKET_LENGTH]; // Maximum length of a packet to be handled |
|
17 | 19 |
uint8_t received_length; |
18 | 20 |
uint8_t received_state; |
19 | 21 |
|
... | ... | |
224 | 226 |
} |
225 | 227 |
} |
226 | 228 |
|
227 |
bool robot_read_bom_all (uint16_t *value)
|
|
229 |
bool robot_read_bom_all (int16_t *value) |
|
228 | 230 |
{ |
229 | 231 |
send_request_packet(station_robot_read_bom_all, NULL, 0); |
230 | 232 |
|
... | ... | |
279 | 281 |
// The packet buffer might be overwritten after this function returns, so we have to make a copy of the data. |
280 | 282 |
|
281 | 283 |
// First, determine the number of bytes to copy. It is the minimum of the received length and the size of the data |
282 |
// buffer the data is copied to. |
|
284 |
// buffer the data is copied to. TODO: signal an error if this happens.
|
|
283 | 285 |
received_length=length; |
284 | 286 |
if (sizeof (received_buffer)<received_length) received_length=sizeof (received_buffer); |
285 | 287 |
|
Also available in: Unified diff