Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thanks for nice work, I found error please update error in code. #11

Open
virendpatel opened this issue Jun 17, 2021 · 1 comment
Open

Comments

@virendpatel
Copy link

def getChecksum(data):

"""
calculates the checksum of the packet.
:param data: the datapacket
Returns the list containing two bytes which are the checksum of the given
packet.
"""

frame = data[6:]
csum = sum(getIntList(frame))
_csum1 = int(csum / 256)
csum2 = csum % 256_
#print(hex(csum1), hex(csum2))
return [csum1, csum2]
@virendpatel
Copy link
Author

virendpatel commented Jun 17, 2021

All places where you used /100 should be /256 and %100 should be %256.
for python3 n/256 should be int(n/256)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant