You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by na...@apache.org on 2019/01/11 14:07:15 UTC

[mynewt-nimble] 01/03: mesh: Add lpn and rpl testing commands

This is an automated email from the ASF dual-hosted git repository.

naraj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit 8632b079b69659e69b2f6afc0b8ebc8b96572de9
Author: MichaƂ Narajowski <mi...@codecoup.pl>
AuthorDate: Tue Nov 20 11:16:19 2018 +0100

    mesh: Add lpn and rpl testing commands
---
 nimble/host/mesh/include/mesh/testing.h | 30 ++++++++++++++++++++++++++++++
 nimble/host/mesh/src/testing.c          | 23 +++++++++++++++++++++++
 2 files changed, 53 insertions(+)

diff --git a/nimble/host/mesh/include/mesh/testing.h b/nimble/host/mesh/include/mesh/testing.h
index 7b48772..4c2b2a6 100644
--- a/nimble/host/mesh/include/mesh/testing.h
+++ b/nimble/host/mesh/include/mesh/testing.h
@@ -57,6 +57,36 @@ void bt_test_cb_register(struct bt_test_cb *cb);
  */
 void bt_test_cb_unregister(struct bt_test_cb *cb);
 
+/** Send Friend Subscription List Add message.
+ *
+ *  Used by Low Power node to send the group address for which messages are to
+ *  be stored by Friend node.
+ *
+ *  @param group Group address
+ *
+ *  @return Zero on success or (negative) error code otherwise.
+ */
+int bt_test_mesh_lpn_group_add(u16_t group);
+
+/** Send Friend Subscription List Remove message.
+ *
+ *  Used by Low Power node to remove the group addresses from Friend node
+ *  subscription list. Messages sent to those addresses will not be stored
+ *  by Friend node.
+ *
+ *  @param groups Group addresses
+ *  @param groups_count Group addresses count
+ *
+ *  @return Zero on success or (negative) error code otherwise.
+ */
+int bt_test_mesh_lpn_group_remove(u16_t *groups, size_t groups_count);
+
+/** Clear replay protection list cache.
+ *
+ *  @return Zero on success or (negative) error code otherwise.
+ */
+int bt_test_mesh_rpl_clear(void);
+
 u8_t mod_bind(struct bt_mesh_model *model, u16_t key_idx);
 u8_t mod_unbind(struct bt_mesh_model *model, u16_t key_idx, bool store);
 int cmd_mesh_init(int argc, char *argv[]);
diff --git a/nimble/host/mesh/src/testing.c b/nimble/host/mesh/src/testing.c
index 4a0f1da..d0a0537 100644
--- a/nimble/host/mesh/src/testing.c
+++ b/nimble/host/mesh/src/testing.c
@@ -16,6 +16,8 @@
 #include "testing.h"
 #include "access.h"
 #include "foundation.h"
+#include "lpn.h"
+#include "transport.h"
 
 static sys_slist_t cb_slist;
 
@@ -88,6 +90,27 @@ void bt_test_mesh_trans_incomp_timer_exp(void)
 	}
 }
 
+int bt_test_mesh_lpn_group_add(u16_t group)
+{
+	bt_mesh_lpn_group_add(group);
+
+	return 0;
+}
+
+int bt_test_mesh_lpn_group_remove(u16_t *groups, size_t groups_count)
+{
+	bt_mesh_lpn_group_del(groups, groups_count);
+
+	return 0;
+}
+
+int bt_test_mesh_rpl_clear(void)
+{
+	bt_mesh_rpl_clear();
+
+	return 0;
+}
+
 void bt_test_print_credentials(void)
 {
 	int i;