//////////////////////////////////////////////////////////////////////////////// /*! @file CommandParser.h MSDN command parser. - Part of the MSDN firmware. - Part of the Research Assistant project. - Copyright(C) 2016, Viktor E. Bursian, St.Petersburg, Russia. Viktor.Bursian@mail.ioffe.ru */////////////////////////////////////////////////////////////////////////////// #ifndef CommandParser_H #define CommandParser_H #include //------------------------------------------------------------------------------ // The following functions have to be defined somewhere // in the device-specific module(s) //------------------------------------------------------------------------------ /*! Execute a device-specific command, having no argument. */ int8_t ExecuteCommand0 (const char command); /*! Execute a device-specific command, having 1 or 2 hexadecimal digits as an argument. */ int8_t ExecuteCommand2 (const char command ,const uint8_t argument); /*! Execute a device-specific command, having 3 or 4 hexadecimal digits as an argument. */ int8_t ExecuteCommand4 (const char command ,const uint16_t argument); /*! Execute a device-specific command, having 5 to 8 hexadecimal digits as an argument. */ int8_t ExecuteCommand8 (const char command ,const uint32_t argument); //------------------------------------------------------------------------------ /*! @fn ExecuteCommand0(const char command) @param command A char from 0x21 to 0x7F, excluding '?' and ':'. @return An error number: - 0 - everything fine; - 1 - no such command; - 2..9 - device-specific. @note It is not defined in CommandParser.c and has to be defined somewhere in the device-specific module(s). */ /*! @fn ExecuteCommand2(const char command ,const uint16_t argument) @param command A char from 0x21 to 0x7F, excluding '?' and ':'. @param argument The argument, interpreted as uint8_t. @return An error number: - 0 - everything fine; - 1 - no such command; - 2..9 - device-specific. @note It is not defined in CommandParser.c and has to be defined somewhere in the device-specific module(s). */ /*! @fn ExecuteCommand4(const char command ,const uint16_t argument) @param command A char from 0x21 to 0x7F, excluding '?' and ':'. @param argument The argument, interpreted as uint16_t. @return An error number: - 0 - everything fine; - 1 - no such command; - 2..9 - device-specific. @note It is not defined in CommandParser.c and has to be defined somewhere in the device-specific module(s). */ /*! @fn ExecuteCommand8(const char command ,const uint32_t argument) @param command A char from 0x21 to 0x7F, excluding '?' and ':'. @param argument The argument, interpreted as uint32_t. @return An error number: - 0 - everything fine; - 1 - no such command; - 2..9 - device-specific. @note It is not defined in CommandParser.c and has to be defined somewhere in the device-specific module(s). */ //------------------------------------------------------------------------------ #endif