For more information on the alternating bit protocol, look here [FOLDOC]
The AB-protocol makes the communciations between Lego-RCXs reliable. The importance of a reliable protocol is undeniable since the standard communication primitives with LegOS/BrickOS, based on LNP guarantee only the integrity of packets, not their delivery.
This protocol implementation does not achive miracles : two bricks that are definately out of range will never communicate (unless using a nifty ad hoc protocol). The protocol will continue to try to send the message, and can notify the sender when the message was received.
This package is multi-threaded, robust, efficient and small (in that order).
Look at the ab protocol interface module documentation for more details.
We used this implementation in highly asynchronous and multithreaded environment, and took special care to avoid race-conditions, this implementation should therefore be sufficiently robust to survive the more demanding developer.
Next, change LEGOS_ROOT in the Makefile in src/lib so it points to your legOS installation directory.
Launch Make to create the ablib.a library.
Any legos program should then #include "ab.h" (located in src/include) and the ablib.a file must be linked with the program.
Look at the example program.
Nicolas Devos