You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ry...@apache.org on 2018/12/21 10:18:00 UTC
[mynewt-nimble] 02/02: nimble/gap: Minor error code fix and enhance
the comment
This is an automated email from the ASF dual-hosted git repository.
rymek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit 146e1af0f7299ca07cdc548495125f82ce7cc8e0
Author: Ćukasz Rymanowski <lu...@codecoup.pl>
AuthorDate: Thu Dec 20 14:10:31 2018 +0100
nimble/gap: Minor error code fix and enhance the comment
---
nimble/host/src/ble_gap.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c
index 50e1596..ebd4354 100644
--- a/nimble/host/src/ble_gap.c
+++ b/nimble/host/src/ble_gap.c
@@ -2675,10 +2675,13 @@ ble_gap_ext_adv_set_data_validate(uint8_t instance, struct os_mbuf *data)
return 0;
}
- /* if already advertising, data must fit in single HCI command */
+ /* if already advertising, data must fit in single HCI command
+ * as per BT 5.0 Vol 2, Part E, 7.8.54. Don't bother Controller with such
+ * a request.
+ */
if (ble_gap_slave[instance].op == BLE_GAP_OP_S_ADV) {
if (len > min(MYNEWT_VAL(BLE_EXT_ADV_MAX_SIZE), 251)) {
- return EINVAL;
+ return BLE_HS_EINVAL;
}
}
@@ -2832,10 +2835,13 @@ ble_gap_ext_adv_rsp_set_validate(uint8_t instance, struct os_mbuf *data)
return 0;
}
- /* if already advertising, data must fit in single HCI command */
+ /* if already advertising, data must fit in single HCI command
+ * as per BT 5.0 Vol 2, Part E, 7.8.55. Don't bother Controller with such
+ * a request.
+ */
if (ble_gap_slave[instance].op == BLE_GAP_OP_S_ADV) {
if (len > min(MYNEWT_VAL(BLE_EXT_ADV_MAX_SIZE), 251)) {
- return EINVAL;
+ return BLE_HS_EINVAL;
}
}