board/sim: Support NuttX BLE stack through uart shim driver
and add new btuart config to test it Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
d2f9544556
commit
503780497a
@ -545,6 +545,7 @@ config SIM_HCITTY
|
||||
bool "Attach Host Bluetooth As TTY Device"
|
||||
default false
|
||||
depends on (DRIVERS_BLUETOOTH && HOST_LINUX && SIM_WALLTIME)
|
||||
select BLUETOOTH_UART_SHIM if BLUETOOTH_UART
|
||||
---help---
|
||||
Attached the local bluetooth device to the simulation
|
||||
target via HCI_CHANNEL_USER. This gives NuttX full
|
||||
|
74
boards/sim/sim/sim/configs/btuart/defconfig
Normal file
74
boards/sim/sim/sim/configs/btuart/defconfig
Normal file
@ -0,0 +1,74 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_NET_ETHERNET is not set
|
||||
# CONFIG_NET_IPv4 is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
CONFIG_ARCH="sim"
|
||||
CONFIG_ARCH_BOARD="sim"
|
||||
CONFIG_ARCH_BOARD_SIM=y
|
||||
CONFIG_ARCH_CHIP="sim"
|
||||
CONFIG_ARCH_SIM=y
|
||||
CONFIG_BLUETOOTH_MAX_CONN=2
|
||||
CONFIG_BLUETOOTH_MAX_PAIRED=2
|
||||
CONFIG_BLUETOOTH_SMP_SELFTEST=y
|
||||
CONFIG_BLUETOOTH_UART=y
|
||||
CONFIG_BOARDCTL_POWEROFF=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=0
|
||||
CONFIG_BOOT_RUNFROMEXTSRAM=y
|
||||
CONFIG_BTSAK=y
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_DEV_LOOP=y
|
||||
CONFIG_DEV_ZERO=y
|
||||
CONFIG_DRIVERS_BLUETOOTH=y
|
||||
CONFIG_DRIVERS_WIRELESS=y
|
||||
CONFIG_EXAMPLES_HELLO=y
|
||||
CONFIG_FAT_LCNAMES=y
|
||||
CONFIG_FAT_LFN=y
|
||||
CONFIG_FSUTILS_PASSWD=y
|
||||
CONFIG_FSUTILS_PASSWD_READONLY=y
|
||||
CONFIG_FS_FAT=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_FS_ROMFS=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=4096
|
||||
CONFIG_LIBC_EXECFUNCS=y
|
||||
CONFIG_LIB_ENVPATH=y
|
||||
CONFIG_LIB_HOSTNAME="NuttX-SIM"
|
||||
CONFIG_MAX_TASKS=64
|
||||
CONFIG_NET=y
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_NETDEV_LATEINIT=y
|
||||
CONFIG_NETDEV_WIRELESS_IOCTL=y
|
||||
CONFIG_NETINIT_NETLOCAL=y
|
||||
CONFIG_NET_BLUETOOTH=y
|
||||
CONFIG_NET_STATISTICS=y
|
||||
CONFIG_NFILE_DESCRIPTORS=32
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_ARCHROMFS=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_FATDEVNO=2
|
||||
CONFIG_NSH_FILE_APPS=y
|
||||
CONFIG_NSH_READLINE=y
|
||||
CONFIG_NSH_ROMFSDEVNO=1
|
||||
CONFIG_NSH_ROMFSETC=y
|
||||
CONFIG_PATH_INITIAL="/bin"
|
||||
CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=2048
|
||||
CONFIG_PREALLOC_MQ_MSGS=64
|
||||
CONFIG_READLINE_TABCOMPLETION=y
|
||||
CONFIG_SCHED_HAVE_PARENT=y
|
||||
CONFIG_SCHED_ONEXIT=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_SIM_HCITTY=y
|
||||
CONFIG_START_DAY=3
|
||||
CONFIG_START_MONTH=4
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_USERMAIN_STACKSIZE=4096
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_WIRELESS=y
|
||||
CONFIG_WIRELESS_BLUETOOTH=y
|
@ -37,8 +37,8 @@
|
||||
#include <nuttx/video/fb.h>
|
||||
#include <nuttx/timers/oneshot.h>
|
||||
#include <nuttx/wireless/pktradio.h>
|
||||
#include <nuttx/wireless/bluetooth/bt_driver.h>
|
||||
#include <nuttx/wireless/bluetooth/bt_null.h>
|
||||
#include <nuttx/wireless/bluetooth/bt_uart_shim.h>
|
||||
#include <nuttx/wireless/ieee802154/ieee802154_loopback.h>
|
||||
#include <nuttx/i2c/i2c_master.h>
|
||||
#include <nuttx/sensors/mpu60x0.h>
|
||||
@ -356,6 +356,14 @@ int sim_bringup(void)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: bthcitty_register() failed: %d\n", ret);
|
||||
}
|
||||
|
||||
# ifdef CONFIG_BLUETOOTH_UART_SHIM
|
||||
ret = btuart_register(btuart_shim_getdevice("/dev/ttyHCI"));
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: btuart_register() failed: %d\n", ret);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SIM_I2CBUS
|
||||
|
Loading…
Reference in New Issue
Block a user