friend.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: LGPL-2.1-or-later */
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 2018 Intel Corporation. All rights reserved.
  7. *
  8. *
  9. */
  10. #define OP_FRND_REQUEST 0x8040
  11. #define OP_FRND_INQUIRY 0x8041
  12. #define OP_FRND_CONFIRM 0x8042
  13. #define OP_FRND_SUB_LIST_ADD 0x8043
  14. #define OP_FRND_SUB_LIST_CONFIRM 0x8044
  15. #define OP_FRND_SUB_LIST_REMOVE 0x8045
  16. #define OP_FRND_NEGOTIATE 0x8046
  17. #define OP_FRND_CLEAR 0x8047
  18. void friend_poll(struct mesh_net *net, uint16_t src, bool seq,
  19. struct mesh_friend *frnd);
  20. void friend_request(struct mesh_net *net, uint16_t net_idx, uint16_t src,
  21. uint8_t minReq, uint8_t delay, uint32_t timeout,
  22. uint16_t prev, uint8_t num_elements, uint16_t cntr,
  23. int8_t rssi);
  24. void friend_clear_confirm(struct mesh_net *net, uint16_t src, uint16_t lpn,
  25. uint16_t lpnCounter);
  26. void friend_clear(struct mesh_net *net, uint16_t src, uint16_t lpn,
  27. uint16_t lpnCounter, struct mesh_friend *frnd);
  28. void friend_sub_add(struct mesh_net *net, struct mesh_friend *frnd,
  29. const uint8_t *pkt, uint8_t len);
  30. void friend_sub_del(struct mesh_net *net, struct mesh_friend *frnd,
  31. const uint8_t *pkt, uint8_t len);
  32. void mesh_friend_relay_init(struct mesh_net *net, uint16_t addr);
  33. /* Low-Power-Node role */
  34. void frnd_sub_add(struct mesh_net *net, uint32_t parms[7]);
  35. void frnd_sub_del(struct mesh_net *net, uint32_t parms[7]);
  36. void frnd_poll(struct mesh_net *net, bool retry);
  37. void frnd_clear(struct mesh_net *net);
  38. void frnd_ack_poll(struct mesh_net *net);
  39. void frnd_poll_cancel(struct mesh_net *net);
  40. void frnd_request_friend(struct mesh_net *net, uint8_t cache,
  41. uint8_t offer_delay, uint8_t delay, uint32_t timeout);
  42. void frnd_offer(struct mesh_net *net, uint16_t src, uint8_t window,
  43. uint8_t cache, uint8_t sub_list_size,
  44. int8_t r_rssi, int8_t l_rssi, uint16_t fn_cnt);
  45. void frnd_key_refresh(struct mesh_net *net, uint8_t phase);
  46. uint32_t frnd_get_key(struct mesh_net *net);