mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
This comment adds (1) basic support for AF_BLUETOOTH sockets. The logic compiles but is still incomplete. Support for Bluetooth is general is still dependent on CONFIG_EXPERMIMENTAL because it is not yet ready for used.
Squashed commit of the following:
wireless/bluetooth: Some small changes that gets to a clean compile by just eliminating some incorrect implementations (still with a lot of warnings. The logic is still incomplete but now not so lethal.
wireless/bluetooth: Restructuring: Connection interfaces should internal to wireless/bluetooth. include/nuttx/wireless/bt_conn.h removed and merged with wireless/bluetooth/bt_conn.h. Several fix to get closer to bt_netdev.c compiling. Need to design some not interfaces and use some existing interfaces to send and receiv packets.
wireless/bluetooth: Some organization with some network device compile errors fixed. Still not even close to compiling.
net/bluetooth: Fix numerous compile issues; Still open design issues with regard to the interface with the Bluetooth stack.
wireless/bluetooth: Create bt_netdev.c with a crude copy of mac802154_netdev.c. Does not not even compile yet.
include/nuttx/net: Add bluetooth.h. Content is not yet correct.
net/netpackets: Add bluetooth.h. Update net/bluetooth to use new socket address definition.
net/bluetooth: Some fixes for initial build.
net/bluetooth: Add initial support for Bluetooth sockets. The initial cut is just the a clone of the IEEE 802.15.4 socket support with name changes.
net/ieee802154: Fix some typos noted when cloning to create net/bluetooth.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* net/netdev/netdev_ioctl.c
|
||||
*
|
||||
* Copyright (C) 2007-2012, 2015-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2012, 2015-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -73,6 +73,10 @@
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_NETDEV_IOCTL) && defined(CONFIG_NET_6LOWPAN)
|
||||
# ifdef CONFIG_WIRELESS_BLUETOOTH
|
||||
# include <nuttx/wireless/bt_ioctl.h>
|
||||
# endif
|
||||
|
||||
# ifdef CONFIG_WIRELESS_IEEE802154
|
||||
# include <nuttx/wireless/ieee802154/ieee802154_mac.h>
|
||||
# endif
|
||||
@@ -370,6 +374,68 @@ static void ioctl_set_ipv6addr(FAR net_ipv6addr_t outaddr,
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: netdev_iee802154_ioctl
|
||||
*
|
||||
* Description:
|
||||
* Perform Bluetooth network device specific operations.
|
||||
*
|
||||
* Input Parameters:
|
||||
* psock - Socket structure
|
||||
* dev - Ethernet driver device structure
|
||||
* cmd - The ioctl command
|
||||
* req - The argument of the ioctl cmd
|
||||
*
|
||||
* Returned Value:
|
||||
* >=0 on success (positive non-zero values are cmd-specific)
|
||||
* Negated errno returned on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_NETDEV_IOCTL) && defined(CONFIG_NET_6LOWPAN) && \
|
||||
defined(CONFIG_WIRELESS_BLUETOOTH)
|
||||
static int netdev_iee802154_ioctl(FAR struct socket *psock, int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
FAR struct net_driver_s *dev;
|
||||
FAR char *ifname;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
if (arg != 0ul)
|
||||
{
|
||||
if (WL_IBLUETOOTHCMD(cmd))
|
||||
{
|
||||
/* Get the name of the Bluetooth device to receive the IOCTL
|
||||
* command
|
||||
*/
|
||||
|
||||
FAR struct bluetooth_ifreq_s *cmddata =
|
||||
(FAR struct bluetooth_ifreq_s *)((uintptr_t)arg);
|
||||
|
||||
ifname = cmddata->ifr_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Not a Bluetooth IOCTL command */
|
||||
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
||||
/* Find the device with this name */
|
||||
|
||||
dev = netdev_findbyname(ifname);
|
||||
if (dev != NULL && dev->d_lltype == NET_LL_BLUETOOTH)
|
||||
{
|
||||
/* Perform the device IOCTL */
|
||||
|
||||
ret = dev->d_ioctl(dev, cmd, arg);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: netdev_iee802154_ioctl
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user