beacon.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Bluetooth Mesh */
  2. /*
  3. * SPDX-FileCopyrightText: 2017 Intel Corporation
  4. *
  5. * SPDX-License-Identifier: Apache-2.0
  6. */
  7. #ifndef _BEACON_H_
  8. #define _BEACON_H_
  9. #include "net.h"
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #define BEACON_TYPE_UNPROVISIONED 0x00
  14. #define BEACON_TYPE_SECURE 0x01
  15. #define BEACON_TYPE_PRIVATE 0x02
  16. #define NET_IDX_SET(_val) ((void *)((uint32_t)(_val)))
  17. #define NET_IDX_GET(_ptr) ((uint32_t)(_ptr))
  18. /* If the interval has passed or is within 5 seconds from now send a beacon */
  19. #define BEACON_THRESHOLD(last) (K_SECONDS(10 * ((last) + 1)) - K_SECONDS(5))
  20. void bt_mesh_secure_beacon_enable(void);
  21. void bt_mesh_secure_beacon_disable(void);
  22. void bt_mesh_beacon_ivu_initiator(bool enable);
  23. void bt_mesh_beacon_recv(struct net_buf_simple *buf, int8_t rssi);
  24. void bt_mesh_secure_beacon_create(struct bt_mesh_subnet *sub,
  25. struct net_buf_simple *buf);
  26. void bt_mesh_beacon_init(void);
  27. void bt_mesh_beacon_deinit(void);
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #endif /* _BEACON_H_ */