NGCP / xbeeplus

Cross-Platform C++11 Xbee Radio API
3 stars 0 forks source link

Create ByteSum Utility Function #4

Closed KarthikJay closed 7 years ago

KarthikJay commented 7 years ago

Create a generic byte sum function with the following prototype: uint8_t ByteSum(T item); uint8_t ByteSum(std::string item); uint8_t ByteSum(char *item)

The function should take in any integral type ( It should then sum the bytes (into a uin8_t), disregarding overflow. This uint8_t is then returned.

Once implementation is tested, use it inside the SetChecksum() functions of each packet data type.

KarthikJay commented 7 years ago

https://isocpp.org/wiki/faq/templates#fn-templates-explicit-calls

zhangh94 commented 7 years ago

This is resolved in pull request #7