manager.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * BlueZ - Bluetooth protocol stack for Linux
  4. *
  5. * Copyright (C) 2010 Instituto Nokia de Tecnologia - INdT
  6. *
  7. */
  8. #ifdef HAVE_CONFIG_H
  9. #include <config.h>
  10. #endif
  11. #include <stdbool.h>
  12. #include "lib/bluetooth.h"
  13. #include "lib/sdp.h"
  14. #include "src/log.h"
  15. #include "src/adapter.h"
  16. #include "src/device.h"
  17. #include "src/profile.h"
  18. #include "src/service.h"
  19. #include "manager.h"
  20. #include "server.h"
  21. static int sap_server_probe(struct btd_profile *p, struct btd_adapter *adapter)
  22. {
  23. DBG("path %s", adapter_get_path(adapter));
  24. return sap_server_register(adapter);
  25. }
  26. static void sap_server_remove(struct btd_profile *p,
  27. struct btd_adapter *adapter)
  28. {
  29. const char *path = adapter_get_path(adapter);
  30. DBG("path %s", path);
  31. sap_server_unregister(path);
  32. }
  33. static struct btd_profile sap_profile = {
  34. .name = "sap-server",
  35. .adapter_probe = sap_server_probe,
  36. .adapter_remove = sap_server_remove,
  37. };
  38. int sap_manager_init(void)
  39. {
  40. btd_profile_register(&sap_profile);
  41. return 0;
  42. }
  43. void sap_manager_exit(void)
  44. {
  45. btd_profile_unregister(&sap_profile);
  46. }