Full Version : SNAP Protocol Library (GCC)
avr >>COMMUNICATIONS & WEB PROJECTS >>SNAP Protocol Library (GCC)


AVR_Admin- 04-16-2006
SNAP Protocol Library

Simple library for sending and receiving Snap packets.

The library has the following features:
- easy to use
- collision avoidance (e.g. RS486 half-duplex networks)
- crc-16 error detection
- interrupt-based receiving
- blocking transmitting

The Snap protocol is very flexible.

The library has the following restrictions to keep it simple:

- 3 byte addresses (16.7 million nodes)
- crc-16 error detection
- command-mode bits and protocol specific flags not supported
- 2 preamble bytes to improve packet start detection

Example: the device will echo back any data received

CODE
#include "snap.h"
int main(void)
{
   while (1)
    {
      if (SnapPacketReceived())
      {
         SnapSend(SnapPacketSource, SnapPacketData, SnapPacketDataLength);
         SnapReset();
      }
   }
}


For More Information on the S.N.A.P. Protocol See: http://www.hth.com/snap/


Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.