mbed SDK library sources

Fork of mbed-src by mbed official

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Revision:
41:e8b66477f5bf
Parent:
15:4892fe388435
--- a/api/CAN.h	Fri Oct 25 13:45:04 2013 +0100
+++ b/api/CAN.h	Fri Oct 25 15:00:04 2013 +0100
@@ -131,12 +131,13 @@
     /** Read a CANMessage from the bus.
      *
      *  @param msg A CANMessage to read to.
+     *  @param handle message filter handle (0 for any message)
      *
      *  @returns
      *    0 if no message arrived,
      *    1 if message arrived
      */
-    int read(CANMessage &msg);
+    int read(CANMessage &msg, int handle = 0);
 
     /** Reset CAN interface.
      *
@@ -169,6 +170,19 @@
      */
     int mode(Mode mode);
     
+    /** Filter out incomming messages
+     *
+     *  @param id the id to filter on
+     *  @param mask the mask applied to the id
+     *  @param format format to filter on (Default CANAny)
+     *  @param handle message filter handle (Optional)
+     *
+     *  @returns
+     *    0 if filter change failed or unsupported,
+     *    new filter handle if successful
+     */
+    int filter(unsigned int id, unsigned int mask, CANFormat format = CANAny, int handle = 0);
+    
     /** Returns number of read errors to detect read overflow errors.
      */
     unsigned char rderror();