Skip to content

Commit

Permalink
doc(VERSION): update to 4.3.0 (2023-02-15)
Browse files Browse the repository at this point in the history
Signed-off-by: itas109 <itas109@qq.com>
  • Loading branch information
itas109 committed Feb 15, 2023
1 parent 98593ca commit a001f2a
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 14 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
# CSerialPort Changelog


---

## v4.3.0 (2023-02-15)

Feature:
* readEvent replace with CSerialPortListener 使用CSerialPortListener进行读取事件通知
* replace std::string with const char* as much as possible 尽可能使用const char*代替std::string
* add function getReadBufferUsedLen() to get used buffer length 增加getReadBufferUsedLen函数用于获取缓冲区长度
* add LOG_INFO to output CSerialPort info 增加LOG_INFO输出串口信息

## v4.2.2 (2023-02-15)

Feature:
* read event notify with portName and readBufferLen 读取事件通知支持串口名称与长度
* add function getReadBufferUsedLen() to get used buffer length 增加getReadBufferUsedLen函数用于获取缓冲区长度
* add LOG_INFO to output CSerialPort info 增加LOG_INFO输出串口信息

## v4.2.1 (2022-11-07)

Feature:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ CSerialPort was tested on the following platforms

# Latest version

## Version: 4.2.1.221107
by itas109 on 2022-11-07
## Version: 4.3.0.230215
by itas109 on 2023-02-15

# Quick Start

Expand All @@ -75,7 +75,7 @@ run demo ( for example serial port lookback test on linux)

```
CSerialPort/bin $ ./bin/CSerialPortDemoNoGui
Version: https://github.com/itas109/CSerialPort - V4.2.1.221107
Version: https://github.com/itas109/CSerialPort - V4.3.0.230215
availableFriendlyPorts:
1 - /dev/ttyS0
Expand Down
6 changes: 3 additions & 3 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ CSerialPort已经在以下平台做过测试

# Latest version 最新版本

## Version: 4.2.1.221107
by itas109 on 2022-11-07
## Version: 4.3.0.230215
by itas109 on 2023-02-15

# Quick Start 快速开始

Expand All @@ -76,7 +76,7 @@ $ cmake --build .

```
CSerialPort/bin $ ./bin/CSerialPortDemoNoGui
Version: https://github.com/itas109/CSerialPort - V4.2.1.221107
Version: https://github.com/itas109/CSerialPort - V4.3.0.230215
availableFriendlyPorts:
1 - /dev/ttyS0
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.1.221107
4.3.0.230215
Binary file modified doc/CSerialPort_doc_cn.chm
Binary file not shown.
Binary file modified doc/CSerialPort_doc_en.chm
Binary file not shown.
2 changes: 1 addition & 1 deletion include/CSerialPort/SerialPort_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define __CSERIALPORT_VERSION_H__

#define CSERIALPORT_COPYRIGHT "Copyright (C) 2014 itas109. All Rights Reserved."
#define CSERIALPORT_VERSION "4.2.1.221107"
#define CSERIALPORT_VERSION "4.3.0.230215"
#define CSERIALPORT_VERSION_MAJOR 4
#define CSERIALPORT_VERSION_MINOR 2
#define CSERIALPORT_VERSION_PATCH 1
Expand Down
52 changes: 49 additions & 3 deletions test/CSerialPortVirtual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#ifdef _WIN32
#include <Windows.h>
#include <tchar.h> // _T
#include <tchar.h> //_T
#else
#include <errno.h> // perror
#include <pty.h> // openpty
Expand All @@ -24,7 +24,30 @@ CSerialPortVirtual::~CSerialPortVirtual() {}
bool CSerialPortVirtual::createPair(char *portName1, char *portName2)
{
#ifdef _WIN32
return false;
bool ret = false;
HINSTANCE libInst;

if (8 == sizeof(char *)) // 64bit application
{
libInst = LoadLibrary(_T("VSPDCTL64.DLL"));
}
else
{
libInst = LoadLibrary(_T("VSPDCTL.DLL"));
}

if (libInst)
{
typedef bool(__stdcall * CreatePairFn)(char *Port1, char *Port2);
CreatePairFn CreatePair = (CreatePairFn)GetProcAddress(libInst, "CreatePair");
if (CreatePair)
{
ret = CreatePair(portName1, portName2); // portName1 = "COM1", portName2 = "COM2"
}
FreeLibrary(libInst);
}

return ret;
#else
int error = -1;

Expand Down Expand Up @@ -109,7 +132,30 @@ bool CSerialPortVirtual::createPair(char *portName1, char *portName2)
bool itas109::CSerialPortVirtual::deletePair(char *portName)
{
#ifdef _WIN32
return false;
bool ret = false;
HINSTANCE libInst;

if (8 == sizeof(char *)) // 64bit application
{
libInst = LoadLibrary(_T("VSPDCTL64.DLL"));
}
else
{
libInst = LoadLibrary(_T("VSPDCTL.DLL"));
}

if (libInst)
{
typedef bool(__stdcall * DeletePairFn)(char *Port1);
DeletePairFn DeletePair = (DeletePairFn)GetProcAddress(libInst, "DeletePair");
if (DeletePair)
{
ret = DeletePair(portName);
}
FreeLibrary(libInst);
}

return ret;
#else
return true;
#endif
Expand Down
5 changes: 3 additions & 2 deletions test/CSerialPortVirtual.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ class CSerialPortVirtual
CSerialPortVirtual();
~CSerialPortVirtual();

static bool createPair(char *portName1, char *portName2);
static bool deletePair(char *portName);
static bool createPair(char* portName1, char* portName2);
static bool deletePair(char* portName);

private:

};
} // namespace itas109
#endif //__CSERIALPORT_VIRTUAL_H__

0 comments on commit a001f2a

Please sign in to comment.