-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserial.h
More file actions
21 lines (18 loc) · 754 Bytes
/
serial.h
File metadata and controls
21 lines (18 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef _SERIAL_H_
#define _SERIAL_H_
#include "dll.h"
#ifdef _MSC_VER
#define OUTPARAM _Out_
#define INPARAM _In_
#else
#define OUTPARAM
#define INPARAM
#endif
DllExport int isSerialPortPresent(const char* name);
DllExport int getSerialPorts(OUTPARAM unsigned int* count, OUTPARAM char*** portnames);
DllExport int openport(const char* portname, /*@out@*/ void** com_port);
DllExport size_t write_serial(void* com_port, unsigned char* data, size_t datalen);
DllExport size_t read_serial(void* com_port, /*@out@*/ unsigned char* data, size_t datalen);
DllExport size_t write_verify_read(void* com_port, unsigned char* in, size_t inlen, /*@out@*/ unsigned char* out, size_t outlen);
DllExport int closeport(void* com_port);
#endif