phymodel_server.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /**
  2. * \file appl_generic_onoff_server.h
  3. */
  4. /*
  5. * Copyright (C) 2017. Mindtree Ltd.
  6. * All rights reserved.
  7. */
  8. #ifndef _H_PHYMODEL_SERVER_
  9. #define _H_PHYMODEL_SERVER_
  10. /* --------------------------------------------- Header File Inclusion */
  11. #include "phymodel_common.h"
  12. #include "MS_access_api.h"
  13. #include "access_extern.h"
  14. /* --------------------------------------------- Global Definitions */
  15. /* --------------------------------------------- Data Types/ Structures */
  16. /**
  17. * Vendor Example Server application Asynchronous Notification Callback.
  18. *
  19. * Vendor Example Server calls the registered callback to indicate events occurred to the
  20. * application.
  21. *
  22. * \param [in] ctx Context of the message received for a specific model instance.
  23. * \param [in] msg_raw Uninterpreted/raw received message.
  24. * \param [in] req_type Requested message type.
  25. * \param [in] state_params Model specific state parameters.
  26. * \param [in] ext_params Additional parameters.
  27. */
  28. typedef API_RESULT (* MS_PHY_MODEL_SERVER_CB)
  29. (
  30. MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  31. MS_ACCESS_MODEL_REQ_MSG_RAW * msg_raw,
  32. MS_ACCESS_MODEL_REQ_MSG_T * req_type,
  33. MS_ACCESS_PHY_MODEL_STATE_PARAMS * state_params,
  34. MS_ACCESS_MODEL_EXT_PARAMS * ext_params
  35. ) DECL_REENTRANT;
  36. /* ----------------------------------------- Functions */
  37. /**
  38. * \brief API to send reply or to update state change
  39. *
  40. * \par Description
  41. * This is to send reply for a request or to inform change in state.
  42. *
  43. * \param [in] ctx Context of the message.
  44. * \param [in] current_state_params Model specific current state parameters.
  45. * \param [in] target_state_params Model specific target state parameters (NULL: to be ignored).
  46. * \param [in] remaining_time Time from current state to target state (0: to be ignored).
  47. * \param [in] ext_params Additional parameters (NULL: to be ignored).
  48. *
  49. * \return API_SUCCESS or an error code indicating reason for failure
  50. */
  51. API_RESULT MS_phy_model_server_state_update
  52. (
  53. /* IN */ MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  54. /* IN */ MS_ACCESS_PHY_MODEL_STATE_PARAMS * current_state_params,
  55. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * target_state_params,
  56. /* IN */ UINT16 remaining_time,
  57. /* IN */ MS_ACCESS_MODEL_EXT_PARAMS * ext_params,
  58. /* IN */ UINT16 data_length
  59. );
  60. /* --------------------------------------------- Function */
  61. API_RESULT MS_phy_model_server_init
  62. (
  63. /* IN */ MS_ACCESS_ELEMENT_HANDLE element_handle,
  64. /* INOUT */ MS_ACCESS_MODEL_HANDLE * model_handle,
  65. /* IN */ MS_PHY_MODEL_SERVER_CB UI_cb
  66. );
  67. #endif /*_H_APPL_GENERIC_ONOFF_SERVER_ */