rdbd_service_manager.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) 2018, Real-Thread Information Technology Ltd
  3. * All rights reserved
  4. *
  5. * This software is dual-licensed: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation. For the terms of this
  8. * license, see <http://www.gnu.org/licenses/>.
  9. *
  10. * You are free to use this software under the terms of the GNU General
  11. * Public License, but WITHOUT ANY WARRANTY; without even the implied
  12. * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * Alternatively, you can license this software under a commercial
  16. * license, please send mail to business@rt-thread.com for contact.
  17. *
  18. * Change Logs:
  19. * Date Author Notes
  20. * 2018-09-25 ZYH the first version
  21. */
  22. #ifndef __RDBD_SERVICE_MANAGER_H__
  23. #define __RDBD_SERVICE_MANAGER_H__
  24. #include <rtthread.h>
  25. #include <rdbd_service.h>
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. enum rdbd_service_control_cmd
  30. {
  31. RDBD_SERVICE_START = 1,
  32. RDBD_SERVICE_STOP = 2,
  33. RDBD_SERVICE_SUSPEND = 3,
  34. RDBD_SERVICE_RESUME = 4,
  35. RDBD_SERVICE_GET_STATUS = 5,
  36. };
  37. extern int rdbd_service_control(struct rdbd_service * service, int cmd, void * args);
  38. extern int rdbd_service_install(rdbd_t rdbd, struct rdbd_service * service);
  39. extern int rdbd_service_uninstall(struct rdbd_service * service);
  40. extern struct rdbd_service * rdbd_service_find(rdbd_t rdbd, const char * name);
  41. extern struct rdbd_service * rdbd_service_get(rdbd_t rdbd, rt_uint8_t service_id);
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif