phymodel_client.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /**
  2. * \file appl_config_client.h
  3. *
  4. * \brief This file defines the Mesh Configuration Model Application Interface
  5. * - includes Data Structures and Methods for both Server and Client.
  6. */
  7. /*
  8. * Copyright (C) 2018. Mindtree Ltd.
  9. * All rights reserved.
  10. */
  11. #ifndef _H_PHYMODEL_CLIENT_
  12. #define _H_PHYMODEL_CLIENT_
  13. #include "phymodel_common.h"
  14. #include "MS_access_api.h"
  15. #include "access_extern.h"
  16. /* --------------------------------------------- Header File Inclusion */
  17. /* --------------------------------------------- Global Definitions */
  18. /* --------------------------------------------- Data Types/ Structures */
  19. /**
  20. * Vendor Example Server application Asynchronous Notification Callback.
  21. *
  22. * Vendor Example Server calls the registered callback to indicate events occurred to the
  23. * application.
  24. *
  25. * \param [in] ctx Context of the message received for a specific model instance.
  26. * \param [in] msg_raw Uninterpreted/raw received message.
  27. * \param [in] req_type Requested message type.
  28. * \param [in] state_params Model specific state parameters.
  29. * \param [in] ext_params Additional parameters.
  30. */
  31. typedef API_RESULT (* MS_PHY_MODEL_CLIENT_CB)
  32. (
  33. MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  34. MS_ACCESS_MODEL_REQ_MSG_RAW * msg_raw,
  35. MS_ACCESS_MODEL_REQ_MSG_T * req_type,
  36. MS_ACCESS_PHY_MODEL_STATE_PARAMS * state_params,
  37. MS_ACCESS_MODEL_EXT_PARAMS * ext_params
  38. ) DECL_REENTRANT;
  39. /* ----------------------------------------- Functions */
  40. /**
  41. * \brief API to send reply or to update state change
  42. *
  43. * \par Description
  44. * This is to send reply for a request or to inform change in state.
  45. *
  46. * \param [in] ctx Context of the message.
  47. * \param [in] current_state_params Model specific current state parameters.
  48. * \param [in] target_state_params Model specific target state parameters (NULL: to be ignored).
  49. * \param [in] remaining_time Time from current state to target state (0: to be ignored).
  50. * \param [in] ext_params Additional parameters (NULL: to be ignored).
  51. *
  52. * \return API_SUCCESS or an error code indicating reason for failure
  53. */
  54. API_RESULT MS_phy_model_client_state_update
  55. (
  56. /* IN */ MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  57. /* IN */ MS_ACCESS_PHY_MODEL_STATE_PARAMS * current_state_params,
  58. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * target_state_params,
  59. /* IN */ UINT16 remaining_time,
  60. /* IN */ MS_ACCESS_MODEL_EXT_PARAMS * ext_params,
  61. /* IN */ UINT16 data_length
  62. );
  63. /**
  64. * \brief API to send acknowledged commands
  65. *
  66. * \par Description
  67. * This is to initialize sending acknowledged commands.
  68. *
  69. * \param [in] req_opcode Request Opcode.
  70. * \param [in] param Parameter associated with Request Opcode.
  71. * \param [in] rsp_opcode Response Opcode.
  72. *
  73. * \return API_SUCCESS or an error code indicating reason for failure
  74. */
  75. API_RESULT MS_phymodel_client_send_reliable_pdu
  76. (
  77. /* IN */ UINT32 req_opcode,
  78. /* IN */ void * param,
  79. /* IN */ MS_NET_ADDR dst_addr
  80. );
  81. /* --------------------------------------------- Function */
  82. API_RESULT MS_phy_model_client_init
  83. (
  84. /* IN */ MS_ACCESS_ELEMENT_HANDLE element_handle,
  85. /* INOUT */ MS_ACCESS_MODEL_HANDLE * model_handle,
  86. /* IN */ MS_PHY_MODEL_CLIENT_CB UI_cb
  87. );
  88. #endif /*_H_APPL_CONFIG_CLIENT_ */