ipc.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: LGPL-2.1-or-later */
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 2013-2014 Intel Corporation. All rights reserved.
  7. *
  8. *
  9. */
  10. struct ipc_handler {
  11. void (*handler) (const void *buf, uint16_t len);
  12. bool var_len;
  13. size_t data_len;
  14. };
  15. struct ipc;
  16. typedef void (*ipc_disconnect_cb) (void *data);
  17. struct ipc *ipc_init(const char *path, size_t size, int max_service_id,
  18. bool notifications,
  19. ipc_disconnect_cb cb, void *cb_data);
  20. void ipc_cleanup(struct ipc *ipc);
  21. void ipc_send_rsp(struct ipc *ipc, uint8_t service_id, uint8_t opcode,
  22. uint8_t status);
  23. void ipc_send_rsp_full(struct ipc *ipc, uint8_t service_id, uint8_t opcode,
  24. uint16_t len, void *param, int fd);
  25. void ipc_send_notif(struct ipc *ipc, uint8_t service_id, uint8_t opcode,
  26. uint16_t len, void *param);
  27. void ipc_send_notif_with_fd(struct ipc *ipc, uint8_t service_id, uint8_t opcode,
  28. uint16_t len, void *param, int fd);
  29. void ipc_register(struct ipc *ipc, uint8_t service,
  30. const struct ipc_handler *handlers, uint8_t size);
  31. void ipc_unregister(struct ipc *ipc, uint8_t service);