Fixed code for new buzz (especially commit a854c5cdc6830e4c1ec246b46886d4298ac872f1)

This commit is contained in:
pyhs 2017-07-11 15:28:24 -04:00
parent f2374137a7
commit f24fb63723
1 changed files with 2 additions and 0 deletions

View File

@ -182,6 +182,7 @@ namespace buzz_utility{
uint16_t* data= u64_cvt_u16((uint64_t)first_INmsg[0]); uint16_t* data= u64_cvt_u16((uint64_t)first_INmsg[0]);
/*Size is at first 2 bytes*/ /*Size is at first 2 bytes*/
uint16_t size=data[0]*sizeof(uint64_t); uint16_t size=data[0]*sizeof(uint64_t);
uint16_t robot_id = data[1];
delete[] data; delete[] data;
/*size and robot id read*/ /*size and robot id read*/
size_t tot = sizeof(uint32_t); size_t tot = sizeof(uint32_t);
@ -195,6 +196,7 @@ namespace buzz_utility{
/* Append message to the Buzz input message queue */ /* Append message to the Buzz input message queue */
if(unMsgSize > 0 && unMsgSize <= size - tot ) { if(unMsgSize > 0 && unMsgSize <= size - tot ) {
buzzinmsg_queue_append(VM, buzzinmsg_queue_append(VM,
robot_id,
buzzmsg_payload_frombuffer(first_INmsg +tot, unMsgSize)); buzzmsg_payload_frombuffer(first_INmsg +tot, unMsgSize));
tot += unMsgSize; tot += unMsgSize;
} }