Libraries to support working with GMLAN - General Motors CAN BUS network in most of their vehicles between 2007-present day. Please note this is a work in progress and not guaranteed to be correct, use at your own risk! Read commit logs / subscribe to see what has been added, it's a work in progress after all ;)
Diff: GMLAN.h
- Revision:
- 5:d0b067be6d44
- Parent:
- 4:486fec88517e
- Child:
- 6:32592425aa57
diff -r 486fec88517e -r d0b067be6d44 GMLAN.h --- a/GMLAN.h Wed Mar 13 14:50:15 2013 +0000 +++ b/GMLAN.h Tue Mar 19 10:03:21 2013 +0000 @@ -16,8 +16,10 @@ Jason Gaunt, 18th Feb 2013 */ +#include "mbed.h" #include "GMLAN_29bit.h" #include "GMLAN_11bit.h" +#include <vector> #ifndef GMLAN_H #define GMLAN_H @@ -77,4 +79,21 @@ int encode11bit(void); }; +class GMLAN_Message { + /* + Wrapper for CANMessage that automatically parses settings + */ + private: + vector<char> data; + int priority, arbitration, sender; + + public: + // Main function + GMLAN_Message(int _priority = -1, int _arbitration = -1, int _sender = -1, + int _b0 = -1, int _b1 = -1, int _b2 = -1, int _b3 = -1, int _b4 = -1, int _b5 = -1, int _b6 = -1, int _b7 = -1); + + // Return result + CANMessage generate(void); +}; + #endif \ No newline at end of file