ABC of Electronics cosycom.com
EMBEDDED SYSTEMS & MICROCONTROLLERS · PAGE 43

Wireless Modules for Microcontrollers

Radios without the radio design.

Ready-made modules handle the difficult radio parts. Typical choices are Bluetooth, Wi-Fi, low-power sub-gigahertz radios and simple infrared links.

Compare range, data rate, current draw and legal frequency rules in your country. Higher power and longer range cost more battery.

Add checksums to messages so corrupted packets are rejected.

EXAMPLE
uint8_t checksum(const uint8_t *d, uint8_t n) {
    uint8_t s = 0;
    while (n--) s += *d++;
    return (uint8_t)(~s + 1);   /* two's complement */
}