meh

Fork of mbed by mbed official

Revision:
69:4a7918f48478
Parent:
66:9c8f0e3462fb
Child:
85:024bf7f99721
--- a/CAN.h	Wed Oct 23 16:23:06 2013 +0300
+++ b/CAN.h	Mon Nov 18 11:49:24 2013 +0200
@@ -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();