本文整理汇总了C++中SerialPort::close方法的典型用法代码示例。如果您正苦于以下问题:C++ SerialPort::close方法的具体用法?C++ SerialPort::close怎么用?C++ SerialPort::close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SerialPort
的用法示例。
在下文中一共展示了SerialPort::close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _tWinMain
int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPTSTR lpCmdLine,
_In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;
//Controller cController(0x1, &g_cModbus); /*< Controller object */
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_MOUSECONTROLLER, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
// Perform HW initialization:
if (!InitHardware())
{
return FALSE;
}
g_cController = new Controller(1, &g_cModbus);
g_cController->setSerialPort(&g_cSerialPort);
/// Setup GUI callbacks
g_cController->setGuiCallback(updateVector);
g_cController->setTraceCallback(updateConsole);
/// Start controller thread
g_cController->start();
hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_MOUSECONTROLLER));
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
g_cController->terminate();
g_cSerialPort.close();
return (int) msg.wParam;
}