-
Notifications
You must be signed in to change notification settings - Fork 4
/
serial.h
44 lines (37 loc) · 1010 Bytes
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* File: serial.h
* Author: Mark Furneaux
* Copyright: 2014 Romaco Canada, Mark Furneaux
*
* Created on December 27, 2014, 10:06 PM
*
* This file is part of PSUControl.
*/
#ifndef SERIAL_H
#define SERIAL_H
#ifdef __cplusplus
extern "C" {
#endif
extern double maxVoltage;
extern double maxCurrent;
extern bool outputOn;
extern double currVoltage;
extern double currCurrent;
extern double currentDivider;
bool getSerialPort(char* portAddr);
int set_interface_attribs(int fd, speed_t speed, int parity);
bool isOK(const char* recvBuff);
std::string readData(int fd);
void getSettings(int fd);
int sendData(int fd, const char* data);
void getCurrent(int fd);
bool getOutputStatus(int fd);
void setVoltage(int fd, double voltage);
void setCurrent(int fd, double current);
void toggleRemote(int fd);
void setOutput(int fd, bool on);
void getDeviceCapabilities(int fd);
#ifdef __cplusplus
}
#endif
#endif /* SERIAL_H */