-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcom.h
More file actions
49 lines (40 loc) · 1.05 KB
/
Copy pathcom.h
File metadata and controls
49 lines (40 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* @file com.h
* @brief Serial port communication and device discovery.
* @license MIT
* @copyright Copyright (c) 2025 Bashkardin Pavel
*/
#ifndef COM_H
#define COM_H
#include <windows.h>
typedef struct {
char portName[16];
char instanceId[256];
char friendlyName[256];
} DisplayDevice;
/**
* @brief Enumerate all displays with given instance signature.
* @param devices Array of DisplayDevice (user allocates).
* @param maxDevices Max number of devices to fill.
* @param signature Substring to match in instance path (e.g., "S142T16").
* @return Number of devices found.
*/
int EnumerateDisplays(DisplayDevice* devices, int maxDevices, const char* signature);
/**
* @brief Open COM port.
* @return HANDLE or NULL.
*/
HANDLE OpenComPort(const char* port);
/**
* @brief Configure port (8N1).
*/
BOOL SetupComPort(HANDLE hCom, DWORD baudRate);
/**
* @brief Send text.
*/
void SendText(HANDLE hCom, const char* text);
/**
* @brief Close port.
*/
void CloseComPort(HANDLE hCom);
#endif