fsm_engine.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /**
  2. * \file fsm_engine.h
  3. *
  4. * This file defines interface offered by the FSM module.
  5. */
  6. /*
  7. * Copyright (C) 2013. Mindtree Ltd.
  8. * All rights reserved.
  9. */
  10. #ifndef _H_FSM_ENGINE_
  11. #define _H_FSM_ENGINE_
  12. /* --------------------------------------------- Header File Inclusion */
  13. #include "MS_common.h"
  14. #include "fsm_defines.h"
  15. #ifndef FSM_NO_DEBUG
  16. #ifdef VAR_ARG_IN_MACRO_NOT_SUPPORTED
  17. #define FSM_ERR
  18. #else
  19. #define FSM_ERR(...) EM_debug_error(MS_MODULE_ID_FSM,__VA_ARGS__)
  20. #endif /* VAR_ARG_IN_MACRO_NOT_SUPPORTED */
  21. #else /* FSM_NO_DEBUG */
  22. #define FSM_ERR EM_debug_null
  23. #endif /* FSM_NO_DEBUG */
  24. #ifdef FSM_DEBUG
  25. #define FSM_TRC(...) EM_debug_trace(BT_MODULE_ID_FSM,__VA_ARGS__)
  26. #define FSM_INF(...) EM_debug_info(BT_MODULE_ID_FSM,__VA_ARGS__)
  27. #else /* FSM_DEBUG */
  28. #ifdef VAR_ARG_IN_MACRO_NOT_SUPPORTED
  29. #define FSM_TRC
  30. #define FSM_INF
  31. #else
  32. #define FSM_TRC EM_debug_null
  33. #define FSM_INF EM_debug_null
  34. #endif /* VAR_ARG_IN_MACRO_NOT_SUPPORTED */
  35. #endif /* FSM_DEBUG */
  36. /* --------------------------------------------- Functions */
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40. void ms_fsm_init (void);
  41. API_RESULT ms_fsm_register_module
  42. (
  43. /* IN */ DECL_CONST FSM_MODULE_TABLE_T * module_fsm,
  44. /* OUT */ UCHAR * fsm_id
  45. );
  46. API_RESULT ms_fsm_post_event
  47. (
  48. UCHAR fsm_id,
  49. EVENT_T fsm_event,
  50. void * param
  51. );
  52. #ifdef __cplusplus
  53. };
  54. #endif
  55. #endif /* _H_FSM_ENGINE_ */