mesh-io-api.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_io_private;
  11. typedef bool (*mesh_io_init_t)(struct mesh_io *io, void *opts,
  12. mesh_io_ready_func_t cb, void *user_data);
  13. typedef bool (*mesh_io_destroy_t)(struct mesh_io *io);
  14. typedef bool (*mesh_io_caps_t)(struct mesh_io *io, struct mesh_io_caps *caps);
  15. typedef bool (*mesh_io_send_t)(struct mesh_io *io,
  16. struct mesh_io_send_info *info,
  17. const uint8_t *data, uint16_t len);
  18. typedef bool (*mesh_io_register_t)(struct mesh_io *io, const uint8_t *filter,
  19. uint8_t len, mesh_io_recv_func_t cb,
  20. void *user_data);
  21. typedef bool (*mesh_io_deregister_t)(struct mesh_io *io, const uint8_t *filter,
  22. uint8_t len);
  23. typedef bool (*mesh_io_tx_cancel_t)(struct mesh_io *io, const uint8_t *pattern,
  24. uint8_t len);
  25. struct mesh_io_api {
  26. mesh_io_init_t init;
  27. mesh_io_destroy_t destroy;
  28. mesh_io_caps_t caps;
  29. mesh_io_send_t send;
  30. mesh_io_register_t reg;
  31. mesh_io_deregister_t dereg;
  32. mesh_io_tx_cancel_t cancel;
  33. };
  34. struct mesh_io {
  35. enum mesh_io_type type;
  36. const struct mesh_io_api *api;
  37. struct mesh_io_private *pvt;
  38. };
  39. struct mesh_io_table {
  40. enum mesh_io_type type;
  41. const struct mesh_io_api *api;
  42. };