yujinrobot / kobuki_core

Core (non-ros) kobuki packages.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bool PacketFinderBase::waitForPayloadAndEtx(const unsigned char * incoming, unsigned int numberOfIncoming, bool & foundPacket)

tyw517369 opened this issue · comments

commented

I thank function waitForPayloadAndEtx need modify as below:

int j = 0;
for (unsigned int i = (size_stx + size_length_field + size_payload + size_checksum_field);
    i < (size_stx + size_length_field + size_payload + size_checksum_field + size_etx); i++)
{
  if(verbose)
  {
    printf("buffer[%d] =%02x  ETX[%d]=%02x\n", i, buffer[i], j, ETX[j]);
  }
  if (buffer[i] != ETX[j])
  {
    foundPacket = false;
  }
  j++;
}