//============================================================================ // Name: // mki.h // // Summary: // A pretty simple class for controlling the parts // we can on the mercedes-combi-instrument // // Created on: // Okt 1, 2010 // // Author: // Christian Steiger //============================================================================ // includes #include "libcanio.h" // defines to make things easier, take a look at mkp.cpp // to see what they are doing exactly. // lamps on the display (mki::setLamps()) #define NONE 0x00 #define MKI_ABS 0x01 #define MKI_ESP 0x02 #define MKI_HANDBRAKE 0x04 #define MKI_ENGINE 0x08 #define MKI_WARN 0x10 #define MKI_WARN_BLINK 0x20 #define MKI_FUEL_LOW 0x40 // lcd display options (mki::setDisplay()) #define MKI_LIMIT 0x01 #define MKI_LIMIT_TEXT 0x02 #define MKI_PERMANENT 0x04 #define MKI_EXCEED 0x08 #define MKI_WINTER_TYRE 0x10 #define MKI_MPH_BLINK 0x10 #define MKI_NO_MPH 0x20 // warnings (mki::setAlert()) #define MKI_OIL_LOW 0x01 #define MKI_TIRE_PRESSURE 0x02 #define MKI_TIRE_DEFECT 0x04 // class definition class mki { public: // constructor and destructor mki(); ~mki(); // various methods, see mki.cpp for descriptions int connect( const char* const interface ); void setLamps( const unsigned int lamps); void setLampsOff(void); void setRpm( const unsigned short rpm ); void setMph( const unsigned char mph ); void setCWTemp( const unsigned char temp ); void setDisplayMph( const unsigned char mph ); void setDisplay( const unsigned int flags ); void setAlert( const unsigned int problem ); void sendData(void); void setKmh ( const unsigned char kmh ); void setDisplayKmh ( const unsigned char kmh ); // dont rely to heavily on this, it should be removed asap. CanIO* getInterface(void); protected: // class members CanIO m_can; unsigned char m_alert; can_frame m_can_id_200; can_frame m_can_id_208; can_frame m_can_id_210; can_frame m_can_id_308; can_frame m_can_id_312; can_frame m_can_id_550; can_frame m_can_id_608; };