Note: As of August 2015, this library has been orphaned. If you're interested in forking or restarting development, please see the README.txt file for additional information.
The OlcbCommonCAN library combined with other platform-specific libraries to form a low-end OpenLCB implementation aimed at small processors. Together, the parts are called the Olcb* (pronounced “olcb star”) libraries.
libraries/OlcbCommonCAN – common implementations for CAN wire protocol
libraries/OlcbArduinoCAN – implementations specific to Arduino, including the CAN driver interface for the Arduino CAN library
OlcbDesktopCAN – implementations to run on a desktop machine, primarily for testing; no real CAN connection
OlcbDesktopTest – unit and function tests to run on a desktop machine
libraries/OlcbTestCAN – (deprecated) bits to run on a desktop machine & some testing
It's hardware-independent as much as possible, so that it can form the basis for the Arduino and PIC implementations. It's also configured to run standalone tests and simulations without specific hardware, e.g on a PC. These are now written using the gtest toolkit, a pre-configured copy of which is included in OpenLCB SVN.
The sections below discuss the details of using the code.
Available Programs
OlcbBasicNode – The basic 4 producer, 4 consumer sample OpenLCB node. (OlcbMiniNode is a version with less capability that takes less memory)
OlcbIo – An OpenLCB node for the RailStars Io board.
OlcbServoNode – An OpenLCB node that drives servos for output.
OlcbClockGenerator, OlcbFastClockDisplayNode – An OpenLCB fast clock generator and clock display node pair. (ClockDisplay is another example of a clock display node)
OlcbLocoNet, OlcbNmraDcc – OpenLCB nodes to convert LocoNet traffic and NMRA DCC packets to OpenLCB events.
OlcbDisplay – Prototype implementation of the OpenLCB Display protocol
tch_tech_16P_24C, tch_tech_consumer, tch_tech_consumer_ver_1, tch_tech_producer, tch_tech_producer_ver_1 – programs for the TCH Technology boards
Sketches OlcbBasicNode, OlcbMiniNode (and perhaps others) use implementations from libraries/OlcbCommonCAN, libraries/OlcbArduinoCAN and libraries/ButtonLED when opened in Arduino IDE.
The basic starting point is the OlcbBasicNode sketch, which implements 4 producers and 4 consumers on an Arduino shield.
To build and run the tests, do
make run
The gcc/g++ compiler is expected. The “run” argument runs some standalone tests that work by comparing stdout to pre-made files from SVN; it might not work on a non-*nix machine.
This is primarily used to do a quick build check on all the Olcb* sketches after a change to the code.
You can build and test the libraries for your desktop machine via NetBeans. Cross-compilation is not yet available, though it would be a great thing for somebody to work on.
Start by opening the OlcbDesktopTests project. It should also open three other projects:
ButtonLED
OlcbCommonCAN – This project builds the common library
OlcbDesktopCAN – This project provides the base desktop implementations for linking with the library
Select the OlcbDesktopTests project in the window, do a clean build, and then run. This runs the default set of tests.
Note to MacOS X users: To get command line C/C++ tools needed by NetBeans, you may need to download and launch Xcode, go to Preferences → Downloads, and install the command line tools.
The content of this development area, including code, documents and web pages, is kept in the OpenLCB SourceForge.net SVN repository in the “trunk/prototypes/C” directory. To check it out, please do:
svn co http://svn.code.sf.net/p/openlcb/svn/trunk/prototypes/C/OlcbStarLibraries OlcbStarLibraries
For more information on the SVN source code management tool, please see the SVN website and the online SVN book.
This web site contains trademarks and copyrighted information. Please see the Licensing page.
This is SVN $Revision: 3915 $ of