fp@922: /***************************************************************************** fp@922: * fp@922: * $Id$ fp@922: * fp@922: ****************************************************************************/ fp@922: fp@922: #ifndef __EC_MASTER_H__ fp@922: #define __EC_MASTER_H__ fp@922: fp@922: #include fp@922: using namespace std; fp@922: fp@922: /****************************************************************************/ fp@922: fp@922: class MasterException: fp@922: public runtime_error fp@922: { fp@922: public: fp@922: /** Constructor with std::string parameter. */ fp@922: MasterException( fp@922: const string &s /**< Message. */ fp@922: ): runtime_error(s) {} fp@922: fp@922: /** Constructor with const char pointer parameter. */ fp@922: MasterException( fp@922: const char *s /**< Message. */ fp@922: ): runtime_error(s) {} fp@922: }; fp@922: fp@922: /****************************************************************************/ fp@922: fp@922: class Master fp@922: { fp@922: public: fp@922: Master(); fp@922: ~Master(); fp@922: fp@922: void open(unsigned int); fp@922: void close(); fp@922: fp@922: unsigned int slaveCount(); fp@922: void listSlaves(); fp@922: fp@922: protected: fp@922: string slaveState(uint8_t) const; fp@922: fp@922: private: fp@922: unsigned int index; fp@922: int fd; fp@922: }; fp@922: fp@922: /****************************************************************************/ fp@922: fp@922: #endif