Last month I bought a CAN shield from Sparkfun in order to display gas mileage statistics in realtime for my OBD2-compatible car. I could not find a CAN library the did what I needed written in English, so I decided to write my own from scratch. I thought I would share it, in case it might be useful to anyone else.
The library has the following functions:
static boolean initCAN(int baudConst);
static boolean setCANNormalMode();
static boolean setCANReceiveonlyMode();
static boolean receiveCANMessage(CANMSG *msg, unsigned long timeout);
static boolean transmitCANMessage(CANMSG msg, unsigned long timeout);
static byte getCANTxErrCnt();
static byte getCANRxErrCnt();
static long queryOBD(byte code);
It includes a tested example to display miles per gallon on an LCD display (I have been using this in my car for the past several weeks).