diff --git a/drivers/serial/uart_bth4.c b/drivers/serial/uart_bth4.c index f5c68ee62f..eb204d00f0 100644 --- a/drivers/serial/uart_bth4.c +++ b/drivers/serial/uart_bth4.c @@ -351,7 +351,15 @@ out: static int uart_bth4_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { - return OK; + FAR struct inode *inode = filep->f_inode; + FAR struct uart_bth4_s *dev = inode->i_private; + + if (!dev->drv->ioctl) + { + return -ENOTTY; + } + + return dev->drv->ioctl(dev->drv, cmd, arg); } static int uart_bth4_poll(FAR struct file *filep, FAR struct pollfd *fds, diff --git a/include/nuttx/wireless/bluetooth/bt_driver.h b/include/nuttx/wireless/bluetooth/bt_driver.h index acea43bc3c..0947a4dd37 100644 --- a/include/nuttx/wireless/bluetooth/bt_driver.h +++ b/include/nuttx/wireless/bluetooth/bt_driver.h @@ -79,6 +79,11 @@ struct bt_driver_s enum bt_buf_type_e type, FAR void *data, size_t len); + /* Lower-half logic may support platform-specific ioctl commands */ + + CODE int (*ioctl)(FAR struct bt_driver_s *btdev, int cmd, + unsigned long arg); + /* Filled by register function, shouldn't be touched by bt_driver_s */ FAR void *priv;