Skip to content

CRC Check #1

@1saeed

Description

@1saeed

I made some changes to this method:
bool Peripheral::checkCrc(unsigned char *data)
{
unsigned int size = 6 + data[3];
unsigned char crc = data[size-2], currentCRC = 0;
for(unsigned int i = 1 ; i < size - 1 ; i ++)
{
currentCRC += data[i];
}
currentCRC = ~currentCRC;
if(currentCRC == crc)
return true;
else return false;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions