Example Code - Bolymin BETA903A User Manual

Mobile data terminal
Table of Contents

Advertisement

4.3.3.

Example code

Bolymin provides a test application and its source code for example. The following
picture is the screen shot of the serial port test program:
Data will be sent by
selected serial port
Send data
The major part of source codes of the test program is shown below:
File: SerialPortDlg.cpp
/////////////////////////////////////////////////////////////////////////////
// CSerialPortDlg dialog
/////////////////////////////////////////////////////////////////////////////
const UINT WM_CMD_OK = WM_USER+1;
BEGIN_MESSAGE_MAP(CSerialPortDlg, CDialog)
//{{AFX_MSG_MAP(CSerialPortDlg)
ON_BN_CLICKED(IDC_OPEN_COM, OnOpenCom)
ON_BN_CLICKED(IDC_CLOSE_COM, OnCloseCom)
ON_BN_CLICKED(IDC_SEND, OnSend)
ON_BN_CLICKED(IDC_CLEAR_SEND, OnClearSend)
ON_BN_CLICKED(IDC_CLEAR_REC, OnClearRec)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_CMD_OK, OnCommRecv)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSerialPortDlg message handlers
/////////////////////////////////////////////////////////////////////////////
BETA903A USER MANUAL
Received data
Clear sent data.
Clear received data
Open/Close
selected serial port.
Clear received data
Define a receive message
Map the receive message
processing function to user
defined message.
- 67 -

Advertisement

Table of Contents
loading

Table of Contents