MS_generic_property_api.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910
  1. /**
  2. * \file MS_generic_property_api.h
  3. *
  4. * \brief This file defines the Mesh Generic User, Admin, Manufacturer and Client Property Model Application Interface
  5. * - includes Data Structures and Methods for both Server and Client.
  6. */
  7. /*
  8. * Copyright (C) 2017. Mindtree Ltd.
  9. * All rights reserved.
  10. */
  11. #ifndef _H_MS_GENERIC_PROPERTY_API_
  12. #define _H_MS_GENERIC_PROPERTY_API_
  13. /* --------------------------------------------- Header File Inclusion */
  14. #include "MS_access_api.h"
  15. /* --------------------------------------------- Global Definitions */
  16. /**
  17. * \defgroup generic_property_module GENERIC_PROPERTY (Mesh Generic Property Model)
  18. * \{
  19. * This section describes the interfaces & APIs offered by the EtherMind
  20. * Mesh Generic Property Model (GENERIC_PROPERTY) module to the Application.
  21. */
  22. /** Generic Manufacturer Properties */
  23. #define MS_GENERIC_PROP_TYPE_MANUFACTURER 0x00
  24. /** Generic Admin Properties */
  25. #define MS_GENERIC_PROP_TYPE_ADMIN 0x01
  26. /** Generic User Properties */
  27. #define MS_GENERIC_PROP_TYPE_USER 0x02
  28. /** User Access field values */
  29. /** User Access - Prohibited */
  30. #define MS_GENERIC_USER_ACCESS_PROHIBITED 0x00
  31. /** User Access - the device property can be read */
  32. #define MS_GENERIC_USER_ACCESS_READ 0x01
  33. /** User Access - the device property can be written */
  34. #define MS_GENERIC_USER_ACCESS_WRITE 0x02
  35. /** User Access - the device property can be read and written */
  36. #define MS_GENERIC_USER_ACCESS_READ_WRITE 0x03
  37. #define MS_GENERIC_USER_ACCESS_INVALID_PROPERTY_ID 0xFF
  38. /** Device Property - Light Control Time Occupancy Delay */
  39. #define MS_DEV_PROP_LIGHT_CONTROL_TIME_OCCUPANCY_DELAY 0x003A
  40. /** Device Property - Light Control Time Fade On */
  41. #define MS_DEV_PROP_LIGHT_CONTROL_TIME_FADE_ON 0x0037
  42. /** Device Property - Light Control Time Run On */
  43. #define MS_DEV_PROP_LIGHT_CONTROL_TIME_RUN_ON 0x003C
  44. /** Device Property - Light Control Time Fade */
  45. #define MS_DEV_PROP_LIGHT_CONTROL_TIME_FADE 0x0036
  46. /** Device Property - Light Control Time Prolong */
  47. #define MS_DEV_PROP_LIGHT_CONTROL_TIME_PROLONG 0x003B
  48. /** Device Property - Light Control Time Fade Standby Auto */
  49. #define MS_DEV_PROP_LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO 0x0038
  50. /** Device Property - Light Control Time Fade Standby Manual */
  51. #define MS_DEV_PROP_LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL 0x0039
  52. /** Device Property - Light Control Lightness On */
  53. #define MS_DEV_PROP_LIGHT_CONTROL_LIGHTNESS_ON 0x002E
  54. /** Device Property - Light Control Lightness Prolong */
  55. #define MS_DEV_PROP_LIGHT_CONTROL_LIGHTNESS_PROLONG 0x002F
  56. /** Device Property - Light Control Lightness Standby */
  57. #define MS_DEV_PROP_LIGHT_CONTROL_LIGHTNESS_STANDBY 0x0030
  58. /** Device Property - Light Control Ambient LuxLevel On */
  59. #define MS_DEV_PROP_LIGHT_CONTROL_AMBIENT_LUXLEVEL_ON 0x002B
  60. /** Device Property - Light Control Ambient LuxLevel Prolong */
  61. #define MS_DEV_PROP_LIGHT_CONTROL_AMBIENT_LUXLEVEL_PROLONG 0x002C
  62. /** Device Property - Light Control Ambient LuxLevel Standby */
  63. #define MS_DEV_PROP_LIGHT_CONTROL_AMBIENT_LUXLEVEL_STANDBY 0x002D
  64. /** Device Property - Light Control Regulator Kiu */
  65. #define MS_DEV_PROP_LIGHT_CONTROL_REGULATOR_KIU 0x0033
  66. /** Device Property - Light Control Regulator Kid */
  67. #define MS_DEV_PROP_LIGHT_CONTROL_REGULATOR_KID 0x0032
  68. /** Device Property - Light Control Regulator Kpu */
  69. #define MS_DEV_PROP_LIGHT_CONTROL_REGULATOR_KPU 0x0035
  70. /** Device Property - Light Control Regulator Kpd */
  71. #define MS_DEV_PROP_LIGHT_CONTROL_REGULATOR_KPD 0x0034
  72. /** Device Property - Light Control Regulator Accuracy */
  73. #define MS_DEV_PROP_LIGHT_CONTROL_REGULATOR_ACCURACY 0x0031
  74. /** Device Property - Motion Sensed */
  75. #define MS_DEV_PROP_MOTION_SENSED 0x0042
  76. /** Device Property - Time Since Motion Sensed */
  77. #define MS_DEV_PROP_TIME_SINCE_MOTION_SENSED 0x0068
  78. /** Device Property - People Count */
  79. #define MS_DEV_PROP_PEOPLE_COUNT 0x004C
  80. /** Device Property - Presence Detected */
  81. #define MS_DEV_PROP_PRESENCE_DETECTED 0x004D
  82. /** Device Property - Present Ambient Light Level */
  83. #define MS_DEV_PROP_PRESENT_AMBIENT_LIGHT_LEVEL 0x004E
  84. /* --------------------------------------------- Data Types/ Structures */
  85. /**
  86. * \defgroup generic_property_cb Application Callback
  87. * \{
  88. * This Section Describes the module Notification Callback interface offered
  89. * to the application
  90. */
  91. /**
  92. * Generic Property Server application Asynchronous Notification Callback.
  93. *
  94. * Generic Property Server calls the registered callback to indicate events occurred to the
  95. * application.
  96. *
  97. * \param [in] ctx Context of the message received for a specific model instance.
  98. * \param [in] msg_raw Uninterpreted/raw received message.
  99. * \param [in] req_type Requested message type.
  100. * \param [in] state_params Model specific state parameters.
  101. * \param [in] ext_params Additional parameters.
  102. */
  103. typedef API_RESULT (* MS_GENERIC_PROPERTY_SERVER_CB)
  104. (
  105. MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  106. MS_ACCESS_MODEL_REQ_MSG_RAW * msg_raw,
  107. MS_ACCESS_MODEL_REQ_MSG_T * req_type,
  108. MS_ACCESS_MODEL_STATE_PARAMS * state_params,
  109. MS_ACCESS_MODEL_EXT_PARAMS * ext_params
  110. ) DECL_REENTRANT;
  111. /**
  112. * Generic Property Client application Asynchronous Notification Callback.
  113. *
  114. * Generic Property Client calls the registered callback to indicate events occurred to the
  115. * application.
  116. *
  117. * \param handle Model Handle.
  118. * \param opcode Opcode.
  119. * \param data_param Data associated with the event if any or NULL.
  120. * \param data_len Size of the event data. 0 if event data is NULL.
  121. */
  122. typedef API_RESULT (* MS_GENERIC_PROPERTY_CLIENT_CB)
  123. (
  124. MS_ACCESS_MODEL_HANDLE * handle,
  125. UINT32 opcode,
  126. UCHAR * data_param,
  127. UINT16 data_len
  128. ) DECL_REENTRANT;
  129. /** \} */
  130. /**
  131. * \defgroup generic_property_structures Structures
  132. * \{
  133. */
  134. /**
  135. * Generic User Properties Status message parameters.
  136. */
  137. typedef struct MS_generic_user_properties_status_struct
  138. {
  139. /**
  140. * A sequence of N User Property IDs present within an element,
  141. * where N is the number of device property IDs included in the message.
  142. */
  143. UINT16 *user_property_ids;
  144. /** Number of User Property IDs */
  145. UINT16 user_property_ids_count;
  146. } MS_GENERIC_USER_PROPERTIES_STATUS_STRUCT;
  147. /**
  148. * Generic User Property Get message parameters.
  149. */
  150. typedef struct MS_generic_user_property_get_struct
  151. {
  152. /** Property ID identifying a Generic User Property. */
  153. UINT16 user_property_id;
  154. } MS_GENERIC_USER_PROPERTY_GET_STRUCT;
  155. /**
  156. * Generic User Property Set message parameters.
  157. */
  158. typedef struct MS_generic_user_property_set_struct
  159. {
  160. /** Property ID identifying a Generic User Property */
  161. UINT16 user_property_id;
  162. /** Raw value for the User Property */
  163. UCHAR *user_property_value;
  164. /** Raw value length for the User Property */
  165. UINT16 user_property_value_len;
  166. } MS_GENERIC_USER_PROPERTY_SET_STRUCT;
  167. /**
  168. * Generic User Property Status message parameters.
  169. */
  170. typedef struct MS_generic_user_property_status_struct
  171. {
  172. /** Property ID identifying a Generic User Property. */
  173. UINT16 user_property_id;
  174. /** Enumeration indicating user access. */
  175. UCHAR user_access;
  176. /** Raw value for the User Property */
  177. UCHAR *user_property_value;
  178. /** Raw value length for the User Property */
  179. UINT16 user_property_value_len;
  180. /** Flag: To represent if optional fields User Access and Raw Value are valid */
  181. UCHAR optional_fields_present;
  182. } MS_GENERIC_USER_PROPERTY_STATUS_STRUCT;
  183. /**
  184. * Generic Admin Properties Status message parameters.
  185. */
  186. typedef struct MS_generic_admin_properties_status_struct
  187. {
  188. /**
  189. * A sequence of N Admin Property IDs present within an element,
  190. * where N is the number of device property IDs included in the message.
  191. */
  192. UINT16 *admin_property_ids;
  193. /** Number of Admin Property IDs */
  194. UINT16 admin_property_ids_count;
  195. } MS_GENERIC_ADMIN_PROPERTIES_STATUS_STRUCT;
  196. /**
  197. * Generic Admin Property Get message parameters.
  198. */
  199. typedef struct MS_generic_admin_property_get_struct
  200. {
  201. /** Property ID identifying a Generic Admin Property. */
  202. UINT16 admin_property_id;
  203. } MS_GENERIC_ADMIN_PROPERTY_GET_STRUCT;
  204. /**
  205. * Generic Admin Property Set message parameters.
  206. */
  207. typedef struct MS_generic_admin_property_set_struct
  208. {
  209. /** Property ID identifying a Generic Admin Property. */
  210. UINT16 admin_property_id;
  211. /** Enumeration indicating user access. */
  212. UCHAR admin_user_access;
  213. /** Raw value for the Admin Property */
  214. UCHAR *admin_property_value;
  215. /** Raw value length for the Admin Property */
  216. UINT16 admin_property_value_len;
  217. } MS_GENERIC_ADMIN_PROPERTY_SET_STRUCT;
  218. /**
  219. * Generic Admin Property Status message parameters.
  220. */
  221. typedef struct MS_generic_admin_property_status_struct
  222. {
  223. /** Property ID identifying a Generic Admin Property */
  224. UINT16 admin_property_id;
  225. /** Enumeration indicating user access (Optional) */
  226. UCHAR admin_user_access;
  227. /** Raw value for the Admin Property */
  228. UCHAR *admin_property_value;
  229. /** Raw value length for the Admin Property */
  230. UINT16 admin_property_value_len;
  231. } MS_GENERIC_ADMIN_PROPERTY_STATUS_STRUCT;
  232. /**
  233. * Generic Manufacturer Properties Status message parameters.
  234. */
  235. typedef struct MS_generic_manufacturer_properties_status_struct
  236. {
  237. /**
  238. * A sequence of N Manufacturer Property IDs present within an element,
  239. * where N is the number of device property IDs included in the message.
  240. */
  241. UINT16 *manufacturer_property_ids;
  242. /** Number of Manufacturer Property IDs */
  243. UINT16 manufacturer_property_ids_count;
  244. } MS_GENERIC_MANUFACTURER_PROPERTIES_STATUS_STRUCT;
  245. /**
  246. * Generic Manufacturer Property Get message parameters.
  247. */
  248. typedef struct MS_generic_manufacturer_property_get_struct
  249. {
  250. /** Property ID identifying a Generic Manufacturer Property */
  251. UINT16 manufacturer_property_id;
  252. } MS_GENERIC_MANUFACTURER_PROPERTY_GET_STRUCT;
  253. /**
  254. * Generic Manufacturer Property Set message parameters.
  255. */
  256. typedef struct MS_generic_manufacturer_property_set_struct
  257. {
  258. /** Property ID identifying a Generic Manufacturer Property */
  259. UINT16 manufacturer_property_id;
  260. /** Enumeration indicating user access */
  261. UCHAR manufacturer_user_access;
  262. } MS_GENERIC_MANUFACTURER_PROPERTY_SET_STRUCT;
  263. /**
  264. * Generic Manufacturer Property Status message parameters.
  265. */
  266. typedef struct MS_generic_manufacturer_property_status_struct
  267. {
  268. /** Property ID identifying a Generic Manufacturer Property */
  269. UINT16 manufacturer_property_id;
  270. /** Enumeration indicating user access */
  271. UCHAR manufacturer_user_access;
  272. /** Raw value for the Manufacturer Property */
  273. UCHAR *manufacturer_property_value;
  274. /** Raw value length for the Manufacturer Property */
  275. UINT16 manufacturer_property_value_len;
  276. } MS_GENERIC_MANUFACTURER_PROPERTY_STATUS_STRUCT;
  277. /**
  278. * Generic Client Properties Get message parameters.
  279. */
  280. typedef struct MS_generic_client_properties_get_struct
  281. {
  282. /** A starting Client Property ID present within an element */
  283. UINT16 client_property_id;
  284. } MS_GENERIC_CLIENT_PROPERTIES_GET_STRUCT;
  285. /**
  286. * Generic Client Properties Status message parameters.
  287. */
  288. typedef struct MS_generic_client_properties_status_struct
  289. {
  290. /**
  291. * A sequence of N Client Property IDs present within an element,
  292. * where N is the number of device property IDs included in the message.
  293. */
  294. UINT16 *client_property_ids;
  295. /** Number of Client Property IDs */
  296. UINT16 client_property_ids_count;
  297. } MS_GENERIC_CLIENT_PROPERTIES_STATUS_STRUCT;
  298. /** \} */
  299. /* --------------------------------------------- Function */
  300. /**
  301. * \defgroup generic_property_api_defs API Definitions
  302. * \{
  303. * This section describes the EtherMind Mesh Generic Property Model APIs.
  304. */
  305. /**
  306. * \defgroup generic_user_property_ser_api_defs Generic User Property Server API Definitions
  307. * \{
  308. * This section describes the Generic User Property Server APIs.
  309. */
  310. /**
  311. * \brief API to initialize Generic_User_Property Server model
  312. *
  313. * \par Description
  314. * This is to initialize Generic_User_Property Server model and to register with Acess layer.
  315. *
  316. * \param [in] element_handle
  317. * Element identifier to be associated with the model instance.
  318. *
  319. * \param [in, out] model_handle
  320. * Model identifier associated with the model instance on successful initialization.
  321. * After power cycle of an already provisioned node, the model handle will have
  322. * valid value and the same will be reused for registration.
  323. *
  324. * \param [in] appl_cb Application Callback to be used by the Generic_User_Property Server.
  325. *
  326. * \return API_SUCCESS or an error code indicating reason for failure
  327. */
  328. API_RESULT MS_generic_user_property_server_init
  329. (
  330. /* IN */ MS_ACCESS_ELEMENT_HANDLE element_handle,
  331. /* INOUT */ MS_ACCESS_MODEL_HANDLE * model_handle,
  332. /* IN */ MS_GENERIC_PROPERTY_SERVER_CB appl_cb
  333. );
  334. /**
  335. * \brief API to initialize Generic_Admin_Property Server model
  336. *
  337. * \par Description
  338. * This is to initialize Generic_Admin_Property Server model and to register with Acess layer.
  339. *
  340. * \param [in] element_handle
  341. * Element identifier to be associated with the model instance.
  342. *
  343. * \param [in, out] model_handle
  344. * Model identifier associated with the model instance on successful initialization.
  345. * After power cycle of an already provisioned node, the model handle will have
  346. * valid value and the same will be reused for registration.
  347. *
  348. * \param [in] appl_cb Application Callback to be used by the Generic_Admin_Property Server.
  349. *
  350. * \return API_SUCCESS or an error code indicating reason for failure
  351. */
  352. API_RESULT MS_generic_admin_property_server_init
  353. (
  354. /* IN */ MS_ACCESS_ELEMENT_HANDLE element_handle,
  355. /* INOUT */ MS_ACCESS_MODEL_HANDLE * model_handle,
  356. /* IN */ MS_GENERIC_PROPERTY_SERVER_CB appl_cb
  357. );
  358. /**
  359. * \brief API to initialize Generic_Manufacturer_Property Server model
  360. *
  361. * \par Description
  362. * This is to initialize Generic_Manufacturer_Property Server model and to register with Acess layer.
  363. *
  364. * \param [in] element_handle
  365. * Element identifier to be associated with the model instance.
  366. *
  367. * \param [in, out] model_handle
  368. * Model identifier associated with the model instance on successful initialization.
  369. * After power cycle of an already provisioned node, the model handle will have
  370. * valid value and the same will be reused for registration.
  371. *
  372. * \param [in] appl_cb Application Callback to be used by the Generic_Manufacturer_Property Server.
  373. *
  374. * \return API_SUCCESS or an error code indicating reason for failure
  375. */
  376. API_RESULT MS_generic_manufacturer_property_server_init
  377. (
  378. /* IN */ MS_ACCESS_ELEMENT_HANDLE element_handle,
  379. /* INOUT */ MS_ACCESS_MODEL_HANDLE * model_handle,
  380. /* IN */ MS_GENERIC_PROPERTY_SERVER_CB appl_cb
  381. );
  382. /**
  383. * \brief API to initialize Generic_Client_Property Server model
  384. *
  385. * \par Description
  386. * This is to initialize Generic_Client_Property Server model and to register with Acess layer.
  387. *
  388. * \param [in] element_handle
  389. * Element identifier to be associated with the model instance.
  390. *
  391. * \param [in, out] model_handle
  392. * Model identifier associated with the model instance on successful initialization.
  393. * After power cycle of an already provisioned node, the model handle will have
  394. * valid value and the same will be reused for registration.
  395. *
  396. * \param [in] appl_cb Application Callback to be used by the Generic_Client_Property Server.
  397. *
  398. * \return API_SUCCESS or an error code indicating reason for failure
  399. */
  400. API_RESULT MS_generic_client_property_server_init
  401. (
  402. /* IN */ MS_ACCESS_ELEMENT_HANDLE element_handle,
  403. /* INOUT */ MS_ACCESS_MODEL_HANDLE * model_handle,
  404. /* IN */ MS_GENERIC_PROPERTY_SERVER_CB appl_cb
  405. );
  406. /**
  407. * \brief API to send reply or to update state change
  408. *
  409. * \par Description
  410. * This is to send reply for a request or to inform change in state.
  411. *
  412. * \param [in] ctx Context of the message.
  413. * \param [in] current_state_params Model specific current state parameters.
  414. * \param [in] target_state_params Model specific target state parameters (NULL: to be ignored).
  415. * \param [in] remaining_time Time from current state to target state (0: to be ignored).
  416. * \param [in] ext_params Additional parameters (NULL: to be ignored).
  417. *
  418. * \return API_SUCCESS or an error code indicating reason for failure
  419. */
  420. API_RESULT MS_generic_user_property_server_state_update
  421. (
  422. /* IN */ MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  423. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * current_state_params,
  424. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * target_state_params,
  425. /* IN */ UINT16 remaining_time,
  426. /* IN */ MS_ACCESS_MODEL_EXT_PARAMS * ext_params
  427. );
  428. /**
  429. * \brief API to send reply or to update state change
  430. *
  431. * \par Description
  432. * This is to send reply for a request or to inform change in state.
  433. *
  434. * \param [in] ctx Context of the message.
  435. * \param [in] current_state_params Model specific current state parameters.
  436. * \param [in] target_state_params Model specific target state parameters (NULL: to be ignored).
  437. * \param [in] remaining_time Time from current state to target state (0: to be ignored).
  438. * \param [in] ext_params Additional parameters (NULL: to be ignored).
  439. *
  440. * \return API_SUCCESS or an error code indicating reason for failure
  441. */
  442. API_RESULT MS_generic_admin_property_server_state_update
  443. (
  444. /* IN */ MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  445. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * current_state_params,
  446. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * target_state_params,
  447. /* IN */ UINT16 remaining_time,
  448. /* IN */ MS_ACCESS_MODEL_EXT_PARAMS * ext_params
  449. );
  450. /**
  451. * \brief API to send reply or to update state change
  452. *
  453. * \par Description
  454. * This is to send reply for a request or to inform change in state.
  455. *
  456. * \param [in] ctx Context of the message.
  457. * \param [in] current_state_params Model specific current state parameters.
  458. * \param [in] target_state_params Model specific target state parameters (NULL: to be ignored).
  459. * \param [in] remaining_time Time from current state to target state (0: to be ignored).
  460. * \param [in] ext_params Additional parameters (NULL: to be ignored).
  461. *
  462. * \return API_SUCCESS or an error code indicating reason for failure
  463. */
  464. API_RESULT MS_generic_manufacturer_property_server_state_update
  465. (
  466. /* IN */ MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  467. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * current_state_params,
  468. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * target_state_params,
  469. /* IN */ UINT16 remaining_time,
  470. /* IN */ MS_ACCESS_MODEL_EXT_PARAMS * ext_params
  471. );
  472. /**
  473. * \brief API to send reply or to update state change
  474. *
  475. * \par Description
  476. * This is to send reply for a request or to inform change in state.
  477. *
  478. * \param [in] ctx Context of the message.
  479. * \param [in] current_state_params Model specific current state parameters.
  480. * \param [in] target_state_params Model specific target state parameters (NULL: to be ignored).
  481. * \param [in] remaining_time Time from current state to target state (0: to be ignored).
  482. * \param [in] ext_params Additional parameters (NULL: to be ignored).
  483. *
  484. * \return API_SUCCESS or an error code indicating reason for failure
  485. */
  486. API_RESULT MS_generic_client_property_server_state_update
  487. (
  488. /* IN */ MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  489. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * current_state_params,
  490. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * target_state_params,
  491. /* IN */ UINT16 remaining_time,
  492. /* IN */ MS_ACCESS_MODEL_EXT_PARAMS * ext_params
  493. );
  494. /** \} */
  495. /**
  496. * \defgroup generic_property_cli_api_defs Generic Property Client API Definitions
  497. * \{
  498. * This section describes the Generic Property Client APIs.
  499. */
  500. /**
  501. * \brief API to initialize Generic_Property Client model
  502. *
  503. * \par Description
  504. * This is to initialize Generic_Property Client model and to register with Acess layer.
  505. *
  506. * \param [in] element_handle
  507. * Element identifier to be associated with the model instance.
  508. *
  509. * \param [in, out] model_handle
  510. * Model identifier associated with the model instance on successful initialization.
  511. * After power cycle of an already provisioned node, the model handle will have
  512. * valid value and the same will be reused for registration.
  513. *
  514. * \param [in] appl_cb Application Callback to be used by the Generic_Property Client.
  515. *
  516. * \return API_SUCCESS or an error code indicating reason for failure
  517. */
  518. API_RESULT MS_generic_property_client_init
  519. (
  520. /* IN */ MS_ACCESS_ELEMENT_HANDLE element_handle,
  521. /* INOUT */ MS_ACCESS_MODEL_HANDLE * model_handle,
  522. /* IN */ MS_GENERIC_PROPERTY_CLIENT_CB appl_cb
  523. );
  524. /**
  525. * \brief API to get Generic_Property client model handle
  526. *
  527. * \par Description
  528. * This is to get the handle of Generic_Property client model.
  529. *
  530. * \param [out] model_handle Address of model handle to be filled/returned.
  531. *
  532. * \return API_SUCCESS or an error code indicating reason for failure
  533. */
  534. API_RESULT MS_generic_property_client_get_model_handle
  535. (
  536. /* OUT */ MS_ACCESS_MODEL_HANDLE * model_handle
  537. );
  538. /**
  539. * \brief API to send acknowledged commands
  540. *
  541. * \par Description
  542. * This is to initialize sending acknowledged commands.
  543. *
  544. * \param [in] req_opcode Request Opcode.
  545. * \param [in] param Parameter associated with Request Opcode.
  546. * \param [in] rsp_opcode Response Opcode.
  547. *
  548. * \return API_SUCCESS or an error code indicating reason for failure
  549. */
  550. API_RESULT MS_generic_property_client_send_reliable_pdu
  551. (
  552. /* IN */ UINT32 req_opcode,
  553. /* IN */ void * param,
  554. /* IN */ UINT32 rsp_opcode
  555. );
  556. /**
  557. * \brief API to get the list of Generic User Property states of an element.
  558. *
  559. * \par Description
  560. * Generic User Properties Get is an acknowledged message used to get the list of Generic User Property states of an element.
  561. * The response to the Generic User Properties Get message is a Generic User Properties Status message.
  562. * The message has no parameters.
  563. *
  564. * \return API_SUCCESS or an error code indicating reason for failure
  565. */
  566. #define MS_generic_user_properties_get() \
  567. MS_generic_property_client_send_reliable_pdu \
  568. (\
  569. MS_ACCESS_GENERIC_USER_PROPERTIES_GET_OPCODE,\
  570. NULL,\
  571. MS_ACCESS_GENERIC_USER_PROPERTIES_STATUS_OPCODE\
  572. )
  573. /**
  574. * \brief API to get the Generic User Property state of an element.
  575. *
  576. * \par Description
  577. * Generic User Property Get is an acknowledged message used to get the Generic User Property state of an element.
  578. * The response to the Generic User Property Get message is a Generic User Property Status message.
  579. *
  580. * \param [in] param Generic User Property Get message
  581. *
  582. * \return API_SUCCESS or an error code indicating reason for failure
  583. */
  584. #define MS_generic_user_property_get(param) \
  585. MS_generic_property_client_send_reliable_pdu \
  586. (\
  587. MS_ACCESS_GENERIC_USER_PROPERTY_GET_OPCODE,\
  588. param,\
  589. MS_ACCESS_GENERIC_USER_PROPERTY_STATUS_OPCODE\
  590. )
  591. /**
  592. * \brief API to set the Generic User Property state of an element.
  593. *
  594. * \par Description
  595. * Generic User Property Set is an acknowledged message used to set the Generic User Property state of an element.
  596. * The response to the Generic User Property Set message is a Generic User Property Status message.
  597. *
  598. * \param [in] param Generic User Property Set message
  599. *
  600. * \return API_SUCCESS or an error code indicating reason for failure
  601. */
  602. #define MS_generic_user_property_set(param) \
  603. MS_generic_property_client_send_reliable_pdu \
  604. (\
  605. MS_ACCESS_GENERIC_USER_PROPERTY_SET_OPCODE,\
  606. param,\
  607. MS_ACCESS_GENERIC_USER_PROPERTY_STATUS_OPCODE\
  608. )
  609. /**
  610. * \brief API to set the Generic User Property state of an element.
  611. *
  612. * \par Description
  613. * Generic User Property Set Unacknowledged is an unacknowledged message used to set
  614. * the Generic User Property state of an element.
  615. *
  616. * \param [in] param Generic User Property Set message
  617. *
  618. * \return API_SUCCESS or an error code indicating reason for failure
  619. */
  620. #define MS_generic_user_property_set_unacknowledged(param) \
  621. MS_generic_property_client_send_reliable_pdu \
  622. (\
  623. MS_ACCESS_GENERIC_USER_PROPERTY_SET_UNACKNOWLEDGED_OPCODE,\
  624. param,\
  625. 0xFFFFFFFF\
  626. )
  627. /**
  628. * \brief API to get the list of Generic Admin Property states of an element.
  629. *
  630. * \par Description
  631. * Generic Admin Properties Get is an acknowledged message used to get the list of Generic Admin Property states of an element.
  632. * The response to the Generic Admin Properties Get message is a Generic Admin Properties Status message.
  633. * The message has no parameters.
  634. *
  635. * \return API_SUCCESS or an error code indicating reason for failure
  636. */
  637. #define MS_generic_admin_properties_get() \
  638. MS_generic_property_client_send_reliable_pdu \
  639. (\
  640. MS_ACCESS_GENERIC_ADMIN_PROPERTIES_GET_OPCODE,\
  641. NULL,\
  642. MS_ACCESS_GENERIC_ADMIN_PROPERTIES_STATUS_OPCODE\
  643. )
  644. /**
  645. * \brief API to get the Generic Admin Property state of an element.
  646. *
  647. * \par Description
  648. * Generic Admin Property Get is an acknowledged message used to get the Generic Admin Property state of an element.
  649. * The response to the Generic Admin Property Get message is a Generic Admin Property Status message.
  650. *
  651. * \param [in] param Generic Admin Property Get message
  652. *
  653. * \return API_SUCCESS or an error code indicating reason for failure
  654. */
  655. #define MS_generic_admin_property_get(param) \
  656. MS_generic_property_client_send_reliable_pdu \
  657. (\
  658. MS_ACCESS_GENERIC_ADMIN_PROPERTY_GET_OPCODE,\
  659. param,\
  660. MS_ACCESS_GENERIC_ADMIN_PROPERTY_STATUS_OPCODE\
  661. )
  662. /**
  663. * \brief API to set the Generic Admin Property state of an element.
  664. *
  665. * \par Description
  666. * Generic Admin Property Set is an acknowledged message used to set the Generic Admin Property state of an element.
  667. * The response to the Generic Admin Property Set message is a Generic Admin Property Status message.
  668. *
  669. * \param [in] param Generic Admin Property Set message
  670. *
  671. * \return API_SUCCESS or an error code indicating reason for failure
  672. */
  673. #define MS_generic_admin_property_set(param) \
  674. MS_generic_property_client_send_reliable_pdu \
  675. (\
  676. MS_ACCESS_GENERIC_ADMIN_PROPERTY_SET_OPCODE,\
  677. param,\
  678. MS_ACCESS_GENERIC_ADMIN_PROPERTY_STATUS_OPCODE\
  679. )
  680. /**
  681. * \brief API to set the Generic Admin Property state of an element.
  682. *
  683. * \par Description
  684. * Generic Admin Property Set Unacknowledged is an unacknowledged message used to set
  685. * the Generic Admin Property state of an element.
  686. *
  687. * \param [in] param Generic Admin Property Set message
  688. *
  689. * \return API_SUCCESS or an error code indicating reason for failure
  690. */
  691. #define MS_generic_admin_property_set_unacknowledged(param) \
  692. MS_generic_property_client_send_reliable_pdu \
  693. (\
  694. MS_ACCESS_GENERIC_ADMIN_PROPERTY_SET_UNACKNOWLEDGED_OPCODE,\
  695. param,\
  696. 0xFFFFFFFF\
  697. )
  698. /**
  699. * \brief API to get the list of Generic Manufacturer Property states of an element.
  700. *
  701. * \par Description
  702. * Generic Manufacturer Properties Get is an acknowledged message used to get
  703. * the list of Generic Manufacturer Property states of an element.
  704. * The response to the Generic Manufacturer Properties Get message
  705. * is a Generic Manufacturer Properties Status message.
  706. * The message has no parameters.
  707. *
  708. * \return API_SUCCESS or an error code indicating reason for failure
  709. */
  710. #define MS_generic_manufacturer_properties_get() \
  711. MS_generic_property_client_send_reliable_pdu \
  712. (\
  713. MS_ACCESS_GENERIC_MANUFACTURER_PROPERTIES_GET_OPCODE,\
  714. NULL,\
  715. MS_ACCESS_GENERIC_MANUFACTURER_PROPERTIES_STATUS_OPCODE\
  716. )
  717. /**
  718. * \brief API to get the Generic Manufacturer Property state of an element.
  719. *
  720. * \par Description
  721. * Generic Manufacturer Property Get is an acknowledged message used to get the Generic Manufacturer Property state of an element.
  722. * The response to the Generic Manufacturer Property Get message is a Generic Manufacturer Property Status message.
  723. *
  724. * \param [in] param Generic Manufacturer Property Get message
  725. *
  726. * \return API_SUCCESS or an error code indicating reason for failure
  727. */
  728. #define MS_generic_manufacturer_property_get(param) \
  729. MS_generic_property_client_send_reliable_pdu \
  730. (\
  731. MS_ACCESS_GENERIC_MANUFACTURER_PROPERTY_GET_OPCODE,\
  732. param,\
  733. MS_ACCESS_GENERIC_MANUFACTURER_PROPERTY_STATUS_OPCODE\
  734. )
  735. /**
  736. * \brief API to the Generic Manufacturer Property User Access state of an element.
  737. *
  738. * \par Description
  739. * Generic Manufacturer Property Set is an acknowledged message used to set the Generic Manufacturer Property User Access state of an element.
  740. * The response to the Generic Manufacturer Property Set message is a Generic Manufacturer Property Status message.
  741. *
  742. * \param [in] param Generic Manufacturer Property Set message
  743. *
  744. * \return API_SUCCESS or an error code indicating reason for failure
  745. */
  746. #define MS_generic_manufacturer_property_set(param) \
  747. MS_generic_property_client_send_reliable_pdu \
  748. (\
  749. MS_ACCESS_GENERIC_MANUFACTURER_PROPERTY_SET_OPCODE,\
  750. param,\
  751. MS_ACCESS_GENERIC_MANUFACTURER_PROPERTY_STATUS_OPCODE\
  752. )
  753. /**
  754. * \brief API to the Generic Manufacturer Property User Access state of an element.
  755. *
  756. * \par Description
  757. * The Generic Manufacturer Property Set Unacknowledged is an unacknowledged message used to set the Generic Manufacturer Property User Access state of an element.
  758. *
  759. * \param [in] param Generic Manufacturer Property Set message
  760. *
  761. * \return API_SUCCESS or an error code indicating reason for failure
  762. */
  763. #define MS_generic_manufacturer_property_set_unacknowledged(param) \
  764. MS_generic_property_client_send_reliable_pdu \
  765. (\
  766. MS_ACCESS_GENERIC_MANUFACTURER_PROPERTY_SET_UNACKNOWLEDGED_OPCODE,\
  767. param,\
  768. 0xFFFFFFFF\
  769. )
  770. /**
  771. * \brief API to get the list of Generic Client Property states of an element.
  772. *
  773. * \par Description
  774. * Generic Client Properties Get is an acknowledged message used to get the list of Generic Client Property states of an element.
  775. * The response to the Generic Client Properties Get message is a Generic Client Properties Status message.
  776. *
  777. * \param [in] param Generic Client Properties Get message
  778. *
  779. * \return API_SUCCESS or an error code indicating reason for failure
  780. */
  781. #define MS_generic_client_properties_get(param) \
  782. MS_generic_property_client_send_reliable_pdu \
  783. (\
  784. MS_ACCESS_GENERIC_CLIENT_PROPERTIES_GET_OPCODE,\
  785. param,\
  786. MS_ACCESS_GENERIC_CLIENT_PROPERTIES_STATUS_OPCODE\
  787. )
  788. /** \} */
  789. /** \} */
  790. /** \} */
  791. #endif /*_H_MS_GENERIC_PROPERTY_API_ */