uart: add tcsendbreak support
Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
This commit is contained in:
committed by
Alex Tereschenko
parent
6d5b2c0642
commit
e0a0dac47b
@@ -323,6 +323,27 @@ mraa_uart_flush(mraa_uart_context dev)
|
||||
return MRAA_SUCCESS;
|
||||
}
|
||||
|
||||
mraa_result_t
|
||||
mraa_uart_sendbreak(mraa_uart_context dev, int duration)
|
||||
{
|
||||
if (!dev) {
|
||||
syslog(LOG_ERR, "uart: sendbreak: context is NULL");
|
||||
return MRAA_ERROR_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (IS_FUNC_DEFINED(dev, uart_sendbreak_replace)) {
|
||||
return dev->advance_func->uart_sendbreak_replace(dev, duration);
|
||||
}
|
||||
|
||||
#if !defined(PERIPHERALMAN)
|
||||
if (tcsendbreak(dev->fd, duration) == -1) {
|
||||
return MRAA_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
#endif
|
||||
|
||||
return MRAA_SUCCESS;
|
||||
}
|
||||
|
||||
mraa_result_t
|
||||
mraa_uart_set_baudrate(mraa_uart_context dev, unsigned int baud)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user