![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Making a BMW E90 instrument cluster alive for demonstration purposes
T15Msg.h@3:4a4463380739, 2017-03-11 (annotated)
- Committer:
- gume
- Date:
- Sat Mar 11 10:03:52 2017 +0000
- Revision:
- 3:4a4463380739
- Parent:
- 0:830e074c92d5
Initial Speed module (not yet working); Fuel data
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gume | 0:830e074c92d5 | 1 | #ifndef T15MSG_H |
gume | 0:830e074c92d5 | 2 | #define T15MSG_H |
gume | 0:830e074c92d5 | 3 | |
gume | 0:830e074c92d5 | 4 | #include "mbed.h" |
gume | 0:830e074c92d5 | 5 | |
gume | 0:830e074c92d5 | 6 | class T15Msg { |
gume | 0:830e074c92d5 | 7 | |
gume | 0:830e074c92d5 | 8 | char counter1; |
gume | 0:830e074c92d5 | 9 | char counter2; |
gume | 0:830e074c92d5 | 10 | |
gume | 0:830e074c92d5 | 11 | bool enginerun; |
gume | 0:830e074c92d5 | 12 | bool ignition; |
gume | 0:830e074c92d5 | 13 | bool clutch; |
gume | 0:830e074c92d5 | 14 | |
gume | 0:830e074c92d5 | 15 | char enginestate; |
gume | 0:830e074c92d5 | 16 | int statecounter; |
gume | 0:830e074c92d5 | 17 | bool sstart; |
gume | 0:830e074c92d5 | 18 | bool sstop; |
gume | 0:830e074c92d5 | 19 | |
gume | 0:830e074c92d5 | 20 | char data[5]; |
gume | 0:830e074c92d5 | 21 | |
gume | 0:830e074c92d5 | 22 | void updateData(char resetc1 = 0x10); |
gume | 0:830e074c92d5 | 23 | void updateState(); |
gume | 0:830e074c92d5 | 24 | |
gume | 0:830e074c92d5 | 25 | public: |
gume | 0:830e074c92d5 | 26 | T15Msg(); |
gume | 0:830e074c92d5 | 27 | |
gume | 0:830e074c92d5 | 28 | bool sendMessage(CAN *can); |
gume | 0:830e074c92d5 | 29 | bool start(); |
gume | 0:830e074c92d5 | 30 | bool stop(); |
gume | 0:830e074c92d5 | 31 | }; |
gume | 0:830e074c92d5 | 32 | |
gume | 0:830e074c92d5 | 33 | #endif |
gume | 0:830e074c92d5 | 34 | |
gume | 0:830e074c92d5 | 35 | // About T15 |
gume | 0:830e074c92d5 | 36 | |
gume | 0:830e074c92d5 | 37 | /* |
gume | 0:830e074c92d5 | 38 | |
gume | 0:830e074c92d5 | 39 | uint8_t t15_counter; // a counter, where hi and low part counts separately, and one number is missing |
gume | 0:830e074c92d5 | 40 | // E.g: 64, 75, 86, 97, A8, B9, CA, DB, FC, 0D, 1E, 20, 31, 42, 53, 64 ... |
gume | 0:830e074c92d5 | 41 | // high bit counter tends to jump on key/ignition 'events' |
gume | 0:830e074c92d5 | 42 | // T15 |
gume | 0:830e074c92d5 | 43 | |
gume | 0:830e074c92d5 | 44 | 0: 00h engine off, 40h engine off (key is being inserted), 41h engine off (key in position 1 also this value when engine is stopped) |
gume | 0:830e074c92d5 | 45 | 45h engine running. (also key to position 2), 55h engine is turning on (from key or auto stop start) |
gume | 0:830e074c92d5 | 46 | 1: 00h key not in slot, 40h key in slot |
gume | 0:830e074c92d5 | 47 | 2[8765]: key||engine: clutch: 0x6/0x2, no key,no engine: 0xD |
gume | 0:830e074c92d5 | 48 | 2[4321]: 1: engine running, 2: ignition |
gume | 0:830e074c92d5 | 49 | 3[8]: engine running |
gume | 0:830e074c92d5 | 50 | 3[4321]: 1111 |
gume | 0:830e074c92d5 | 51 | 4: timer (1.4 sec) |
gume | 0:830e074c92d5 | 52 | |
gume | 0:830e074c92d5 | 53 | Sent in every 100ms |
gume | 0:830e074c92d5 | 54 | */ |