You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/10/30 07:38:23 UTC
[incubator-nuttx] branch releases/10.0 updated (8ea02d5 -> 1022982)
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a change to branch releases/10.0
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.
from 8ea02d5 drivers: wireless: Add support for ioctl(fd, SIOCGIFADDR, ...) to gs2200m.c
new 83193d6 bt_netdev: remove invalid assert breaking build when debugging is enabled
new dbbc551 bt_hcicore.c: Fix wrong order of bt_send() and setting last command sent
new 1f8d3af bt_netdev.c: wrong placement of DEBUGASSERT (checks pointer before being set)
new d6c5e57 bt_hci: add various definitions, better expose some fields
new 12e0f18 bt_hcicore.c: fix handling of advertising report; use correct advertising interval
new 33a4947 bt_conn.c: use definition names instead of hardcoded numbers
new 1022982 fix typos
The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
include/nuttx/wireless/bluetooth/bt_hci.h | 98 ++++++++++++++++++++++++-------
net/bluetooth/Kconfig | 4 +-
wireless/bluetooth/bt_conn.c | 4 +-
wireless/bluetooth/bt_hcicore.c | 24 ++++----
wireless/bluetooth/bt_netdev.c | 8 +--
5 files changed, 99 insertions(+), 39 deletions(-)
[incubator-nuttx] 02/07: bt_hcicore.c: Fix wrong order of bt_send()
and setting last command sent
Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch releases/10.0
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit dbbc5515ef6e1b1e7b6f94c7dd9c3f33e4a9f51f
Author: Matias N <ma...@protobits.dev>
AuthorDate: Sun Oct 25 12:02:55 2020 -0300
bt_hcicore.c: Fix wrong order of bt_send() and setting last command sent
---
wireless/bluetooth/bt_hcicore.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/wireless/bluetooth/bt_hcicore.c b/wireless/bluetooth/bt_hcicore.c
index a828e46..7e2a42d 100644
--- a/wireless/bluetooth/bt_hcicore.c
+++ b/wireless/bluetooth/bt_hcicore.c
@@ -1002,11 +1002,6 @@ static int hci_tx_kthread(int argc, FAR char *argv[])
g_btdev.ncmd = 0;
- wlinfo("Sending command %04x buf %p to driver\n",
- buf->u.hci.opcode, buf);
-
- btdev->send(btdev, buf);
-
/* Clear out any existing sent command */
if (g_btdev.sent_cmd)
@@ -1017,6 +1012,11 @@ static int hci_tx_kthread(int argc, FAR char *argv[])
}
g_btdev.sent_cmd = buf;
+
+ wlinfo("Sending command %04x buf %p to driver\n",
+ buf->u.hci.opcode, buf);
+
+ btdev->send(btdev, buf);
}
return EXIT_SUCCESS; /* Can't get here */
[incubator-nuttx] 03/07: bt_netdev.c: wrong placement of
DEBUGASSERT (checks pointer before being set)
Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch releases/10.0
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 1f8d3af752ef6992c8bc29099e43c27d7d80e5e5
Author: Matias N <ma...@protobits.dev>
AuthorDate: Wed Oct 28 23:47:00 2020 -0300
bt_netdev.c: wrong placement of DEBUGASSERT (checks pointer before being set)
---
wireless/bluetooth/bt_netdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/wireless/bluetooth/bt_netdev.c b/wireless/bluetooth/bt_netdev.c
index bc31c1d..cb980fd 100644
--- a/wireless/bluetooth/bt_netdev.c
+++ b/wireless/bluetooth/bt_netdev.c
@@ -885,12 +885,12 @@ static int btnet_req_data(FAR struct radio_driver_s *netdev,
FAR struct iob_s *iob;
bt_addr_le_t peer;
- wlinfo("Received framelist\n");
- DEBUGASSERT(priv != NULL && meta != NULL && framelist != NULL);
-
priv = (FAR struct btnet_driver_s *)netdev;
btmeta = (FAR struct bluetooth_frame_meta_s *)meta;
+ wlinfo("Received framelist\n");
+ DEBUGASSERT(priv != NULL && meta != NULL && framelist != NULL);
+
/* Create a connection structure for this peer if one does not already
* exist.
*
[incubator-nuttx] 07/07: fix typos
Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch releases/10.0
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 1022982650c3e096ba0ffeef6231e27b53d12e04
Author: Matias N <ma...@protobits.dev>
AuthorDate: Wed Oct 28 23:52:26 2020 -0300
fix typos
---
net/bluetooth/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig
index b4479b5..65e8e5d 100644
--- a/net/bluetooth/Kconfig
+++ b/net/bluetooth/Kconfig
@@ -38,10 +38,10 @@ config NET_BLUETOOTH_BACKLOG
default 8
range 0 255
---help---
- As frames are received, then are help in an RX queue. They remain
+ As frames are received, they are held in an RX queue. They remain
in the RX queue until application logic reads the queue frames. To
prevent overrun, the maximum backlog may be set to a nonzero value.
- What the backlog of queue frames reaches that count, the olds frame
+ When the backlog of queue frames reaches that count, the old frame
will be freed, preventing overrun at the cost of losing the oldest
frames.
[incubator-nuttx] 01/07: bt_netdev: remove invalid assert breaking
build when debugging is enabled
Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch releases/10.0
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 83193d634db7afc0ce07e7742ea2463e41d03440
Author: Matias N <ma...@protobits.dev>
AuthorDate: Sat Oct 24 23:24:41 2020 -0300
bt_netdev: remove invalid assert breaking build when debugging is enabled
---
wireless/bluetooth/bt_netdev.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/wireless/bluetooth/bt_netdev.c b/wireless/bluetooth/bt_netdev.c
index ee314f9..bc31c1d 100644
--- a/wireless/bluetooth/bt_netdev.c
+++ b/wireless/bluetooth/bt_netdev.c
@@ -1064,8 +1064,6 @@ int bt_netdev_register(FAR const struct bt_driver_s *btdev)
nxsem_init(&priv->bd_exclsem, 0, 1);
- DEBUGASSERT(priv->bd_txpoll != NULL);
-
/* Set the network mask. */
btnet_netmask(netdev);
[incubator-nuttx] 04/07: bt_hci: add various definitions,
better expose some fields
Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch releases/10.0
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit d6c5e57e92481ab284e6db670e4486d796509202
Author: Matias N <ma...@protobits.dev>
AuthorDate: Wed Oct 28 23:49:36 2020 -0300
bt_hci: add various definitions, better expose some fields
---
include/nuttx/wireless/bluetooth/bt_hci.h | 98 ++++++++++++++++++++++++-------
1 file changed, 78 insertions(+), 20 deletions(-)
diff --git a/include/nuttx/wireless/bluetooth/bt_hci.h b/include/nuttx/wireless/bluetooth/bt_hci.h
index 57d2192..f4e67f6 100644
--- a/include/nuttx/wireless/bluetooth/bt_hci.h
+++ b/include/nuttx/wireless/bluetooth/bt_hci.h
@@ -12,30 +12,31 @@
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
+ * modification, are permitted provided that the following conditions are
+ * met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
@@ -64,9 +65,16 @@
/* HCI Error Codes */
+#define BT_HCI_SUCCESS 0x00
+#define BT_HCI_PENDING 0x00
+#define BT_HCI_ERR_UNKNOWN_COMMAND 0x01
+#define BT_HCI_ERR_CONNECTION_TIMEOUT 0x08
#define BT_HCI_ERR_AUTHENTICATION_FAIL 0x05
+#define BT_HCI_ERR_COMMAND_DISALLOWED 0x0C
+#define BT_HCI_ERR_INVALID_PARAMETERS 0x12
#define BT_HCI_ERR_REMOTE_USER_TERM_CONN 0x13
#define BT_HCI_ERR_UNSUPP_REMOTE_FEATURE 0x1a
+#define BT_HCI_ERR_INSTANT_PASSED 0x28
#define BT_HCI_ERR_PAIRING_NOT_SUPPORTED 0x29
#define BT_HCI_ERR_UNACCEPT_CONN_PARAMS 0x3b
@@ -129,9 +137,12 @@
#define BT_HCI_OP_READ_LOCAL_FEATURES BT_OP(BT_OGF_INFO, 0x0003)
#define BT_HCI_OP_READ_BUFFER_SIZE BT_OP(BT_OGF_INFO, 0x0005)
#define BT_HCI_OP_READ_BD_ADDR BT_OP(BT_OGF_INFO, 0x0009)
+#define BT_HCI_OP_LE_SET_EVENT_MASK BT_OP(BT_OGF_LE, 0x0001)
#define BT_HCI_OP_LE_READ_BUFFER_SIZE BT_OP(BT_OGF_LE, 0x0002)
#define BT_HCI_OP_LE_READ_LOCAL_FEATURES BT_OP(BT_OGF_LE, 0x0003)
+#define BT_HCI_OP_LE_SET_RAND_ADDR BT_OP(BT_OGF_LE, 0x0005)
+
/* Advertising types */
#define BT_LE_ADV_IND 0x00
@@ -157,7 +168,12 @@
# define BT_LE_SCAN_FILTER_DUP_ENABLE 0x01
#define BT_HCI_OP_LE_CREATE_CONN BT_OP(BT_OGF_LE, 0x000d)
#define BT_HCI_OP_LE_CREATE_CONN_CANCEL BT_OP(BT_OGF_LE, 0x000e)
+#define BT_HCI_OP_LE_READ_WHITE_LIST_SIZE BT_OP(BT_OGF_LE, 0x000f)
+#define BT_HCI_OP_LE_CLEAR_WHITE_LIST BT_OP(BT_OGF_LE, 0x0010)
+#define BT_HCI_OP_LE_ADD_DEV_TO_WHITE_LIST BT_OP(BT_OGF_LE, 0x0011)
+#define BT_HCI_OP_LE_REM_DEV_FROM_WHITE_LIST BT_OP(BT_OGF_LE, 0x0012)
#define BT_HCI_OP_LE_CONN_UPDATE BT_OP(BT_OGF_LE, 0x0013)
+#define BT_HCI_OP_LE_READ_REMOTE_FEATURES BT_OP(BT_OGF_LE, 0x0016)
#define BT_HCI_OP_LE_ENCRYPT BT_OP(BT_OGF_LE, 0x0017)
#define BT_HCI_OP_LE_RAND BT_OP(BT_OGF_LE, 0x0018)
#define BT_HCI_OP_LE_START_ENCRYPTION BT_OP(BT_OGF_LE, 0x0019)
@@ -173,12 +189,20 @@
#define BT_HCI_EVT_NUM_COMPLETED_PACKETS 0x13
#define BT_HCI_EVT_ENCRYPT_KEY_REFRESH_COMPLETE 0x30
#define BT_HCI_EVT_LE_META_EVENT 0x3e
+
#define BT_HCI_EVT_LE_CONN_COMPLETE 0x01
# define BT_HCI_ROLE_MASTER 0x00
# define BT_HCI_ROLE_SLAVE 0x01
#define BT_HCI_EVT_LE_ADVERTISING_REPORT 0x02
+#define BT_HCI_EVT_LE_CONN_UPDATE 0x03
+#define BT_HCI_EVT_LE_READ_REM_FEAT_COMPLETE 0x04
#define BT_HCI_EVT_LE_LTK_REQUEST 0x05
+/* Packet boundary flags for ACL packets */
+
+#define BT_HCI_ACL_CONTINUATION 0x0001
+#define BT_HCI_ACL_NEW 0x0002
+
/****************************************************************************
* Public Types
****************************************************************************/
@@ -202,7 +226,9 @@ begin_packed_struct struct bt_hci_evt_hdr_s
begin_packed_struct struct bt_hci_acl_hdr_s
{
- uint16_t handle;
+ uint16_t handle : 12;
+ uint16_t packet_boundary : 2;
+ uint16_t broadcast : 2;
uint16_t len;
} end_packed_struct;
@@ -223,6 +249,11 @@ begin_packed_struct struct bt_hci_cp_set_event_mask_s
uint8_t events[8];
} end_packed_struct;
+begin_packed_struct struct bt_hci_cp_set_ctl_to_host_flow_s
+{
+ uint8_t enable;
+} end_packed_struct;
+
begin_packed_struct struct bt_hci_cp_host_buffer_size_s
{
uint16_t acl_mtu;
@@ -249,6 +280,11 @@ begin_packed_struct struct bt_hci_cp_write_le_host_supp_s
uint8_t simul;
} end_packed_struct;
+begin_packed_struct struct bt_hci_le_read_remote_features_s
+{
+ uint16_t conn;
+} end_packed_struct;
+
begin_packed_struct struct bt_hci_rp_read_local_version_info_s
{
uint8_t status;
@@ -265,6 +301,13 @@ begin_packed_struct struct bt_hci_rp_read_local_features_s
uint8_t features[8];
} end_packed_struct;
+begin_packed_struct struct bt_hci_rp_le_read_remote_features_s
+{
+ uint8_t status;
+ uint16_t conn;
+ uint8_t features[8];
+} end_packed_struct;
+
begin_packed_struct struct bt_hci_rp_read_buffer_size_s
{
uint8_t status;
@@ -277,7 +320,7 @@ begin_packed_struct struct bt_hci_rp_read_buffer_size_s
begin_packed_struct struct bt_hci_rp_read_bd_addr_s
{
uint8_t status;
- bt_addr_t bdaddr;
+ struct bt_addr_s bdaddr;
} end_packed_struct;
begin_packed_struct struct bt_hci_rp_le_read_buffer_size_s
@@ -415,6 +458,12 @@ begin_packed_struct struct bt_hci_evt_encrypt_change_s
uint8_t encrypt;
} end_packed_struct;
+begin_packed_struct struct hci_evt_cmd_disallowed_s
+{
+ uint8_t ncmd;
+ uint16_t opcode;
+} end_packed_struct;
+
begin_packed_struct struct hci_evt_cmd_complete_s
{
uint8_t ncmd;
@@ -457,7 +506,16 @@ begin_packed_struct struct bt_hci_evt_le_conn_complete_s
uint8_t clock_accuracy;
} end_packed_struct;
-begin_packed_struct struct bt_hci_ev_le_advertising_info_s
+begin_packed_struct struct bt_hci_evt_le_conn_update_s
+{
+ uint8_t status;
+ uint16_t handle;
+ uint16_t interval;
+ uint16_t latency;
+ uint16_t timeout;
+} end_packed_struct;
+
+begin_packed_struct struct bt_hci_ev_le_advertising_report_s
{
uint8_t evt_type;
bt_addr_le_t addr;
[incubator-nuttx] 06/07: bt_conn.c: use definition names instead of
hardcoded numbers
Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch releases/10.0
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 33a4947f6477d2548dff26b7a6a030a6f025db0a
Author: Matias N <ma...@protobits.dev>
AuthorDate: Wed Oct 28 23:51:33 2020 -0300
bt_conn.c: use definition names instead of hardcoded numbers
---
wireless/bluetooth/bt_conn.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/wireless/bluetooth/bt_conn.c b/wireless/bluetooth/bt_conn.c
index b33741b..0c13f8b 100644
--- a/wireless/bluetooth/bt_conn.c
+++ b/wireless/bluetooth/bt_conn.c
@@ -298,7 +298,7 @@ void bt_conn_receive(FAR struct bt_conn_s *conn, FAR struct bt_buf_s *buf,
switch (flags)
{
- case 0x02:
+ case BT_HCI_ACL_NEW:
/* First packet */
@@ -323,7 +323,7 @@ void bt_conn_receive(FAR struct bt_conn_s *conn, FAR struct bt_buf_s *buf,
break;
- case 0x01:
+ case BT_HCI_ACL_CONTINUATION:
/* Continuation */
[incubator-nuttx] 05/07: bt_hcicore.c: fix handling of advertising
report; use correct advertising interval
Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch releases/10.0
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 12e0f18b9ba9930254565181a5dcc0e9aa3dc2c3
Author: Matias N <ma...@protobits.dev>
AuthorDate: Wed Oct 28 23:47:58 2020 -0300
bt_hcicore.c: fix handling of advertising report; use correct advertising interval
---
wireless/bluetooth/bt_hcicore.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/wireless/bluetooth/bt_hcicore.c b/wireless/bluetooth/bt_hcicore.c
index 7e2a42d..9aadb37 100644
--- a/wireless/bluetooth/bt_hcicore.c
+++ b/wireless/bluetooth/bt_hcicore.c
@@ -791,7 +791,7 @@ done:
static void le_adv_report(FAR struct bt_buf_s *buf)
{
- FAR struct bt_hci_ev_le_advertising_info_s *info;
+ FAR struct bt_hci_ev_le_advertising_report_s *info;
uint8_t num_reports = buf->data[0];
wlinfo("Adv number of reports %u\n", num_reports);
@@ -830,10 +830,14 @@ static void le_adv_report(FAR struct bt_buf_s *buf)
/* Get next report iteration by moving pointer to right offset in buf
* according to spec 4.2, Vol 2, Part E, 7.7.65.2.
+ *
+ * TODO: multiple reports are stored as multiple arrays not one array
+ * of structs. If num_reports > 0 this will not WORK!
*/
- info = bt_buf_consume(buf,
- sizeof(*info) + info->length + sizeof(rssi));
+ /* Note that info already contains one byte which accounts for RSSI */
+
+ info = bt_buf_consume(buf, sizeof(*info) + info->length);
}
}
@@ -1909,8 +1913,8 @@ send_set_param:
set_param = bt_buf_extend(buf, sizeof(*set_param));
memset(set_param, 0, sizeof(*set_param));
- set_param->min_interval = BT_HOST2LE16(0x0800);
- set_param->max_interval = BT_HOST2LE16(0x0800);
+ set_param->min_interval = BT_HOST2LE16(300);
+ set_param->max_interval = BT_HOST2LE16(300);
set_param->type = type;
set_param->channel_map = 0x07;