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 2016/04/06 02:37:24 UTC
[3/6] incubator-mynewt-core git commit: bletiny - fix "set addr"
command.
bletiny - fix "set addr" command.
Background: The host is transitioning over to using its own concept of
its device address, rather than relying on the controller. This
transition is necessary to support host-only setups. As part of this
transition, the security manager code uses the host's conception of its
address, and does not use the controller's address at all.
This commit: Prior to this change, the "set addr" command only set the
controller's global address field (g_dev_addr). Now, this command sets
both the controller's and host's address field.
This command is problematic for a number of reasons:
* Changing one's address mid-connection is not compliant with the
BLE spec.
* The command assumes the nimble controller is built in to the app
(combined host-controller).
* Changing the host address requires the inclusion of a private
net/nimble/host header file, which should not be done.
As a consequence, this command should be removed soon. Unfortunately,
there is not currently a convenient way to set one's address, aside from
rebuilding bletiny with a different hardcoded value.
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/a4ffe857
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/a4ffe857
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/a4ffe857
Branch: refs/heads/develop
Commit: a4ffe8572c44eeb8e20fd80de8bc39345952eb79
Parents: 3a35998
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Apr 5 14:43:56 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Apr 5 17:36:18 2016 -0700
----------------------------------------------------------------------
apps/bletiny/src/cmd.c | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a4ffe857/apps/bletiny/src/cmd.c
----------------------------------------------------------------------
diff --git a/apps/bletiny/src/cmd.c b/apps/bletiny/src/cmd.c
index 421d49a..c7f6523 100644
--- a/apps/bletiny/src/cmd.c
+++ b/apps/bletiny/src/cmd.c
@@ -28,6 +28,7 @@
#include "host/ble_gap.h"
#include "host/ble_hs_adv.h"
#include "../src/ble_l2cap_priv.h"
+#include "../src/ble_hs_priv.h"
#include "bletiny_priv.h"
@@ -1208,6 +1209,7 @@ cmd_set(int argc, char **argv)
* needs to be removed.
*/
memcpy(g_dev_addr, addr, 6);
+ memcpy(ble_hs_our_dev.public_addr, addr, 6);
} else if (rc != ENOENT) {
return rc;
}