forked from SlightlyLoony/gpsctl
-
Notifications
You must be signed in to change notification settings - Fork 5
/
sl_serial.h
30 lines (24 loc) · 1.09 KB
/
sl_serial.h
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
//
// Created by Tom Dilatush on 10/22/17.
//
#ifndef GPSCTL_SL_SERIAL_H
#define GPSCTL_SL_SERIAL_H
#include <stdbool.h>
#include "sl_return.h"
typedef slReturn baudRateSynchronizer( int fdPort, int maxTimeMs, int verbosity );
typedef struct speedInfo {
int baudRate; // baud rate (in bits/second)
int nsBit; // number of nanoseconds to receive or transmit a bit
int nsChar; // number of nanoseconds to receive or transmit a character
} speedInfo;
int getBaudRateCookie( int baudRate );
slReturn asciiBaudRateSynchronizer( int fdPort, int maxTimeMs, int verbosity );
slReturn autoBaudRate( int fdPort, int minBaud, baudRateSynchronizer synchronizer, int verbosity );
slReturn getSpeedInfo( int fdPort, speedInfo* );
slReturn verifySerialDevice( const char *deviceName );
slReturn readSerialChar( int fdPort, long long msTimeout );
slReturn getBaudRate( int cookie );
slReturn flushRx( int fdPort );
slReturn setTermOptions( int fdPort, int baud, int dataBits, int stopBits, bool parityEnable, bool odd );
slReturn setTermOptionsBaud( int fdPort, int baud );
#endif //GPSCTL_SL_SERIAL_H