完成设置页面和退出页面,开卡页面的画图
This commit is contained in:
43
readerAPI.h
Normal file
43
readerAPI.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#ifndef READERAPI_H
|
||||
#define READERAPI_H
|
||||
|
||||
#include <HF15693.h>
|
||||
|
||||
|
||||
class Reader
|
||||
{
|
||||
private:
|
||||
int comNumber = -1; // com口号,若未连接为-1
|
||||
|
||||
public:
|
||||
bool is_connected()
|
||||
{
|
||||
return comNumber > 0;
|
||||
}
|
||||
|
||||
bool connectReader()
|
||||
{
|
||||
if (t15portOpen(comNumber))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
comNumber = -1;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void setComNumber(int comNumber)
|
||||
{
|
||||
this->comNumber = comNumber;
|
||||
}
|
||||
|
||||
int getComNumber()
|
||||
{
|
||||
return comNumber;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // READERAPI_H
|
||||
Reference in New Issue
Block a user