Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-src by
Diff: api/CAN.h
- Revision:
- 41:e8b66477f5bf
- Parent:
- 15:4892fe388435
- Child:
- 212:34d62c0b2af6
--- 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();