Moxa TC-6110-T-W7E [52/74] Gpsdatasize null

Moxa TC-6110-CT-T-W7E [52/74] Gpsdatasize null
TC-6110 / Windows 7 Customizable Sample Code
5-8
9. To allow the GPS to communicate with other programs, follow these steps:
Step1: Use the
CreateFile()API to open the GPS COM port (in the example below, we are using the
default port, COM3).
HANDLE handlePort = CreateFile("COM3",
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
0,
NULL);
Step2: Use the ReadFile() API to read GPS data from the COM port.
ReadFile(handlePort,
inputData,
inputDataSize,
gpsData,
&gpsDataSize,
NULL);
Step3: To parse the GPS data into another program, use the gpsData variable that was created in
Step 2. The data should look something like the example provided below:
Step4: Use the
CloseHandle() API to close the GPS COM port.

Содержание

Похожие устройства

Скачать