MS_light_hsl_api.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963
  1. /**
  2. * \file MS_light_hsl_api.h
  3. *
  4. * \brief This file defines the Mesh Light Hsl 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_LIGHT_HSL_API_
  12. #define _H_MS_LIGHT_HSL_API_
  13. /* --------------------------------------------- Header File Inclusion */
  14. #include "MS_access_api.h"
  15. /* --------------------------------------------- Global Definitions */
  16. /**
  17. * \defgroup light_hsl_module LIGHT_HSL (Mesh Light Hsl Model)
  18. * \{
  19. * This section describes the interfaces & APIs offered by the EtherMind
  20. * Mesh Generic OnOff Model (ONOFF) module to the Application.
  21. */
  22. /* --------------------------------------------- Data Types/ Structures */
  23. /**
  24. * \defgroup light_hsl_cb Application Callback
  25. * \{
  26. * This Section Describes the module Notification Callback interface offered
  27. * to the application
  28. */
  29. /**
  30. * Light Hsl Server application Asynchronous Notification Callback.
  31. *
  32. * Light Hsl Server calls the registered callback to indicate events occurred to the
  33. * application.
  34. *
  35. * \param [in] ctx Context of the message received for a specific model instance.
  36. * \param [in] msg_raw Uninterpreted/raw received message.
  37. * \param [in] req_type Requested message type.
  38. * \param [in] state_params Model specific state parameters.
  39. * \param [in] ext_params Additional parameters.
  40. */
  41. typedef API_RESULT (* MS_LIGHT_HSL_SERVER_CB)
  42. (
  43. MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  44. MS_ACCESS_MODEL_REQ_MSG_RAW * msg_raw,
  45. MS_ACCESS_MODEL_REQ_MSG_T * req_type,
  46. MS_ACCESS_MODEL_STATE_PARAMS * state_params,
  47. MS_ACCESS_MODEL_EXT_PARAMS * ext_params
  48. ) DECL_REENTRANT;
  49. /**
  50. * Light Hsl Hue Server application Asynchronous Notification Callback.
  51. *
  52. * Light Hsl Hue Server calls the registered callback to indicate events occurred to the
  53. * application.
  54. *
  55. * \param [in] ctx Context of the message received for a specific model instance.
  56. * \param [in] msg_raw Uninterpreted/raw received message.
  57. * \param [in] req_type Requested message type.
  58. * \param [in] state_params Model specific state parameters.
  59. * \param [in] ext_params Additional parameters.
  60. */
  61. typedef API_RESULT (* MS_LIGHT_HSL_HUE_SERVER_CB)
  62. (
  63. MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  64. MS_ACCESS_MODEL_REQ_MSG_RAW * msg_raw,
  65. MS_ACCESS_MODEL_REQ_MSG_T * req_type,
  66. MS_ACCESS_MODEL_STATE_PARAMS * state_params,
  67. MS_ACCESS_MODEL_EXT_PARAMS * ext_params
  68. ) DECL_REENTRANT;
  69. /**
  70. * Light Hsl Saturation Server application Asynchronous Notification Callback.
  71. *
  72. * Light Hsl Saturation Server calls the registered callback to indicate events occurred to the
  73. * application.
  74. *
  75. * \param [in] ctx Context of the message received for a specific model instance.
  76. * \param [in] msg_raw Uninterpreted/raw received message.
  77. * \param [in] req_type Requested message type.
  78. * \param [in] state_params Model specific state parameters.
  79. * \param [in] ext_params Additional parameters.
  80. */
  81. typedef API_RESULT (* MS_LIGHT_HSL_SATURATION_SERVER_CB)
  82. (
  83. MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  84. MS_ACCESS_MODEL_REQ_MSG_RAW * msg_raw,
  85. MS_ACCESS_MODEL_REQ_MSG_T * req_type,
  86. MS_ACCESS_MODEL_STATE_PARAMS * state_params,
  87. MS_ACCESS_MODEL_EXT_PARAMS * ext_params
  88. ) DECL_REENTRANT;
  89. /**
  90. * Light Hsl Client application Asynchronous Notification Callback.
  91. *
  92. * Light Hsl Client calls the registered callback to indicate events occurred to the
  93. * application.
  94. *
  95. * \param handle Model Handle.
  96. * \param opcode Opcode.
  97. * \param data_param Data associated with the event if any or NULL.
  98. * \param data_len Size of the event data. 0 if event data is NULL.
  99. */
  100. typedef API_RESULT (* MS_LIGHT_HSL_CLIENT_CB)
  101. (
  102. MS_ACCESS_MODEL_HANDLE * handle,
  103. UINT32 opcode,
  104. UCHAR * data_param,
  105. UINT16 data_len
  106. ) DECL_REENTRANT;
  107. /** \} */
  108. /**
  109. * \defgroup light_hsl_structures Structures
  110. * \{
  111. */
  112. /**
  113. * Light HSL Set message parameters.
  114. */
  115. typedef struct MS_light_hsl_set_struct
  116. {
  117. /** The target value of the Light HSL Lightness state */
  118. UINT16 hsl_lightness;
  119. /** The target value of the Light HSL Hue state */
  120. UINT16 hsl_hue;
  121. /** The target value of the Light HSL Saturation state */
  122. UINT16 hsl_saturation;
  123. /** Transaction Identifier */
  124. UCHAR tid;
  125. /**
  126. * Transition Time is a 1-octet value that consists of two fields:
  127. * - a 2-bit bit field representing the step resolution
  128. * - a 6-bit bit field representing the number of transition steps.
  129. *
  130. * Field | Size (bits) | Description
  131. * ---------------------------|-------------|----------------
  132. * Transition Number of Steps | 6 | The number of Steps
  133. * Transition Step Resolution | 2 | The resolution of the Default Transition
  134. * | Number of Steps field
  135. */
  136. UCHAR transition_time;
  137. /** Message execution delay in 5 milliseconds steps */
  138. UCHAR delay;
  139. /** Flag: To represent if optional Transaction time and Delay fields are valid */
  140. UCHAR optional_fields_present;
  141. } MS_LIGHT_HSL_SET_STRUCT;
  142. /**
  143. * Light HSL Status message parameters.
  144. */
  145. typedef struct MS_light_hsl_status_struct
  146. {
  147. /** The present value of the Light HSL Lightness state */
  148. UINT16 hsl_lightness;
  149. /** The present value of the Light HSL Hue state */
  150. UINT16 hsl_hue;
  151. /** The present value of the Light HSL Saturation state */
  152. UINT16 hsl_saturation;
  153. /**
  154. * Remaining Time is a 1-octet value that consists of two fields:
  155. * - a 2-bit bit field representing the step resolution
  156. * - a 6-bit bit field representing the number of transition steps.
  157. *
  158. * Field | Size (bits) | Description
  159. * ---------------------------|-------------|----------------
  160. * Transition Number of Steps | 6 | The number of Steps
  161. * Transition Step Resolution | 2 | The resolution of the Default Transition
  162. * | Number of Steps field
  163. */
  164. UCHAR remaining_time;
  165. /** Flag: To represent if optional field Remaining Time is valid */
  166. UCHAR optional_fields_present;
  167. } MS_LIGHT_HSL_STATUS_STRUCT;
  168. /**
  169. * Light HSL Target Status message parameters.
  170. */
  171. typedef struct MS_light_hsl_target_status_struct
  172. {
  173. /** The target value of the Light HSL Lightness state */
  174. UINT16 hsl_lightness_target;
  175. /** The target value of the Light HSL Hue state */
  176. UINT16 hsl_hue_target;
  177. /** The target Light HSL Saturation state */
  178. UINT16 hsl_saturation_target;
  179. /**
  180. * Remaining Time is a 1-octet value that consists of two fields:
  181. * - a 2-bit bit field representing the step resolution
  182. * - a 6-bit bit field representing the number of transition steps.
  183. *
  184. * Field | Size (bits) | Description
  185. * ---------------------------|-------------|----------------
  186. * Transition Number of Steps | 6 | The number of Steps
  187. * Transition Step Resolution | 2 | The resolution of the Default Transition
  188. * | Number of Steps field
  189. */
  190. UCHAR remaining_time;
  191. /** Flag: To represent if optional field Remaining Time is valid */
  192. UCHAR optional_fields_present;
  193. } MS_LIGHT_HSL_TARGET_STATUS_STRUCT;
  194. /**
  195. * Light HSL Default Set message parameters.
  196. */
  197. typedef struct MS_light_hsl_default_set_struct
  198. {
  199. /** The value of the Light Lightness Default state */
  200. UINT16 lightness;
  201. /** The value of the Light HSL Hue Default state */
  202. UINT16 hue;
  203. /** The value of the Light HSL Saturation Default state */
  204. UINT16 saturation;
  205. } MS_LIGHT_HSL_DEFAULT_SET_STRUCT;
  206. /**
  207. * Light HSL Default Status message parameters.
  208. */
  209. typedef struct MS_light_hsl_default_status_struct
  210. {
  211. /** The value of the Light Lightness Default state */
  212. UINT16 lightness;
  213. /** The value of the Light HSL Hue Default state */
  214. UINT16 hue;
  215. /** The value of the Light HSL Saturation Default state */
  216. UINT16 saturation;
  217. } MS_LIGHT_HSL_DEFAULT_STATUS_STRUCT;
  218. /**
  219. * Light HSL Range Set message parameters.
  220. */
  221. typedef struct MS_light_hsl_range_set_struct
  222. {
  223. /** The value of the Hue Range Min field of the Light HSL Hue Range state */
  224. UINT16 hue_range_min;
  225. /** The value of the Hue Range Max field of the Light HSL Hue Range state */
  226. UINT16 hue_range_max;
  227. /** The value of the Saturation Range Min field of the Light HSL Saturation Range state */
  228. UINT16 saturation_range_min;
  229. /** The value of the Saturation Range Max field of the Light HSL Saturation Range state */
  230. UINT16 saturation_range_max;
  231. } MS_LIGHT_HSL_RANGE_SET_STRUCT;
  232. /**
  233. * Light HSL Range Status message parameters.
  234. */
  235. typedef struct MS_light_hsl_range_status_struct
  236. {
  237. /** Status Code for the requesting message. */
  238. UCHAR status_code;
  239. /** The value of the Hue Range Min field of the Light HSL Hue Range state */
  240. UINT16 hue_range_min;
  241. /** The value of the Hue Range Max field of the Light HSL Hue Range state */
  242. UINT16 hue_range_max;
  243. /** The value of the Saturation Range Min field of the Light HSL Saturation Range state */
  244. UINT16 saturation_range_min;
  245. /** The value of the Saturation Range Max field of the Light HSL Saturation Range state */
  246. UINT16 saturation_range_max;
  247. } MS_LIGHT_HSL_RANGE_STATUS_STRUCT;
  248. /**
  249. * Light HSL Hue Set message parameters.
  250. */
  251. typedef struct MS_light_hsl_hue_set_struct
  252. {
  253. /** The target value of the Light HSL Hue state. */
  254. UINT16 hue;
  255. /** Transaction Identifier */
  256. UCHAR tid;
  257. /**
  258. * Transition Time is a 1-octet value that consists of two fields:
  259. * - a 2-bit bit field representing the step resolution
  260. * - a 6-bit bit field representing the number of transition steps.
  261. *
  262. * Field | Size (bits) | Description
  263. * ---------------------------|-------------|----------------
  264. * Transition Number of Steps | 6 | The number of Steps
  265. * Transition Step Resolution | 2 | The resolution of the Default Transition
  266. * | Number of Steps field
  267. */
  268. UCHAR transition_time;
  269. /** Message execution delay in 5 milliseconds steps */
  270. UCHAR delay;
  271. /** Flag: To represent if optional Transaction time and Delay fields are valid */
  272. UCHAR optional_fields_present;
  273. } MS_LIGHT_HSL_HUE_SET_STRUCT;
  274. /**
  275. * Light HSL Hue Status message parameters.
  276. */
  277. typedef struct MS_light_hsl_hue_status_struct
  278. {
  279. /** The present value of the Light HSL Hue state */
  280. UINT16 present_hue;
  281. /** The target value of the Light HSL Hue state (Optional) */
  282. UINT16 target_hue;
  283. /**
  284. * Remaining Time is a 1-octet value that consists of two fields:
  285. * - a 2-bit bit field representing the step resolution
  286. * - a 6-bit bit field representing the number of transition steps.
  287. *
  288. * Field | Size (bits) | Description
  289. * ---------------------------|-------------|----------------
  290. * Transition Number of Steps | 6 | The number of Steps
  291. * Transition Step Resolution | 2 | The resolution of the Default Transition
  292. * | Number of Steps field
  293. */
  294. UCHAR remaining_time;
  295. /** Flag: To represent if optional fields Target Hue and Remaining Time are valid */
  296. UCHAR optional_fields_present;
  297. } MS_LIGHT_HSL_HUE_STATUS_STRUCT;
  298. /**
  299. * Light HSL Saturation Set message parameters.
  300. */
  301. typedef struct MS_light_hsl_saturation_set_struct
  302. {
  303. /** The target value of the Light HSL Saturation state. */
  304. UINT16 saturation;
  305. /** Transaction Identifier */
  306. UCHAR tid;
  307. /**
  308. * Transition Time is a 1-octet value that consists of two fields:
  309. * - a 2-bit bit field representing the step resolution
  310. * - a 6-bit bit field representing the number of transition steps.
  311. *
  312. * Field | Size (bits) | Description
  313. * ---------------------------|-------------|----------------
  314. * Transition Number of Steps | 6 | The number of Steps
  315. * Transition Step Resolution | 2 | The resolution of the Default Transition
  316. * | Number of Steps field
  317. */
  318. UCHAR transition_time;
  319. /** Message execution delay in 5 milliseconds steps */
  320. UCHAR delay;
  321. /** Flag: To represent if optional Transaction time and Delay fields are valid */
  322. UCHAR optional_fields_present;
  323. } MS_LIGHT_HSL_SATURATION_SET_STRUCT;
  324. /**
  325. * Light HSL Saturation Status message parameters.
  326. */
  327. typedef struct MS_light_hsl_saturation_status_struct
  328. {
  329. /** The present value of the Light HSL Saturation state. */
  330. UINT16 present_saturation;
  331. /** The target value of the Light HSL Saturation state. (Optional) */
  332. UINT16 target_saturation;
  333. /**
  334. * Remaining Time is a 1-octet value that consists of two fields:
  335. * - a 2-bit bit field representing the step resolution
  336. * - a 6-bit bit field representing the number of transition steps.
  337. *
  338. * Field | Size (bits) | Description
  339. * ---------------------------|-------------|----------------
  340. * Transition Number of Steps | 6 | The number of Steps
  341. * Transition Step Resolution | 2 | The resolution of the Default Transition
  342. * | Number of Steps field
  343. */
  344. UCHAR remaining_time;
  345. /** Flag: To represent if optional fields Target Saturation and Remaining Time are valid */
  346. UCHAR optional_fields_present;
  347. } MS_LIGHT_HSL_SATURATION_STATUS_STRUCT;
  348. /** \} */
  349. /* --------------------------------------------- Function */
  350. /**
  351. * \defgroup light_hsl_api_defs API Definitions
  352. * \{
  353. * This section describes the EtherMind Mesh Light Hsl Model APIs.
  354. */
  355. /**
  356. * \defgroup light_hsl_ser_api_defs Light Hsl Server API Definitions
  357. * \{
  358. * This section describes the Light Hsl Server APIs.
  359. */
  360. /**
  361. * \brief API to initialize Light_Hsl Server model
  362. *
  363. * \par Description
  364. * This is to initialize Light_Hsl Server model and to register with Acess layer.
  365. *
  366. * \param [in] element_handle
  367. * Element identifier to be associated with the model instance.
  368. *
  369. * \param [in, out] hsl_model_handle
  370. * Model identifier associated with the Light HSL model instance on successful initialization.
  371. * After power cycle of an already provisioned node, the model handle will have
  372. * valid value and the same will be reused for registration.
  373. *
  374. * \param [in, out] hsl_setup_model_handle
  375. * Model identifier associated with the Light HSL Setup model instance on successful initialization.
  376. * After power cycle of an already provisioned node, the model handle will have
  377. * valid value and the same will be reused for registration.
  378. *
  379. * \param [in] appl_cb Application Callback to be used by the Light_Hsl Server.
  380. *
  381. * \return API_SUCCESS or an error code indicating reason for failure
  382. */
  383. API_RESULT MS_light_hsl_server_init
  384. (
  385. /* IN */ MS_ACCESS_ELEMENT_HANDLE element_handle,
  386. /* INOUT */ MS_ACCESS_MODEL_HANDLE * hsl_model_handle,
  387. /* INOUT */ MS_ACCESS_MODEL_HANDLE * hsl_setup_model_handle,
  388. /* IN */ MS_LIGHT_HSL_SERVER_CB appl_cb
  389. );
  390. /**
  391. * \brief API to initialize Light_Hsl_Hue Server model
  392. *
  393. * \par Description
  394. * This is to initialize Light_Hsl_Hue Server model and to register with Acess layer.
  395. *
  396. * \param [in] element_handle
  397. * Element identifier to be associated with the model instance.
  398. *
  399. * \param [in, out] model_handle
  400. * Model identifier associated with the model instance on successful initialization.
  401. * After power cycle of an already provisioned node, the model handle will have
  402. * valid value and the same will be reused for registration.
  403. *
  404. * \param [in] appl_cb Application Callback to be used by the Light_Hsl_Hue Server.
  405. *
  406. * \return API_SUCCESS or an error code indicating reason for failure
  407. */
  408. API_RESULT MS_light_hsl_hue_server_init
  409. (
  410. /* IN */ MS_ACCESS_ELEMENT_HANDLE element_handle,
  411. /* INOUT */ MS_ACCESS_MODEL_HANDLE * model_handle,
  412. /* IN */ MS_LIGHT_HSL_HUE_SERVER_CB appl_cb
  413. );
  414. /**
  415. * \brief API to initialize Light_Hsl_Saturation Server model
  416. *
  417. * \par Description
  418. * This is to initialize Light_Hsl_Saturation Server model and to register with Acess layer.
  419. *
  420. * \param [in] element_handle
  421. * Element identifier to be associated with the model instance.
  422. *
  423. * \param [in, out] model_handle
  424. * Model identifier associated with the model instance on successful initialization.
  425. * After power cycle of an already provisioned node, the model handle will have
  426. * valid value and the same will be reused for registration.
  427. *
  428. * \param [in] appl_cb Application Callback to be used by the Light_Hsl_Saturation Server.
  429. *
  430. * \return API_SUCCESS or an error code indicating reason for failure
  431. */
  432. API_RESULT MS_light_hsl_saturation_server_init
  433. (
  434. /* IN */ MS_ACCESS_ELEMENT_HANDLE element_handle,
  435. /* INOUT */ MS_ACCESS_MODEL_HANDLE * model_handle,
  436. /* IN */ MS_LIGHT_HSL_SATURATION_SERVER_CB appl_cb
  437. );
  438. /**
  439. * \brief API to send reply or to update state change
  440. *
  441. * \par Description
  442. * This is to send reply for a request or to inform change in state.
  443. *
  444. * \param [in] ctx Context of the message.
  445. * \param [in] current_state_params Model specific current state parameters.
  446. * \param [in] target_state_params Model specific target state parameters (NULL: to be ignored).
  447. * \param [in] remaining_time Time from current state to target state (0: to be ignored).
  448. * \param [in] ext_params Additional parameters (NULL: to be ignored).
  449. *
  450. * \return API_SUCCESS or an error code indicating reason for failure
  451. */
  452. API_RESULT MS_light_hsl_server_state_update
  453. (
  454. /* IN */ MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  455. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * current_state_params,
  456. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * target_state_params,
  457. /* IN */ UINT16 remaining_time,
  458. /* IN */ MS_ACCESS_MODEL_EXT_PARAMS * ext_params
  459. );
  460. /**
  461. * \brief API to send reply or to update state change
  462. *
  463. * \par Description
  464. * This is to send reply for a request or to inform change in state.
  465. *
  466. * \param [in] ctx Context of the message.
  467. * \param [in] current_state_params Model specific current state parameters.
  468. * \param [in] target_state_params Model specific target state parameters (NULL: to be ignored).
  469. * \param [in] remaining_time Time from current state to target state (0: to be ignored).
  470. * \param [in] ext_params Additional parameters (NULL: to be ignored).
  471. *
  472. * \return API_SUCCESS or an error code indicating reason for failure
  473. */
  474. API_RESULT MS_light_hsl_hue_server_state_update
  475. (
  476. /* IN */ MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  477. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * current_state_params,
  478. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * target_state_params,
  479. /* IN */ UINT16 remaining_time,
  480. /* IN */ MS_ACCESS_MODEL_EXT_PARAMS * ext_params
  481. );
  482. /**
  483. * \brief API to send reply or to update state change
  484. *
  485. * \par Description
  486. * This is to send reply for a request or to inform change in state.
  487. *
  488. * \param [in] ctx Context of the message.
  489. * \param [in] current_state_params Model specific current state parameters.
  490. * \param [in] target_state_params Model specific target state parameters (NULL: to be ignored).
  491. * \param [in] remaining_time Time from current state to target state (0: to be ignored).
  492. * \param [in] ext_params Additional parameters (NULL: to be ignored).
  493. *
  494. * \return API_SUCCESS or an error code indicating reason for failure
  495. */
  496. API_RESULT MS_light_hsl_saturation_server_state_update
  497. (
  498. /* IN */ MS_ACCESS_MODEL_REQ_MSG_CONTEXT * ctx,
  499. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * current_state_params,
  500. /* IN */ MS_ACCESS_MODEL_STATE_PARAMS * target_state_params,
  501. /* IN */ UINT16 remaining_time,
  502. /* IN */ MS_ACCESS_MODEL_EXT_PARAMS * ext_params
  503. );
  504. /** \} */
  505. /**
  506. * \defgroup light_hsl_cli_api_defs Light Hsl Client API Definitions
  507. * \{
  508. * This section describes the Light Hsl Client APIs.
  509. */
  510. /**
  511. * \brief API to initialize Light_Hsl Client model
  512. *
  513. * \par Description
  514. * This is to initialize Light_Hsl Client model and to register with Acess layer.
  515. *
  516. * \param [in] element_handle
  517. * Element identifier to be associated with the model instance.
  518. *
  519. * \param [in, out] model_handle
  520. * Model identifier associated with the model instance on successful initialization.
  521. * After power cycle of an already provisioned node, the model handle will have
  522. * valid value and the same will be reused for registration.
  523. *
  524. * \param [in] appl_cb Application Callback to be used by the Light_Hsl Client.
  525. *
  526. * \return API_SUCCESS or an error code indicating reason for failure
  527. */
  528. API_RESULT MS_light_hsl_client_init
  529. (
  530. /* IN */ MS_ACCESS_ELEMENT_HANDLE element_handle,
  531. /* INOUT */ MS_ACCESS_MODEL_HANDLE * model_handle,
  532. /* IN */ MS_LIGHT_HSL_CLIENT_CB appl_cb
  533. );
  534. /**
  535. * \brief API to get Light_Hsl client model handle
  536. *
  537. * \par Description
  538. * This is to get the handle of Light_Hsl client model.
  539. *
  540. * \param [out] model_handle Address of model handle to be filled/returned.
  541. *
  542. * \return API_SUCCESS or an error code indicating reason for failure
  543. */
  544. API_RESULT MS_light_hsl_client_get_model_handle
  545. (
  546. /* OUT */ MS_ACCESS_MODEL_HANDLE * model_handle
  547. );
  548. /**
  549. * \brief API to send acknowledged commands
  550. *
  551. * \par Description
  552. * This is to initialize sending acknowledged commands.
  553. *
  554. * \param [in] req_opcode Request Opcode.
  555. * \param [in] param Parameter associated with Request Opcode.
  556. * \param [in] rsp_opcode Response Opcode.
  557. *
  558. * \return API_SUCCESS or an error code indicating reason for failure
  559. */
  560. API_RESULT MS_light_hsl_client_send_reliable_pdu
  561. (
  562. /* IN */ UINT32 req_opcode,
  563. /* IN */ void * param,
  564. /* IN */ UINT32 rsp_opcode
  565. );
  566. /**
  567. * \brief API to get the Light HSL Lightness, Light HSL Hue, and Light HSL Saturation states of an element.
  568. *
  569. * \par Description
  570. * The Light HSL Get is an acknowledged message used to get the Light HSL Lightness, Light HSL Hue, and Light HSL Saturation states of an element.
  571. * The response to the Light HSL Get message is a Light HSL Status message.
  572. * There are no parameters for this message.
  573. *
  574. * \return API_SUCCESS or an error code indicating reason for failure
  575. */
  576. #define MS_light_hsl_get() \
  577. MS_light_hsl_client_send_reliable_pdu \
  578. (\
  579. MS_ACCESS_LIGHT_HSL_GET_OPCODE,\
  580. NULL,\
  581. MS_ACCESS_LIGHT_HSL_STATUS_OPCODE\
  582. )
  583. /**
  584. * \brief API to set the Light HSL Lightness state, Light HSL Hue state, and the Light HSL Saturation state of an element.
  585. *
  586. * \par Description
  587. * The Light HSL Set Unacknowledged is an unacknowledged message used to set the Light HSL Lightness state, Light HSL Hue state,
  588. * and the Light HSL Saturation state of an element.
  589. *
  590. * \param [in] param Light HSL Set message
  591. *
  592. * \return API_SUCCESS or an error code indicating reason for failure
  593. */
  594. #define MS_light_hsl_set(param) \
  595. MS_light_hsl_client_send_reliable_pdu \
  596. (\
  597. MS_ACCESS_LIGHT_HSL_SET_OPCODE,\
  598. param,\
  599. MS_ACCESS_LIGHT_HSL_STATUS_OPCODE\
  600. )
  601. /**
  602. * \brief API to set the Light HSL Lightness state, Light HSL Hue state, and the Light HSL Saturation state of an element.
  603. *
  604. * \par Description
  605. * The Light HSL Set is an acknowledged message used to set the Light HSL Lightness state, Light HSL Hue state,
  606. * and the Light HSL Saturation state of an element.
  607. * The response to the Light HSL Set message is a Light HSL Status message.
  608. *
  609. * \param [in] param Light HSL Set message
  610. *
  611. * \return API_SUCCESS or an error code indicating reason for failure
  612. */
  613. #define MS_light_hsl_set_unacknowledged(param) \
  614. MS_light_hsl_client_send_reliable_pdu \
  615. (\
  616. MS_ACCESS_LIGHT_HSL_SET_UNACKNOWLEDGED_OPCODE,\
  617. param,\
  618. 0xFFFFFFFF\
  619. )
  620. /**
  621. * \brief API to get the target Light HSL Lightness, Light HSL Hue, and Light HSL Saturation states of an element.
  622. *
  623. * \par Description
  624. * Light HSL Target Get is an acknowledged message used to get the target Light HSL Lightness, Light HSL Hue,
  625. * and Light HSL Saturation states of an element.
  626. * The response to the Light HSL Target Get message is a Light HSL Target Status message.
  627. * There are no parameters for this message.
  628. *
  629. * \return API_SUCCESS or an error code indicating reason for failure
  630. */
  631. #define MS_light_hsl_target_get() \
  632. MS_light_hsl_client_send_reliable_pdu \
  633. (\
  634. MS_ACCESS_LIGHT_HSL_TARGET_GET_OPCODE,\
  635. NULL,\
  636. MS_ACCESS_LIGHT_HSL_TARGET_STATUS_OPCODE\
  637. )
  638. /**
  639. * \brief API to to get the Light Lightness Default, the Light HSL Hue Default, and Light HSL Saturation Default states of an element.
  640. *
  641. * \par Description
  642. * Light HSL Default Get is an acknowledged message used to get the Light Lightness Default, the Light HSL Hue Default,
  643. * and Light HSL Saturation Default states of an element.
  644. * The response to the Light HSL Default Get message is a Light HSL Default Status message.
  645. * There are no parameters for this message.
  646. *
  647. * \return API_SUCCESS or an error code indicating reason for failure
  648. */
  649. #define MS_light_hsl_default_get() \
  650. MS_light_hsl_client_send_reliable_pdu \
  651. (\
  652. MS_ACCESS_LIGHT_HSL_DEFAULT_GET_OPCODE,\
  653. NULL,\
  654. MS_ACCESS_LIGHT_HSL_DEFAULT_STATUS_OPCODE\
  655. )
  656. /**
  657. * \brief API to set the Light Lightness Default, the Light HSL Hue Default, and Light HSL Saturation Default states of an element.
  658. *
  659. * \par Description
  660. * Light HSL Default Set is an acknowledged message used to set the Light Lightness Default, the Light HSL Hue Default,
  661. * and Light HSL Saturation Default states of an element.
  662. * The response to the Light HSL Default Set message is a Light HSL Default Status message.
  663. *
  664. * \param [in] param Light HSL Default Set message
  665. *
  666. * \return API_SUCCESS or an error code indicating reason for failure
  667. */
  668. #define MS_light_hsl_default_set(param) \
  669. MS_light_hsl_client_send_reliable_pdu \
  670. (\
  671. MS_ACCESS_LIGHT_HSL_DEFAULT_SET_OPCODE,\
  672. param,\
  673. MS_ACCESS_LIGHT_HSL_DEFAULT_STATUS_OPCODE\
  674. )
  675. /**
  676. * \brief API to set the Light Lightness Default, the Light HSL Hue Default, and Light HSL Saturation Default states of an element.
  677. *
  678. * \par Description
  679. * Light HSL Default Set Unacknowledged is an unacknowledged message used to set the Light Lightness Default, the Light HSL Hue Default,
  680. * and Light HSL Saturation Default states of an element.
  681. *
  682. * \param [in] param Light HSL Default Set message
  683. *
  684. * \return API_SUCCESS or an error code indicating reason for failure
  685. */
  686. #define MS_light_hsl_default_set_unacknowledged(param) \
  687. MS_light_hsl_client_send_reliable_pdu \
  688. (\
  689. MS_ACCESS_LIGHT_HSL_DEFAULT_SET_UNACKNOWLEDGED_OPCODE,\
  690. param,\
  691. 0xFFFFFFFF\
  692. )
  693. /**
  694. * \brief API to get the Light HSL Hue Range and Light HSL Saturation Range states of an element.
  695. *
  696. * \par Description
  697. * The Light HSL Range Get is an acknowledged message used to get the Light HSL Hue Range and Light HSL Saturation Range states of an element.
  698. * The response to the Light HSL Range Get message is a Light HSL Range Status message.
  699. * There are no parameters for this message.
  700. *
  701. * \return API_SUCCESS or an error code indicating reason for failure
  702. */
  703. #define MS_light_hsl_range_get() \
  704. MS_light_hsl_client_send_reliable_pdu \
  705. (\
  706. MS_ACCESS_LIGHT_HSL_RANGE_GET_OPCODE,\
  707. NULL,\
  708. MS_ACCESS_LIGHT_HSL_RANGE_STATUS_OPCODE\
  709. )
  710. /**
  711. * \brief API to set the Light HSL Hue Range and Light HSL Saturation Range states of an element.
  712. *
  713. * \par Description
  714. * Light HSL Range Set is an acknowledged message used to set the Light HSL Hue Range and Light HSL Saturation Range states of an element.
  715. * The response to the Light HSL Range Set message is a Light HSL Range Status message.
  716. *
  717. * \param [in] param Light HSL Range Set message
  718. *
  719. * \return API_SUCCESS or an error code indicating reason for failure
  720. */
  721. #define MS_light_hsl_range_set(param) \
  722. MS_light_hsl_client_send_reliable_pdu \
  723. (\
  724. MS_ACCESS_LIGHT_HSL_RANGE_SET_OPCODE,\
  725. param,\
  726. MS_ACCESS_LIGHT_HSL_RANGE_STATUS_OPCODE\
  727. )
  728. /**
  729. * \brief API to set the Light HSL Hue Range and Light HSL Saturation Range states of an element.
  730. *
  731. * \par Description
  732. * Light HSL Range Set Unacknowledged is an unacknowledged message used to set the Light HSL Hue Range and Light HSL Saturation Range states of an element.
  733. *
  734. * \param [in] param Light HSL Range Set message
  735. *
  736. * \return API_SUCCESS or an error code indicating reason for failure
  737. */
  738. #define MS_light_hsl_range_set_unacknowledged(param) \
  739. MS_light_hsl_client_send_reliable_pdu \
  740. (\
  741. MS_ACCESS_LIGHT_HSL_RANGE_SET_UNACKNOWLEDGED_OPCODE,\
  742. param,\
  743. 0xFFFFFFFF\
  744. )
  745. /**
  746. * \brief API to get the Light HSL Hue state of an element.
  747. *
  748. * \par Description
  749. * The Light HSL Hue Get is an acknowledged message used to get the Light HSL Hue state of an element.
  750. * The response to the Light HSL Hue Get message is a Light HSL Hue Status message.
  751. * There are no parameters for this message.
  752. *
  753. * \return API_SUCCESS or an error code indicating reason for failure
  754. */
  755. #define MS_light_hsl_hue_get() \
  756. MS_light_hsl_client_send_reliable_pdu \
  757. (\
  758. MS_ACCESS_LIGHT_HSL_HUE_GET_OPCODE,\
  759. NULL,\
  760. MS_ACCESS_LIGHT_HSL_HUE_STATUS_OPCODE\
  761. )
  762. /**
  763. * \brief API to set the target Light HSL Hue state of an element.
  764. *
  765. * \par Description
  766. * The Light HSL Hue Set is an acknowledged message used to set the target Light HSL Hue state of an element.
  767. * The response to the Light HSL Hue Set message is a Light HSL Hue Status message.
  768. *
  769. * \param [in] param Light HSL Hue Set message
  770. *
  771. * \return API_SUCCESS or an error code indicating reason for failure
  772. */
  773. #define MS_light_hsl_hue_set(param) \
  774. MS_light_hsl_client_send_reliable_pdu \
  775. (\
  776. MS_ACCESS_LIGHT_HSL_HUE_SET_OPCODE,\
  777. param,\
  778. MS_ACCESS_LIGHT_HSL_HUE_STATUS_OPCODE\
  779. )
  780. /**
  781. * \brief API to set the target Light HSL Hue state of an element.
  782. *
  783. * \par Description
  784. * The Light HSL Hue Set Unacknowledged is an unacknowledged message used to
  785. * set the target Light HSL Hue state of an element.
  786. *
  787. * \param [in] param Light HSL Hue Set message
  788. *
  789. * \return API_SUCCESS or an error code indicating reason for failure
  790. */
  791. #define MS_light_hsl_hue_set_unacknowledged(param) \
  792. MS_light_hsl_client_send_reliable_pdu \
  793. (\
  794. MS_ACCESS_LIGHT_HSL_HUE_SET_UNACKNOWLEDGED_OPCODE,\
  795. param,\
  796. 0xFFFFFFFF\
  797. )
  798. /**
  799. * \brief API to get the Light HSL Saturation state of an element.
  800. *
  801. * \par Description
  802. * The Light HSL Saturation Get is an acknowledged message used to get the Light HSL Saturation state of an element.
  803. * The response to the Light HSL Saturation Get message is a Light HSL Saturation Status message.
  804. * There are no parameters for this message.
  805. *
  806. * \return API_SUCCESS or an error code indicating reason for failure
  807. */
  808. #define MS_light_hsl_saturation_get() \
  809. MS_light_hsl_client_send_reliable_pdu \
  810. (\
  811. MS_ACCESS_LIGHT_HSL_SATURATION_GET_OPCODE,\
  812. NULL,\
  813. MS_ACCESS_LIGHT_HSL_SATURATION_STATUS_OPCODE\
  814. )
  815. /**
  816. * \brief API to set the target Light HSL Saturation state of an element.
  817. *
  818. * \par Description
  819. * The Light HSL Saturation Set is an acknowledged message used to set the target Light HSL Saturation state of an element.
  820. * The response to the Light HSL Saturation Set message is a Light HSL Saturation Status message.
  821. *
  822. * \param [in] param Light HSL Saturation Set message
  823. *
  824. * \return API_SUCCESS or an error code indicating reason for failure
  825. */
  826. #define MS_light_hsl_saturation_set(param) \
  827. MS_light_hsl_client_send_reliable_pdu \
  828. (\
  829. MS_ACCESS_LIGHT_HSL_SATURATION_SET_OPCODE,\
  830. param,\
  831. MS_ACCESS_LIGHT_HSL_SATURATION_STATUS_OPCODE\
  832. )
  833. /**
  834. * \brief API to set the target Light HSL Saturation state of an element.
  835. *
  836. * \par Description
  837. * The Light HSL Saturation Set Unacknowledged is an unacknowledged message
  838. * used to set the target Light HSL Saturation state of an element.
  839. *
  840. * \param [in] param Light HSL Saturation Set message
  841. *
  842. * \return API_SUCCESS or an error code indicating reason for failure
  843. */
  844. #define MS_light_hsl_saturation_set_unacknowledged(param) \
  845. MS_light_hsl_client_send_reliable_pdu \
  846. (\
  847. MS_ACCESS_LIGHT_HSL_SATURATION_SET_UNACKNOWLEDGED_OPCODE,\
  848. param,\
  849. 0xFFFFFFFF\
  850. )
  851. /** \} */
  852. /** \} */
  853. /** \} */
  854. #endif /*_H_MS_LIGHT_HSL_API_ */