diff options
| author | Tero Kontkanen <tero.k@granitedevices.fi> | 2016-12-29 18:36:22 +0200 |
|---|---|---|
| committer | Tero Kontkanen <tero.k@granitedevices.fi> | 2016-12-29 18:49:47 +0200 |
| commit | 6ce53fb1222a91d3e709e4a604a44a8ca33bc00c (patch) | |
| tree | a6d28e08fb9595c4158a83a91e41fb1dea0a02a0 /pcserialport.h | |
| parent | 1f976e7371a1da4d2b7d3e33587f6c03c33c9eed (diff) | |
| download | SimpleMotionV2-6ce53fb1222a91d3e709e4a604a44a8ca33bc00c.tar.gz SimpleMotionV2-6ce53fb1222a91d3e709e4a604a44a8ca33bc00c.zip | |
Replaced RS232 library by customized code, not tested yet (win or linux)
Diffstat (limited to 'pcserialport.h')
| -rw-r--r-- | pcserialport.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/pcserialport.h b/pcserialport.h new file mode 100644 index 0000000..832786d --- /dev/null +++ b/pcserialport.h @@ -0,0 +1,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 + + |
