From bdadbb8b01c9fd5ad2dbeb35e73f35f74d9f8f82 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Wed, 29 Apr 2015 15:51:07 -0600 Subject: [PATCH] uart: add fd (file descriptor) to uart context Signed-off-by: Jon Trulson Signed-off-by: Brendan Le Foll --- include/mraa_internal_types.h | 1 + src/uart/uart.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/mraa_internal_types.h b/include/mraa_internal_types.h index 41ed831..07d7b2a 100644 --- a/include/mraa_internal_types.h +++ b/include/mraa_internal_types.h @@ -92,6 +92,7 @@ struct _uart { /*@{*/ int index; /**< the uart index, as known to the os. */ char* path; /**< the uart device path. */ + int fd; /**< file descriptor for device. */ /*@}*/ }; diff --git a/src/uart/uart.c b/src/uart/uart.c index d3dc0d8..aba7b66 100644 --- a/src/uart/uart.c +++ b/src/uart/uart.c @@ -83,6 +83,7 @@ mraa_uart_init(int index) memset(dev, 0, sizeof(struct _uart)); dev->index = index; + dev->fd = -1; dev->path = (char*) plat->uart_dev[index].device_path; if (advance_func->uart_init_post != NULL) { mraa_result_t ret = advance_func->uart_init_post(dev);