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);