Fixed ack error.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@805 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
james.goppert 2010-11-08 04:38:42 +00:00
parent 3ec939888e
commit 7dd853642c
1 changed files with 3 additions and 6 deletions

View File

@ -204,16 +204,13 @@ BinComm::_decode(uint8_t inByte)
// call any handler interested in this message
for (tableIndex = 0; MSG_NULL != _handlerTable[tableIndex].messageID; tableIndex++)
if(_handlerTable[tableIndex].messageID == MSG_ACKNOWLEDGE)
{
// don't acknowledge, to avoid infinite ack echo
}
else if(_handlerTable[tableIndex].messageID == MSG_ANY ||
if(_handlerTable[tableIndex].messageID == MSG_ANY ||
_handlerTable[tableIndex].messageID == _messageID )
{
_handlerTable[tableIndex].handler(_handlerTable[tableIndex].arg,
_messageID, _messageVersion, &_decodeBuf);
send_msg_acknowledge(_messageID,_sumA,_sumB);
// dont' acknowledge an acknowledgement, will echo infinetly
if (_messageID != MSG_ACKNOWLEDGE) send_msg_acknowledge(_messageID,_sumA,_sumB);
}
} else {
badMessagesReceived++;