You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2017/03/07 18:39:45 UTC
[1/2] incubator-mynewt-core git commit: nimble/gap: Fix bad
calculation on connection parameters validation
Repository: incubator-mynewt-core
Updated Branches:
refs/heads/develop 7d28f7b79 -> ff2d84e93
nimble/gap: Fix bad calculation on connection parameters validation
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/785d1e1d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/785d1e1d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/785d1e1d
Branch: refs/heads/develop
Commit: 785d1e1d62566c21575ff24df62ab0eaf5b2c293
Parents: 7d28f7b
Author: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Authored: Tue Mar 7 11:08:38 2017 +0100
Committer: \u0141ukasz Rymanowski <lu...@codecoup.pl>
Committed: Tue Mar 7 12:29:03 2017 +0100
----------------------------------------------------------------------
net/nimble/host/src/ble_gap.c | 7 ++++++-
net/nimble/host/test/src/ble_gap_test.c | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/785d1e1d/net/nimble/host/src/ble_gap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_gap.c b/net/nimble/host/src/ble_gap.c
index 0a09d4c..d14c55c 100644
--- a/net/nimble/host/src/ble_gap.c
+++ b/net/nimble/host/src/ble_gap.c
@@ -2828,8 +2828,13 @@ ble_gap_validate_conn_params(const struct ble_gap_upd_params *params)
return false;
}
+ /* According to specification mentioned above we should make sure that:
+ * supervision_timeout_ms > (1 + latency) * 2 * max_interval_ms
+ * =>
+ * supervision_timeout * 10 ms > (1 + latency) * 2 * itvl_max * 1.25ms
+ */
if (params->supervision_timeout <=
- (((1 + params->latency) * params->itvl_max) * 6 / 4)) {
+ (((1 + params->latency) * params->itvl_max) / 4)) {
return false;
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/785d1e1d/net/nimble/host/test/src/ble_gap_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/test/src/ble_gap_test.c b/net/nimble/host/test/src/ble_gap_test.c
index 9dd9dec..ac02343 100644
--- a/net/nimble/host/test/src/ble_gap_test.c
+++ b/net/nimble/host/test/src/ble_gap_test.c
@@ -2355,7 +2355,7 @@ TEST_CASE(ble_gap_test_case_update_conn_verify_params)
ble_gap_test_util_update_verify_params(
((struct ble_gap_upd_params[]) { {
.itvl_min = 100,
- .itvl_max = 100,
+ .itvl_max = 600,
.supervision_timeout = 300,
.latency = 1,
.min_ce_len = 554,
[2/2] incubator-mynewt-core git commit: This closes #196.
Posted by cc...@apache.org.
This closes #196.
Merge remote-tracking branch 'rymanluk/fix_calc_param' into develop
* rymanluk/fix_calc_param:
nimble/gap: Fix bad calculation on connection parameters validation
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/ff2d84e9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/ff2d84e9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/ff2d84e9
Branch: refs/heads/develop
Commit: ff2d84e931a710bec1b294b6bb534682ebc8fd4f
Parents: 7d28f7b 785d1e1
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Mar 7 10:39:22 2017 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Mar 7 10:39:22 2017 -0800
----------------------------------------------------------------------
net/nimble/host/src/ble_gap.c | 7 ++++++-
net/nimble/host/test/src/ble_gap_test.c | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------