You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by we...@apache.org on 2016/04/12 23:17:10 UTC
incubator-mynewt-core git commit: Add remaining command LE HCI
command lengths
Repository: incubator-mynewt-core
Updated Branches:
refs/heads/develop 29509f4f0 -> aefda63ff
Add remaining command LE HCI command lengths
Decided to add all the commands to this array regardless of whether
or not they are implemented.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/aefda63f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/aefda63f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/aefda63f
Branch: refs/heads/develop
Commit: aefda63ff6368d081c78f7473f083296f89528c7
Parents: 29509f4
Author: William San Filippo <wi...@runtime.io>
Authored: Tue Apr 12 14:15:37 2016 -0700
Committer: William San Filippo <wi...@runtime.io>
Committed: Tue Apr 12 14:17:04 2016 -0700
----------------------------------------------------------------------
net/nimble/include/nimble/hci_common.h | 20 ++++++++++++-
net/nimble/src/hci_common.c | 45 ++++++++++++++---------------
2 files changed, 41 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/aefda63f/net/nimble/include/nimble/hci_common.h
----------------------------------------------------------------------
diff --git a/net/nimble/include/nimble/hci_common.h b/net/nimble/include/nimble/hci_common.h
index 7b93d63..e2874a7 100644
--- a/net/nimble/include/nimble/hci_common.h
+++ b/net/nimble/include/nimble/hci_common.h
@@ -313,6 +313,9 @@
/* --- LE read supported states (OCF 0x001C) --- */
#define BLE_HCI_RD_SUPP_STATES_RSPLEN (8)
+/* --- LE transitter test command (OCF 0x001E) --- */
+#define BLE_HCI_TX_TEST_LEN (3)
+
/* --- LE remote connection parameter request reply (OCF 0x0020) */
#define BLE_HCI_CONN_PARAM_REPLY_LEN (14)
@@ -322,12 +325,27 @@
/* --- LE set data length (OCF 0x0022) */
#define BLE_HCI_SET_DATALEN_LEN (6)
-/* --- LE read suggested default data length (OCF 0x0024) */
+/* --- LE read suggested default data length (OCF 0x0023) */
#define BLE_HCI_RD_SUGG_DATALEN_RSPLEN (4)
/* --- LE write suggested default data length (OCF 0x0024) */
#define BLE_HCI_WR_SUGG_DATALEN_LEN (4)
+/* --- LE generate DHKEY command (OCF 0x0026) */
+#define BLE_HCI_GEN_DHKEY_LEN (64)
+
+/* --- LE add device to resolving list (OCF 0x0027) */
+#define BLE_HCI_ADD_TO_RESOLV_LIST_LEN (39)
+
+/* --- LE add device to resolving list (OCF 0x0028) */
+#define BLE_HCI_RMV_FROM_RESOLV_LIST_LEN (7)
+
+/* --- LE read peer resolvable address (OCF 0x002B) */
+#define BLE_HCI_RD_PEER_RESOLV_ADDR_LEN (7)
+
+/* --- LE read peer resolvable address (OCF 0x002C) */
+#define BLE_HCI_RD_LOC_RESOLV_ADDR_LEN (7)
+
/* --- LE read maximum data length (OCF 0x002F) */
#define BLE_HCI_RD_MAX_DATALEN_RSPLEN (8)
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/aefda63f/net/nimble/src/hci_common.c
----------------------------------------------------------------------
diff --git a/net/nimble/src/hci_common.c b/net/nimble/src/hci_common.c
index 83e645a..93998b3 100644
--- a/net/nimble/src/hci_common.c
+++ b/net/nimble/src/hci_common.c
@@ -6,7 +6,7 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
@@ -21,12 +21,11 @@
#include "nimble/ble.h"
#include "nimble/hci_common.h"
-/*
- * Lengths for commands. NOTE: 0xFF is a special case and means that there
- * is no fixed length for the command or is a command that we have not
- * implemented.
- */
-const uint8_t g_ble_hci_le_cmd_len[BLE_HCI_NUM_LE_CMDS] =
+/*
+ * Storage for the length of each HCI LE command. This is the length of the
+ * command parameters in the command; not the response length.
+ */
+const uint8_t g_ble_hci_le_cmd_len[BLE_HCI_NUM_LE_CMDS] =
{
0, /* 0x0000: reserved */
BLE_HCI_SET_LE_EVENT_MASK_LEN, /* 0x0001: set event mask */
@@ -53,28 +52,28 @@ const uint8_t g_ble_hci_le_cmd_len[BLE_HCI_NUM_LE_CMDS] =
BLE_HCI_CONN_RD_REM_FEAT_LEN, /* 0x0016: read remote features */
BLE_HCI_LE_ENCRYPT_LEN, /* 0x0017: encrypt */
0, /* 0x0018: rand */
- 0xFF,
- 0xFF,
- 0xFF,
+ BLE_HCI_LE_START_ENCRYPT_LEN, /* 0x0019: start encryption */
+ BLE_HCI_LT_KEY_REQ_REPLY_LEN, /* 0x001A: LTK request reply */
+ sizeof(uint16_t), /* 0x001B: LTK request negative reply */
0, /* 0x001C: read supported states */
- 0xFF,
- 0xFF,
- 0xFF,
+ sizeof(uint8_t), /* 0x001D: receiver test */
+ BLE_HCI_TX_TEST_LEN, /* 0x001E: transmitter test */
+ 0, /* 0x001F: test end */
BLE_HCI_CONN_PARAM_REPLY_LEN, /* 0x0020: conn param reply */
BLE_HCI_CONN_PARAM_NEG_REPLY_LEN, /* 0x0021: conn param neg reply */
BLE_HCI_SET_DATALEN_LEN, /* 0x0022: set data length */
0, /* 0x0023: read sugg data len */
BLE_HCI_WR_SUGG_DATALEN_LEN, /* 0x0024: write suggested data len */
- 0xFF,
- 0xFF,
- 0xFF,
- 0xFF,
- 0xFF,
- 0xFF,
- 0xFF,
- 0xFF,
- 0xFF,
- 0xFF,
+ 0, /* 0x0025: rd local P256 pub key */
+ BLE_HCI_GEN_DHKEY_LEN, /* 0x0026: generate DHKEY */
+ BLE_HCI_ADD_TO_RESOLV_LIST_LEN, /* 0x0027: add to resolving list */
+ BLE_HCI_RMV_FROM_RESOLV_LIST_LEN, /* 0x0028: rmv from resolving list */
+ 0, /* 0x0029: clear resolving list */
+ 0, /* 0x002A: read resolving list size */
+ BLE_HCI_RD_PEER_RESOLV_ADDR_LEN, /* 0x002B: read peer resolvable addr */
+ BLE_HCI_RD_LOC_RESOLV_ADDR_LEN, /* 0x002C: read local resolvable addr */
+ sizeof(uint8_t), /* 0x002D: set addr resolution enable */
+ sizeof(uint16_t), /* 0x002E: Set resolv priv addr tmo */
0, /* 0x002F: Read max data length */
};