You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2020/12/28 09:38:49 UTC

[incubator-nuttx] 01/06: bt_uart_shim: Correct the prototype of bt_uart_shim_getdevice

This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit aec3220fae4e933f9a1a5d90e571b4d80283f3d3
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Dec 27 02:53:32 2020 +0800

    bt_uart_shim: Correct the prototype of bt_uart_shim_getdevice
    
    1.Add const to the path argument
    2.Return the explicit type(struct btuart_lowerhalf_s *)
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 drivers/wireless/bluetooth/bt_uart_shim.c       | 5 ++---
 include/nuttx/wireless/bluetooth/bt_uart_shim.h | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/wireless/bluetooth/bt_uart_shim.c b/drivers/wireless/bluetooth/bt_uart_shim.c
index 8d9ac8f..4c92a85 100644
--- a/drivers/wireless/bluetooth/bt_uart_shim.c
+++ b/drivers/wireless/bluetooth/bt_uart_shim.c
@@ -58,7 +58,6 @@
 #include <nuttx/kthread.h>
 #include <nuttx/semaphore.h>
 #include <nuttx/serial/tioctl.h>
-#include <nuttx/wireless/bluetooth/bt_uart.h>
 #include <nuttx/wireless/bluetooth/bt_uart_shim.h>
 #include <termios.h>
 
@@ -431,7 +430,7 @@ static int hcicollecttask(int argc, FAR char **argv)
  *
  ****************************************************************************/
 
-FAR void *bt_uart_shim_getdevice(FAR char *path)
+FAR struct btuart_lowerhalf_s *bt_uart_shim_getdevice(FAR const char *path)
 {
   FAR struct hciuart_state_s *s;
   int ret;
@@ -474,5 +473,5 @@ FAR void *bt_uart_shim_getdevice(FAR char *path)
                                     CONFIG_BLUETOOTH_TXCONN_PRIORITY,
                                     1024, hcicollecttask, NULL);
 
-  return g_n;
+  return (FAR struct btuart_lowerhalf_s *)g_n;
 }
diff --git a/include/nuttx/wireless/bluetooth/bt_uart_shim.h b/include/nuttx/wireless/bluetooth/bt_uart_shim.h
index dcf94d2..536335f 100644
--- a/include/nuttx/wireless/bluetooth/bt_uart_shim.h
+++ b/include/nuttx/wireless/bluetooth/bt_uart_shim.h
@@ -41,8 +41,7 @@
  * Included Files
  ****************************************************************************/
 
-#include <nuttx/config.h>
-#include <nuttx/compiler.h>
+#include <nuttx/wireless/bluetooth/bt_uart.h>
 
 #ifdef CONFIG_BLUETOOTH_UART_SHIM
 
@@ -50,7 +49,7 @@
  * Public Function Prototypes
  ****************************************************************************/
 
-FAR void *bt_uart_shim_getdevice(FAR char *path);
+FAR struct btuart_lowerhalf_s *bt_uart_shim_getdevice(FAR const char *path);
 
 #endif
 #endif