*/
enum sp_return sp_drain(struct sp_port *port);
+/**
+ * @}
+ * @defgroup Signal Port signalling operations
+ * @{
+ */
+
+/**
+ * Put the port transmit line into the break state.
+ *
+ * @return SP_OK on success, SP_ERR_FAIL on failure, or SP_ERR_ARG
+ * if an invalid port is passed.
+ */
+enum sp_return sp_start_break(struct sp_port *port);
+
+/**
+ * Take the port transmit line out of the break state.
+ *
+ * @return SP_OK on success, SP_ERR_FAIL on failure, or SP_ERR_ARG
+ * if an invalid port is passed.
+ */
+enum sp_return sp_end_break(struct sp_port *port);
+
/**
* @}
* @defgroup Errors Obtaining error information
return SP_OK;
}
+enum sp_return sp_start_break(struct sp_port *port)
+{
+ CHECK_PORT();
+#ifdef _WIN32
+ if (SetCommBreak(port->hdl) == 0)
+ return SP_ERR_FAIL;
+#else
+ if (ioctl(port->fd, TIOCSBRK, 1) < 0)
+ return SP_ERR_FAIL;
+#endif
+
+ return SP_OK;
+}
+
+enum sp_return sp_end_break(struct sp_port *port)
+{
+ CHECK_PORT();
+#ifdef _WIN32
+ if (ClearCommBreak(port->hdl) == 0)
+ return SP_ERR_FAIL;
+#else
+ if (ioctl(port->fd, TIOCCBRK, 1) < 0)
+ return SP_ERR_FAIL;
+#endif
+
+ return SP_OK;
+}
+
int sp_last_error_code(void)
{
#ifdef _WIN32