##// END OF EJS Templates
fixed bug on Parity hndling under linux!
fixed bug on Parity hndling under linux!

File last commit:

r25:ffb9425c0576 alexis
r25:ffb9425c0576 alexis
Show More
RS232.h
43 lines | 1.5 KiB | text/x-c | CLexer
Use Autotools and libtools now /!\ unstable, Win port not ready
r3 // SOPSUYSI_RS232.h
jeandet@pc-de-jeandet3.lab-lpp.local
fixed bug on Parity hndling under linux!
r25 #ifndef RS232_H
#define RS232_H
yannic
Improved linux support
r11 #define debug
yannic
Included Config file for setup.
r7 #include "rs232config.h"
jeandet@PC-DE-JEANDET.lpp.polytechnique.fr
fixed some read bugs (under windows)
r8
jeandet@PC-DE-JEANDET.lpp.polytechnique.fr
Win/Unix portability completed, need to be tested.
r5 #ifdef HAVE_WINDOWS_H
#include <windows.h>
jeandet@PC-DE-JEANDET.lpp.polytechnique.fr
fixed some read bugs (under windows)
r8 #define badPortValue INVALID_HANDLE_VALUE
jeandet@PC-DE-JEANDET.lpp.polytechnique.fr
Win/Unix portability completed, need to be tested.
r5 typedef HANDLE rs232port_t;
typedef DWORD rs232speed_t;
jeandet@PC-DE-JEANDET.lpp.polytechnique.fr
fixed some read bugs (under windows)
r8 typedef enum {rs232OneStop=ONESTOPBIT,rs232One5Stop=ONE5STOPBITS,rs232TwoStop=TWOSTOPBITS}rs232stop;
jeandet@PC-DE-JEANDET.lpp.polytechnique.fr
Win/Unix portability completed, need to be tested.
r5 typedef enum {rs232parityNo=NOPARITY,rs232parityOdd=ODDPARITY,rs232parityEven=EVENPARITY}rs232parity;
jeandet@PC-DE-JEANDET.lpp.polytechnique.fr
fixed some read bugs (under windows)
r8 #else
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#define badPortValue -1
typedef int rs232port_t;
typedef speed_t rs232speed_t;
typedef enum {rs232OneStop=1,rs232One5Stop=2,rs232TwoStop=2}rs232stop;
jeandet@pc-de-jeandet3.lab-lpp.local
fixed bug on Parity hndling under linux!
r25 typedef enum {rs232parityNo,rs232parityOdd,rs232parityEven}rs232parity;
jeandet@PC-DE-JEANDET.lpp.polytechnique.fr
fixed some read bugs (under windows)
r8 #endif
jeandet@PC-DE-JEANDET.lpp.polytechnique.fr
Win/Unix portability completed, need to be tested.
r5 #endif
jeandet@PC-DE-JEANDET.lpp.polytechnique.fr
fixed some read bugs (under windows)
r8 #ifdef __cplusplus
#define rs232extern extern "C"
#else
#define rs232extern extern
#endif
rs232extern rs232port_t rs232open(char* psPortName);
rs232extern int rs232close(rs232port_t fd);
rs232extern int rs232setup(rs232port_t fd, int ChSize, int BaudeRate, rs232parity Parity, rs232stop NbStop);
rs232extern int rs232write(rs232port_t fd,char *psWrite, int WriteBufferSize);
rs232extern int rs232read(rs232port_t fd,char *psRead, int ReadBufferSize);
rs232extern int rs232setparity(rs232port_t fd, rs232parity Parity);
rs232extern int rs232setnbstop(rs232port_t fd, rs232stop NbStop);
rs232extern int rs232setcsize(rs232port_t fd, int ChSize);
rs232extern int rs232setbaudrate(rs232port_t fd, int baudrate);
jeandet@pc-de-jeandet3.lab-lpp.local
fixed bug on Parity hndling under linux!
r25
#endif