test.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* Bluetooth Mesh */
  2. /*
  3. * SPDX-FileCopyrightText: 2017 Intel Corporation
  4. * SPDX-FileContributor: 2018-2021 Espressif Systems (Shanghai) CO LTD
  5. *
  6. * SPDX-License-Identifier: Apache-2.0
  7. */
  8. #ifndef _BLE_MESH_TEST_H_
  9. #define _BLE_MESH_TEST_H_
  10. #include "net.h"
  11. #include "proxy_client.h"
  12. #include "mesh/adapter.h"
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. struct bt_mesh_device_network_info {
  17. uint8_t net_key[16];
  18. uint16_t net_idx;
  19. uint8_t flags;
  20. uint32_t iv_index;
  21. uint16_t unicast_addr;
  22. uint8_t dev_key[16];
  23. uint8_t app_key[16];
  24. uint16_t app_idx;
  25. uint16_t group_addr;
  26. };
  27. int bt_mesh_device_auto_enter_network(struct bt_mesh_device_network_info *info);
  28. /* Before trying to update the white list, users need to make sure that
  29. * one of the following conditions is satisfied:
  30. * 1. BLE scanning is disabled;
  31. * 2. BLE scanning is enabled with scan filter policy disabled;
  32. * If BLE scanning is enabled with scan filter policy enabled, users need
  33. * to stop BLE scanning firstly, then the white list can be updated.
  34. */
  35. int bt_mesh_test_update_white_list(struct bt_mesh_white_list *wl);
  36. int bt_mesh_test_start_scanning(bool wl_en);
  37. int bt_mesh_test_stop_scanning(void);
  38. typedef void (* bt_mesh_test_net_pdu_cb_t)(const uint8_t *data, uint16_t length);
  39. extern bt_mesh_test_net_pdu_cb_t net_pdu_test_cb;
  40. void bt_mesh_test_register_net_pdu_cb(bt_mesh_test_net_pdu_cb_t cb);
  41. void bt_mesh_test_set_seq(uint32_t seq);
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif /* _BLE_MESH_TEST_H_ */