-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserial.h
More file actions
34 lines (27 loc) · 921 Bytes
/
serial.h
File metadata and controls
34 lines (27 loc) · 921 Bytes
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
/*
* serial.h
*
* Created on: Dec 5, 2012
* Author: cyberwizzard
*/
#ifndef SERIAL_H_
#define SERIAL_H_
int serial_open();
void serial_close();
int serial_cmd(const char *cmd, char **reply, bool keepall = false);
//int serial_cmd(const char *cmd);
/**
* When the printer reboots (when the serial port is opened and reset), it will send a
* starting banner. For example Teacup starts with "start" followed by "ok".
* Using this function we wait for that unsolicited 'ok' before continuing.
* @param flush Flush the current serial buffer before waiting for 'ok'
* @param timeout Timeout in seconds before canceling the wait
*/
int serial_waitforok(bool flush, int timeout);
/**
* Set DTR (Data Transfer Ready) to low and high again - this simulates a modem
* hangup and should power cycle the printer on the other end.
*/
void set_reset_dtr();
void serial_verbose(bool b);
#endif /* SERIAL_H_ */