Hauptseite | Klassenhierarchie | Alphabetische Liste | Auflistung der Klassen | Auflistung der Dateien | Klassen-Elemente

# rcvbuffer.hpp

    00001
    00012 #ifndef RCVBUFFER_H
    00013    #define RCVBUFFER_H
    00014
    00015    #include "commandstring.hpp"
    00016
    00019    enum RECEIVED_TYPE
    00020    {
    00021       NONE,
    00022       CONNECT,
    00023       DISCONNECT,
    00024       READ_EEPROM_REQ,
    00025       READ_EEPROM_CNF,
    00026       READ_PROGRAM_REQ,
    00027       READ_PROGRAM_CNF,
    00028       READ_RAM_REQ,
    00029       READ_RAM_CNF,
    00030       WRITE_EEPROM_REQ,
    00031       WRITE_EEPROM_CNF,
    00032       WRITE_PROGRAM_REQ,
    00033       WRITE_PROGRAM_CNF,
    00034       WRITE_RAM_REQ,
    00035       WRITE_RAM_CNF,
    00036       STATUS_INFORMATION
    00037    };
    00038
    00043    class CRcvBuffer
    00044    {
    00045       public:
    00048          CRcvBuffer();
    00049
    00052          CRcvBuffer( const CRcvBuffer& OldObject );
    00053
    00056          virtual ~CRcvBuffer();
    00057
    00060          CRcvBuffer& operator = (const CRcvBuffer& NewObject );
    00061
    00068          DWORD GetTimeOut( void ) const;
    00069
    00076          void  SetTimeOut( const DWORD dwNewTimeOut );
    00077
    00082          RECEIVED_TYPE GetCommand( void ) const;
    00083
    00088          void          SetCommand( RECEIVED_TYPE NewCommand );
    00089
    00094          ADDRESS_TYPE               GetAddress( void ) const;
    00095
    00100          unsigned int               GetLength( void ) const;
    00101
    00106          std::vector<unsigned char> GetData( void ) const;
    00107
    00112          void                       SetAddress( const ADDRESS_TYPE nAddress );
    00113
    00118          void                       SetLength( const unsigned int uiLength );
    00119
    00124          void                       SetData( const std::vector<unsigned char>& aucData );
    00125
    00131          bool BeginDataTransfer( void ) const;
    00132
    00138          bool EndDataTransfer(   void ) const;
    00139
    00148          bool StoreData( const RECEIVED_TYPE Command,
    00149                          const ADDRESS_TYPE  nAddress,
    00150                          const unsigned int  uiLength,
    00151                          const std::vector<unsigned char>& aucData= std::vector<unsigned char>::vector() );
    00152
    00161          bool FetchData( RECEIVED_TYPE& Command,
    00162                          ADDRESS_TYPE& nAddress,
    00163                          unsigned int& uiLength,
    00164                          std::vector<unsigned char>& aucData );
    00165       protected:
    00166       private:
    00168          HANDLE m_hDataLock;
    00169
    00171          ADDRESS_TYPE               m_nAddress;
    00172
    00174          unsigned int               m_uiLength;
    00175
    00177          std::vector<unsigned char> m_aucData;
    00178
    00180          RECEIVED_TYPE              m_RcvCommand;
    00181
    00183          DWORD m_dwTimeOut;
    00184    };
    00185 #endif