первый

This commit is contained in:
2024-11-01 12:23:13 +05:00
parent 801d9d33fa
commit 0688c46a7e
226 changed files with 162921 additions and 0 deletions

29
devices/Port.h Normal file
View File

@ -0,0 +1,29 @@
//---------------------------------------------------------------------------
#ifndef CPortH
#define CPortH
//---------------------------------------------------------------------------
class Port
{
public:
virtual ~Port(){};
/*bool Open(std::string ComNumber);
bool Open(std::wstring ComNumber);
//bool setBaudRate();
bool SetTimeout(unsigned long time); //Сколько ждать данных (Для чтения и запииси)
*/
virtual bool Close()=0; //Разорвать связь
virtual bool isOpen()=0; //Проверить приконектин ли
//bool Setup(int num = -1); //Настройка параметров ком порта
virtual unsigned long Write(const void* lpBuffer,unsigned long nNumberOfBytesToWrite)=0;
//unsigned long WriteString(std::string str);
virtual unsigned char WriteChar(signed char ch)=0;
virtual unsigned char WriteUChar(unsigned char ch)=0;
virtual unsigned char WriteUInt(unsigned int val)=0;
virtual int Read(void* lpBuffer,unsigned long nNumberOfBytesToRead)=0;
virtual int ReadAll(void* lpBuffer, unsigned long nNumberOfBytesToRead) = 0; //Так как может выдавать инфу порциями
//unsigned char ReadUInt1(bool* b);
};
//---------------------------------------------------------------------------
#endif