blob: 832786dbc43e0e137a9c955d1057d191330f99f4 (
plain)
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
|
/*
* pcserialport.h
*
* Header for PC serial port access library (win/linux)
*
* Created on: 28.12.2016
* Author: Tero
*
* Inspired by RS232 library by Teunis van Beelen
*/
/* Todo:
-Restore port settings at CloseComport
*/
#ifndef PCSERAILPORT_H
#define PCSERAILPORT_H
#ifdef __cplusplus
extern "C" {
#endif
#include "simplemotion.h"
//return port handle or -1 if fails
smint32 serialPortOpen(const char *port_device_name, smint32 baudrate_bps);
smint32 serialPortRead(smint32 serialport_handle, unsigned char *buf, smint32 size);
smint32 serialPortWriteByte(smint32 serialport_handle, unsigned char byte);
smint32 serialPortWriteBuffer(smint32 serialport_handle, unsigned char *buf, smint32 size);
void serialPortClose(smint32 serialport_number);
#ifdef __cplusplus
}
#endif
#endif
|