agent.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. struct mesh_agent;
  11. struct mesh_agent_prov_caps {
  12. uint32_t uri_hash;
  13. uint16_t oob_info;
  14. uint16_t output_action;
  15. uint16_t input_action;
  16. uint8_t pub_type;
  17. uint8_t static_type;
  18. uint8_t output_size;
  19. uint8_t input_size;
  20. };
  21. typedef void (*mesh_agent_cb_t) (void *user_data, int err);
  22. typedef void (*mesh_agent_key_cb_t) (void *user_data, int err, uint8_t *key,
  23. uint32_t len);
  24. typedef void (*mesh_agent_number_cb_t) (void *user_data, int err,
  25. uint32_t number);
  26. void mesh_agent_init(void);
  27. void mesh_agent_cleanup(void);
  28. struct mesh_agent *mesh_agent_create(const char *path, const char *owner,
  29. struct l_dbus_message_iter *properties);
  30. void mesh_agent_refresh(struct mesh_agent *agent, mesh_agent_cb_t cb,
  31. void *user_data);
  32. void mesh_agent_remove(struct mesh_agent *agent);
  33. void mesh_agent_cancel(struct mesh_agent *agent);
  34. struct mesh_agent_prov_caps *mesh_agent_get_caps(struct mesh_agent *agent);
  35. int mesh_agent_display_number(struct mesh_agent *agent, bool initiator,
  36. uint8_t action, uint32_t count,
  37. mesh_agent_cb_t cb, void *user_data);
  38. int mesh_agent_prompt_number(struct mesh_agent *agent, bool initiator,
  39. uint8_t action, mesh_agent_number_cb_t cb,
  40. void *user_data);
  41. int mesh_agent_prompt_alpha(struct mesh_agent *agent, bool initiator,
  42. mesh_agent_key_cb_t cb, void *user_data);
  43. int mesh_agent_request_static(struct mesh_agent *agent, mesh_agent_key_cb_t cb,
  44. void *user_data);
  45. int mesh_agent_request_private_key(struct mesh_agent *agent,
  46. mesh_agent_key_cb_t cb,
  47. void *user_data);
  48. int mesh_agent_request_public_key(struct mesh_agent *agent,
  49. mesh_agent_key_cb_t cb,
  50. void *user_data);
  51. int mesh_agent_display_string(struct mesh_agent *agent, const char *str,
  52. mesh_agent_cb_t cb,
  53. void *user_data);