MS_config_api.h 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780
  1. /**
  2. * \file MS_config_api.h
  3. *
  4. * \brief This file defines the Mesh Configuration Foundation 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_CONFIG_API_
  12. #define _H_MS_CONFIG_API_
  13. /* --------------------------------------------- Header File Inclusion */
  14. /* Access Layer */
  15. #include "MS_access_api.h"
  16. /* --------------------------------------------- Global Definitions */
  17. /**
  18. * \defgroup config_module CONFIG (Mesh Configuration Model)
  19. * \{
  20. * This section describes the interfaces & APIs offered by the EtherMind
  21. * Mesh Configuration Model (CONFIG) module to the Application.
  22. */
  23. /**
  24. * \defgroup config_defines Defines
  25. * \{
  26. * Describes defines for the module.
  27. */
  28. /**
  29. * \defgroup config_constants Constants
  30. * \{
  31. * Describes Constants defined by the module.
  32. */
  33. /**
  34. * \defgroup config_status Status Codes
  35. * \{
  36. * This section lists the Status Codes applicable at the Configuration Model.
  37. */
  38. /** \} */
  39. /** \} */
  40. /** \} */
  41. /**
  42. * \defgroup config_events Events
  43. * \{
  44. * This section lists the Asynchronous Events notified to Application by the
  45. * Module.
  46. */
  47. /** \} */
  48. /**
  49. * \defgroup config_marcos Utility Macros
  50. * \{
  51. * This section defines the utility macros for use by the application.
  52. *
  53. */
  54. /** \} */
  55. /* --------------------------------------------- Data Types/ Structures */
  56. /**
  57. * \defgroup config_cb Application Callback
  58. * \{
  59. * This Section Describes the module Notification Callback interface offered
  60. * to the application
  61. */
  62. /**
  63. * Configuration Client application Asynchronous Notification Callback.
  64. *
  65. * Configuration Client calls the registered callback to indicate events occurred to the
  66. * application.
  67. *
  68. * \param handle Model Handle.
  69. * \param opcode Opcode.
  70. * \param data_param Data associated with the event if any or NULL.
  71. * \param data_len Size of the event data. 0 if event data is NULL.
  72. */
  73. typedef API_RESULT (* MS_CONFIG_MODEL_CB)
  74. (
  75. MS_ACCESS_MODEL_HANDLE * handle,
  76. UINT32 opcode,
  77. UCHAR * data_param,
  78. UINT16 data_len
  79. ) DECL_REENTRANT;
  80. /** \} */
  81. /**
  82. * \defgroup config_structures Structures
  83. * \{
  84. */
  85. /**
  86. * \defgroup config_cli_structs Configuration Client Data Structures
  87. * \{
  88. * This section describes the data structures for use in Configuration Client APIs.
  89. */
  90. /**
  91. * Beacon Set parameter structure
  92. */
  93. typedef struct _ACCESS_CONFIG_BEACON_SET_PARAM
  94. {
  95. /** New Secure Network Beacon state */
  96. UCHAR beacon;
  97. } ACCESS_CONFIG_BEACON_SET_PARAM;
  98. /**
  99. * Composition Data Get parameter structure
  100. */
  101. typedef struct _ACCESS_CONFIG_COMPDATA_GET_PARAM
  102. {
  103. /** Page number of the Composition Data */
  104. UCHAR page;
  105. } ACCESS_CONFIG_COMPDATA_GET_PARAM;
  106. /**
  107. * Default TTL Set parameter structure
  108. */
  109. typedef struct _ACCESS_CONFIG_DEFAULT_TTL_SET_PARAM
  110. {
  111. /** New Default TTL value */
  112. UCHAR ttl;
  113. } ACCESS_CONFIG_DEFAULT_TTL_SET_PARAM;
  114. /**
  115. * GATT Proxy Set parameter structure
  116. */
  117. typedef struct _ACCESS_CONFIG_GATT_PROXY_SET_PARAM
  118. {
  119. /** New GATT Proxy state */
  120. UCHAR proxy;
  121. } ACCESS_CONFIG_GATT_PROXY_SET_PARAM;
  122. /**
  123. * Relay Set parameter structure
  124. */
  125. typedef struct _ACCESS_CONFIG_RELAY_SET_PARAM
  126. {
  127. /** Relay */
  128. UCHAR relay;
  129. /**
  130. * Number of retransmissions on advertising bearer for
  131. * each Network PDU relayed by the node
  132. * - 3 bits validity
  133. */
  134. UCHAR relay_rtx_count;
  135. /**
  136. * Number of 10-millisecond steps between retransmissions
  137. * - 5 bits validity
  138. */
  139. UCHAR relay_rtx_interval_steps;
  140. } ACCESS_CONFIG_RELAY_SET_PARAM;
  141. /**
  142. * Model Publication Get parameter structure
  143. */
  144. typedef struct _ACCESS_CONFIG_MODELPUB_GET_PARAM
  145. {
  146. /** Address of the element */
  147. UINT16 element_address;
  148. /** SIG Model ID or Vendor Model ID */
  149. MS_ACCESS_MODEL_ID model;
  150. } ACCESS_CONFIG_MODELPUB_GET_PARAM;
  151. /**
  152. * Model Publication Set parameter structure
  153. */
  154. typedef struct _ACCESS_CONFIG_MODELPUB_SET_PARAM
  155. {
  156. /** Address of the element */
  157. UINT16 element_address;
  158. /** Value of the publish address */
  159. UINT16 publish_address;
  160. /**
  161. * Index of the application key
  162. * - 12 bits validity
  163. */
  164. UINT16 appkey_index;
  165. /**
  166. * Value of the Friendship Credential Flag
  167. * - 1 bit validity
  168. */
  169. UCHAR credential_flag;
  170. /** Default TTL value for the outgoing messages */
  171. UCHAR publish_ttl;
  172. /** Period for periodic status publishing */
  173. UCHAR publish_period;
  174. /**
  175. * Number of retransmissions for each published message
  176. * - 3 bits validity
  177. */
  178. UCHAR publish_rtx_count;
  179. /**
  180. * Number of 50-millisecond steps between retransmissions
  181. * - 5 bits validity
  182. */
  183. UCHAR publish_rtx_interval_steps;
  184. /** SIG Model ID or Vendor Model ID */
  185. MS_ACCESS_MODEL_ID model;
  186. } ACCESS_CONFIG_MODELPUB_SET_PARAM;
  187. /**
  188. * Model Publication Virtual Address Set parameter structure
  189. */
  190. typedef struct _ACCESS_CONFIG_MODELPUB_VADDR_SET_PARAM
  191. {
  192. /** Address of the element */
  193. UINT16 element_address;
  194. /** Value of the Label UUID publish address */
  195. UCHAR publish_address[MS_ACCESS_VADDR_LABEL_UUID_SIZE];
  196. /**
  197. * Index of the application key
  198. * - 12 bits validity
  199. */
  200. UINT16 appkey_index;
  201. /**
  202. * Value of the Friendship Credential Flag
  203. * - 1 bit validity
  204. */
  205. UCHAR credential_flag;
  206. /** Default TTL value for the outgoing messages */
  207. UCHAR publish_ttl;
  208. /** Period for periodic status publishing */
  209. UCHAR publish_period;
  210. /**
  211. * Number of retransmissions for each published message
  212. * - 3 bits validity
  213. */
  214. UCHAR publish_rtx_count;
  215. /**
  216. * Number of 50-millisecond steps between retransmissions
  217. * - 5 bits validity
  218. */
  219. UCHAR publish_rtx_interval_steps;
  220. /** SIG Model ID or Vendor Model ID */
  221. MS_ACCESS_MODEL_ID model;
  222. } ACCESS_CONFIG_MODELPUB_VADDR_SET_PARAM;
  223. /**
  224. * Model Subscription Add parameter structure
  225. */
  226. typedef struct _ACCESS_CONFIG_MODELSUB_ADD_PARAM
  227. {
  228. /** Address of the element */
  229. UINT16 element_address;
  230. /** Value of the address */
  231. UINT16 address;
  232. /** SIG Model ID or Vendor Model ID */
  233. MS_ACCESS_MODEL_ID model;
  234. } ACCESS_CONFIG_MODELSUB_ADD_PARAM;
  235. /**
  236. * Model Subscription Virtual Address Add parameter structure
  237. */
  238. typedef struct _ACCESS_CONFIG_MODELSUB_VADDR_ADD_PARAM
  239. {
  240. /** Address of the element */
  241. UINT16 element_address;
  242. /** Value of the Label UUID */
  243. UCHAR label[MS_ACCESS_VADDR_LABEL_UUID_SIZE];
  244. /** SIG Model ID or Vendor Model ID */
  245. MS_ACCESS_MODEL_ID model;
  246. } ACCESS_CONFIG_MODELSUB_VADDR_ADD_PARAM;
  247. /**
  248. * Model Subscription Delete parameter structure
  249. */
  250. typedef struct _ACCESS_CONFIG_MODELSUB_DEL_PARAM
  251. {
  252. /** Address of the element */
  253. UINT16 element_address;
  254. /** Value of the address */
  255. UINT16 address;
  256. /** SIG Model ID or Vendor Model ID */
  257. MS_ACCESS_MODEL_ID model;
  258. } ACCESS_CONFIG_MODELSUB_DEL_PARAM;
  259. /**
  260. * Model Subscription Virtual Address Delete parameter structure
  261. */
  262. typedef struct _ACCESS_CONFIG_MODELSUB_VADDR_DEL_PARAM
  263. {
  264. /** Address of the element */
  265. UINT16 element_address;
  266. /** Value of the Label UUID */
  267. UCHAR label[MS_ACCESS_VADDR_LABEL_UUID_SIZE];
  268. /** SIG Model ID or Vendor Model ID */
  269. MS_ACCESS_MODEL_ID model;
  270. } ACCESS_CONFIG_MODELSUB_VADDR_DEL_PARAM;
  271. /**
  272. * Model Subscription Overwrite parameter structure
  273. */
  274. typedef struct _ACCESS_CONFIG_MODELSUB_OVERWRITE_PARAM
  275. {
  276. /** Address of the element */
  277. UINT16 element_address;
  278. /** Value of the address */
  279. UINT16 address;
  280. /** SIG Model ID or Vendor Model ID */
  281. MS_ACCESS_MODEL_ID model;
  282. } ACCESS_CONFIG_MODELSUB_OVERWRITE_PARAM;
  283. /**
  284. * Model Subscription Virtual Address Overwrite parameter structure
  285. */
  286. typedef struct _ACCESS_CONFIG_MODELSUB_VADDR_OVERWRITE_PARAM
  287. {
  288. /** Address of the element */
  289. UINT16 element_address;
  290. /** Value of the Label UUID */
  291. UCHAR label[MS_ACCESS_VADDR_LABEL_UUID_SIZE];
  292. /** SIG Model ID or Vendor Model ID */
  293. MS_ACCESS_MODEL_ID model;
  294. } ACCESS_CONFIG_MODELSUB_VADDR_OVERWRITE_PARAM;
  295. /**
  296. * Model Subscription Delete All parameter structure
  297. */
  298. typedef struct _ACCESS_CONFIG_MODELSUB_DELETEALL_PARAM
  299. {
  300. /** Address of the element */
  301. UINT16 element_address;
  302. /** SIG Model ID or Vendor Model ID */
  303. MS_ACCESS_MODEL_ID model;
  304. } ACCESS_CONFIG_MODELSUB_DELETEALL_PARAM;
  305. /**
  306. * SIG Model Subscription Get parameter structure
  307. */
  308. typedef struct _ACCESS_CONFIG_SIGMODELSUB_GET_PARAM
  309. {
  310. /** Address of the element */
  311. UINT16 element_address;
  312. /** SIG Model ID */
  313. MS_ACCESS_MODEL_ID_SIG model_id;
  314. } ACCESS_CONFIG_SIGMODELSUB_GET_PARAM;
  315. /**
  316. * Vendor Model Subscription Get parameter structure
  317. */
  318. typedef struct _ACCESS_CONFIG_VENDORMODELSUB_GET_PARAM
  319. {
  320. /** Address of the element */
  321. UINT16 element_address;
  322. /** Vendor Model ID */
  323. MS_ACCESS_MODEL_ID_VENDOR model_id;
  324. } ACCESS_CONFIG_VENDORMODELSUB_GET_PARAM;
  325. /**
  326. * Netkey Add parameter structure
  327. */
  328. typedef struct _ACCESS_CONFIG_NETKEY_ADD_PARAM
  329. {
  330. /** Netkey */
  331. UCHAR netkey[MS_ACCESS_NETKEY_SIZE];
  332. /** Netkey Index */
  333. UINT16 netkey_index;
  334. } ACCESS_CONFIG_NETKEY_ADD_PARAM;
  335. /**
  336. * Netkey Update parameter structure
  337. */
  338. typedef struct _ACCESS_CONFIG_NETKEY_UPDATE_PARAM
  339. {
  340. /** New Netkey */
  341. UCHAR netkey[MS_ACCESS_NETKEY_SIZE];
  342. /** Netkey Index */
  343. UINT16 netkey_index;
  344. } ACCESS_CONFIG_NETKEY_UPDATE_PARAM;
  345. /**
  346. * Netkey Delete parameter structure
  347. */
  348. typedef struct _ACCESS_CONFIG_NETKEY_DELETE_PARAM
  349. {
  350. /** Netkey Index */
  351. UINT16 netkey_index;
  352. } ACCESS_CONFIG_NETKEY_DELETE_PARAM;
  353. /**
  354. * Appkey Add parameter structure
  355. */
  356. typedef struct _ACCESS_CONFIG_APPKEY_ADD_PARAM
  357. {
  358. /** Appkey value */
  359. UCHAR appkey[MS_ACCESS_APPKEY_SIZE];
  360. /**
  361. * Index of the NetKey and index of the AppKey
  362. * - 24 bits valid
  363. */
  364. UINT16 netkey_index;
  365. UINT16 appkey_index;
  366. } ACCESS_CONFIG_APPKEY_ADD_PARAM;
  367. /**
  368. * Appkey Update parameter structure
  369. */
  370. typedef struct _ACCESS_CONFIG_APPKEY_UPDATE_PARAM
  371. {
  372. /** New Appkey value */
  373. UCHAR appkey[MS_ACCESS_APPKEY_SIZE];
  374. /**
  375. * Index of the NetKey and index of the AppKey
  376. * - 24 bits valid
  377. */
  378. UINT16 netkey_index;
  379. UINT16 appkey_index;
  380. } ACCESS_CONFIG_APPKEY_UPDATE_PARAM;
  381. /**
  382. * Appkey Delete parameter structure
  383. */
  384. typedef struct _ACCESS_CONFIG_APPKEY_DELETE_PARAM
  385. {
  386. /**
  387. * Index of the NetKey and index of the AppKey
  388. * - 24 bits valid
  389. * */
  390. UINT16 netkey_index;
  391. UINT16 appkey_index;
  392. } ACCESS_CONFIG_APPKEY_DELETE_PARAM;
  393. /**
  394. * Appkey Get parameter structure
  395. */
  396. typedef struct _ACCESS_CONFIG_APPKEY_GET_PARAM
  397. {
  398. /** Index of the NetKey */
  399. UINT16 netkey_index;
  400. } ACCESS_CONFIG_APPKEY_GET_PARAM;
  401. /**
  402. * Node Identity Get parameter structure
  403. */
  404. typedef struct _ACCESS_CONFIG_NODEID_GET_PARAM
  405. {
  406. /** Index of the NetKey */
  407. UINT16 netkey_index;
  408. } ACCESS_CONFIG_NODEID_GET_PARAM;
  409. /**
  410. * Node Identity Set parameter structure
  411. */
  412. typedef struct _ACCESS_CONFIG_NODEID_SET_PARAM
  413. {
  414. /** Index of the NetKey */
  415. UINT16 netkey_index;
  416. /** New Node Identity state */
  417. UCHAR identity;
  418. } ACCESS_CONFIG_NODEID_SET_PARAM;
  419. /**
  420. * Model App Bind parameter structure
  421. */
  422. typedef struct _ACCESS_CONFIG_MODEL_APP_BIND_PARAM
  423. {
  424. /** Address of the element */
  425. UINT16 element_address;
  426. /** Index of the AppKey */
  427. UINT16 appkey_index;
  428. /** SIG Model ID or Vendor Model ID */
  429. MS_ACCESS_MODEL_ID model;
  430. /**
  431. * Local SIG Model ID or Vendor Model ID.
  432. * Used only for MS_config_client_model_app_bind().
  433. */
  434. MS_ACCESS_MODEL_ID client_model;
  435. } ACCESS_CONFIG_MODEL_APP_BIND_PARAM;
  436. /**
  437. * Model App Unbind parameter structure
  438. */
  439. typedef struct _ACCESS_CONFIG_MODEL_APP_UNBIND_PARAM
  440. {
  441. /** Address of the element */
  442. UINT16 element_address;
  443. /** Index of the AppKey */
  444. UINT16 appkey_index;
  445. /** SIG Model ID or Vendor Model ID */
  446. MS_ACCESS_MODEL_ID model;
  447. /**
  448. * Local SIG Model ID or Vendor Model ID.
  449. * Used only for MS_config_client_model_app_unbind().
  450. */
  451. MS_ACCESS_MODEL_ID client_model;
  452. } ACCESS_CONFIG_MODEL_APP_UNBIND_PARAM;
  453. /**
  454. * SIG Model App Get parameter structure
  455. */
  456. typedef struct _ACCESS_CONFIG_SIG_MODEL_APP_GET_PARAM
  457. {
  458. /** Address of the element */
  459. UINT16 element_address;
  460. /** SIG Model ID */
  461. MS_ACCESS_MODEL_ID_SIG model_id;
  462. } ACCESS_CONFIG_SIG_MODEL_APP_GET_PARAM;
  463. /**
  464. * Vendor Model App Get parameter structure
  465. */
  466. typedef struct _ACCESS_CONFIG_VENDOR_MODEL_APP_GET_PARAM
  467. {
  468. /** Address of the element */
  469. UINT16 element_address;
  470. /** Vendor Model ID */
  471. MS_ACCESS_MODEL_ID_VENDOR model_id;
  472. } ACCESS_CONFIG_VENDOR_MODEL_APP_GET_PARAM;
  473. /**
  474. * Friend Set parameter structure
  475. */
  476. typedef struct _ACCESS_CONFIG_FRIEND_SET_PARAM
  477. {
  478. /** New Friend state */
  479. UCHAR friend;
  480. } ACCESS_CONFIG_FRIEND_SET_PARAM;
  481. /**
  482. * Key Refresh Phase Get parameter structure
  483. */
  484. typedef struct _ACCESS_CONFIG_KEYREFRESH_PHASE_GET_PARAM
  485. {
  486. /** Netkey Index */
  487. UINT16 netkey_index;
  488. } ACCESS_CONFIG_KEYREFRESH_PHASE_GET_PARAM;
  489. /**
  490. * Key Refresh Phase Set parameter structure
  491. */
  492. typedef struct _ACCESS_CONFIG_KEYREFRESH_PHASE_SET_PARAM
  493. {
  494. /** Netkey Index */
  495. UINT16 netkey_index;
  496. /** New Key Refresh Phase Transition */
  497. UCHAR transition;
  498. } ACCESS_CONFIG_KEYREFRESH_PHASE_SET_PARAM;
  499. /**
  500. * Heartbeat Publication Set parameter structure
  501. */
  502. typedef struct _ACCESS_CONFIG_HEARTBEATPUB_SET_PARAM
  503. {
  504. /** Destination address for Heartbeat messages */
  505. UINT16 destination;
  506. /** Number of Heartbeat messages to be sent */
  507. UCHAR countlog;
  508. /** Period for sending Heartbeat messages */
  509. UCHAR periodlog;
  510. /** TTL to be used when sending Heartbeat messages */
  511. UCHAR ttl;
  512. /**
  513. * Bit field indicating features that trigger
  514. * Heartbeat messages when changed
  515. */
  516. UINT16 features;
  517. /** Netkey Index */
  518. UINT16 netkey_index;
  519. } ACCESS_CONFIG_HEARTBEATPUB_SET_PARAM;
  520. /**
  521. * Heartbeat Subscription Set parameter structure
  522. */
  523. typedef struct _ACCESS_CONFIG_HEARTBEATSUB_SET_PARAM
  524. {
  525. /** Source address for Heartbeat messages */
  526. UINT16 source;
  527. /** Destination address for Heartbeat messages */
  528. UINT16 destination;
  529. /** Period for receiving Heartbeat messages */
  530. UCHAR periodlog;
  531. } ACCESS_CONFIG_HEARTBEATSUB_SET_PARAM;
  532. /**
  533. * Low Power Node PollTimeout Get parameter structure
  534. */
  535. typedef struct _ACCESS_CONFIG_LPNPOLLTIMEOUT_GET_PARAM
  536. {
  537. /** The unicast address of the Low Power node */
  538. UINT16 lpn_address;
  539. } ACCESS_CONFIG_LPNPOLLTIMEOUT_GET_PARAM;
  540. /**
  541. * Network Transmit Set parameter structure
  542. */
  543. typedef struct _ACCESS_CONFIG_NETWORK_TRANSMIT_SET_PARAM
  544. {
  545. /**
  546. * Number of transmissions for each Network PDU
  547. * originating from the node
  548. * - 3 bits validity
  549. */
  550. UCHAR net_tx_count;
  551. /**
  552. * Number of 10-millisecond steps between transmissions
  553. * - 5 bits validity
  554. */
  555. UCHAR net_tx_interval_steps;
  556. } ACCESS_CONFIG_NETWORK_TRANSMIT_SET_PARAM;
  557. /** \} */
  558. /** \} */
  559. /* --------------------------------------------- Function */
  560. /**
  561. * \defgroup config_api_defs API Definitions
  562. * \{
  563. * This section describes the EtherMind Mesh Config Model APIs.
  564. */
  565. /**
  566. * \defgroup config_cli_api_defs Configuration Client API Definitions
  567. * \{
  568. * This section describes the Configuration Client APIs.
  569. */
  570. /**
  571. * \brief API to initialize Configuration Client model
  572. *
  573. * \par Description
  574. * This is to initialize Configuration Client model and to register with Acess layer.
  575. *
  576. * \param [in] element_handle
  577. * Element identifier to be associated with the model instance.
  578. *
  579. * \param [in, out] model_handle
  580. * Model identifier associated with the model instance on successful initialization.
  581. * After power cycle of an already provisioned node, the model handle will have
  582. * valid value and the same will be reused for registration.
  583. *
  584. * \param [in] appl_cb Application Callback to be used by the Configuration Client.
  585. *
  586. * \return API_SUCCESS or an error code indicating reason for failure
  587. */
  588. API_RESULT MS_config_client_init
  589. (
  590. /* IN */ MS_ACCESS_ELEMENT_HANDLE element_handle,
  591. /* INOUT */ MS_ACCESS_MODEL_HANDLE * model_handle,
  592. /* IN */ MS_CONFIG_MODEL_CB appl_cb
  593. );
  594. API_RESULT MS_config_client_set_publish_address
  595. (
  596. /* IN */ MS_NET_ADDR pub_addr
  597. );
  598. /**
  599. * \brief API to set configuration server
  600. *
  601. * \par Description
  602. * This is to sets the information about server which is to be configured.
  603. *
  604. * \param [in] server_addr Address of Configuration Server.
  605. * \param [in] dev_key Device Key of Configuration Server.
  606. *
  607. * \return API_SUCCESS or an error code indicating reason for failure
  608. */
  609. API_RESULT MS_config_client_set_server
  610. (
  611. /* IN */ MS_NET_ADDR server_addr,
  612. /* IN */ UCHAR * dev_key
  613. );
  614. /**
  615. * \brief API to send acknowledged commands
  616. *
  617. * \par Description
  618. * This is to initialize sending acknowledged commands.
  619. *
  620. * \param [in] req_opcode Request Opcode.
  621. * \param [in] param Parameter associated with Request Opcode.
  622. * \param [in] rsp_opcode Response Opcode.
  623. *
  624. * \return API_SUCCESS or an error code indicating reason for failure
  625. */
  626. API_RESULT MS_config_client_send_reliable_pdu
  627. (
  628. /* IN */ UINT32 req_opcode,
  629. /* IN */ void * param,
  630. /* IN */ UINT32 rsp_opcode
  631. );
  632. /**
  633. * \brief API to get the secure network beacon state
  634. *
  635. * \par Description
  636. * The Config Beacon Get is an acknowledged message used to get the current
  637. * Secure Network Beacon state of a node.
  638. *
  639. * \return API_SUCCESS or an error code indicating reason for failure
  640. */
  641. #define MS_config_client_beacon_get() \
  642. MS_config_client_send_reliable_pdu \
  643. (\
  644. MS_ACCESS_CONFIG_BEACON_GET_OPCODE,\
  645. NULL,\
  646. MS_ACCESS_CONFIG_BEACON_STATUS_OPCODE \
  647. )
  648. /**
  649. * \brief API to set the secure network beacon state
  650. *
  651. * \par Description
  652. * The Config Beacon Set is an acknowledged message used to set the current
  653. * Secure Network Beacon state of a node.
  654. *
  655. * \param [in] param
  656. * Pointer to the structure populated as in \ref ACCESS_CONFIG_BEACON_SET_PARAM
  657. *
  658. * \return API_SUCCESS or an error code indicating reason for failure
  659. */
  660. #define MS_config_client_beacon_set(param)\
  661. MS_config_client_send_reliable_pdu \
  662. (\
  663. MS_ACCESS_CONFIG_BEACON_SET_OPCODE,\
  664. (void *)param, \
  665. MS_ACCESS_CONFIG_BEACON_STATUS_OPCODE \
  666. )
  667. /**
  668. * \brief API to get the composition data state
  669. *
  670. * \par Description
  671. * The Config Composition Data Get is an acknowledged message used to read
  672. * one page of the Composition Data.
  673. *
  674. * \param [in] param
  675. * Pointer to the structure populated as in \ref ACCESS_CONFIG_COMPDATA_GET_PARAM
  676. *
  677. * \return API_SUCCESS or an error code indicating reason for failure
  678. */
  679. #define MS_config_client_composition_data_get(param)\
  680. MS_config_client_send_reliable_pdu \
  681. (\
  682. MS_ACCESS_CONFIG_COMPOSITION_DATA_GET_OPCODE,\
  683. (void *)param, \
  684. MS_ACCESS_CONFIG_COMPOSITION_DATA_STATUS_OPCODE \
  685. )
  686. /**
  687. * \brief API to get the default TTL state
  688. *
  689. * \par Description
  690. * Config Default TTL Get is an acknowledged message used to get the current
  691. * Default TTL state of a node.
  692. *
  693. * \return API_SUCCESS or an error code indicating reason for failure
  694. */
  695. #define MS_config_client_default_ttl_get()\
  696. MS_config_client_send_reliable_pdu \
  697. (\
  698. MS_ACCESS_CONFIG_DEFAULT_TTL_GET_OPCODE,\
  699. NULL, \
  700. MS_ACCESS_CONFIG_DEFAULT_TTL_STATUS_OPCODE \
  701. )
  702. /**
  703. * \brief API to set the default TTL state
  704. *
  705. * \par Description
  706. * The Config Default TTL Set is an acknowledged message used to set the
  707. * Default TTL state of a node.
  708. *
  709. * \param [in] param
  710. * Pointer to the structure populated as in \ref ACCESS_CONFIG_DEFAULT_TTL_SET_PARAM
  711. *
  712. * \return API_SUCCESS or an error code indicating reason for failure
  713. */
  714. #define MS_config_client_default_ttl_set(param)\
  715. MS_config_client_send_reliable_pdu \
  716. (\
  717. MS_ACCESS_CONFIG_DEFAULT_TTL_SET_OPCODE,\
  718. (void *)param, \
  719. MS_ACCESS_CONFIG_DEFAULT_TTL_STATUS_OPCODE \
  720. )
  721. /**
  722. * \brief API to get the GATT proxy state
  723. *
  724. * \par Description
  725. * The Config GATT Proxy Get is an acknowledged message used to get the GATT
  726. * Proxy state of a node.
  727. *
  728. * \return API_SUCCESS or an error code indicating reason for failure
  729. */
  730. #define MS_config_client_gatt_proxy_get()\
  731. MS_config_client_send_reliable_pdu \
  732. (\
  733. MS_ACCESS_CONFIG_GATT_PROXY_GET_OPCODE,\
  734. NULL, \
  735. MS_ACCESS_CONFIG_GATT_PROXY_STATUS_OPCODE \
  736. )
  737. /**
  738. * \brief API to set the GATT Proxy state
  739. *
  740. * \par Description
  741. * The Config GATT Proxy Set is an acknowledged message used to set the
  742. * GATT Proxy state of a node.
  743. *
  744. * \param [in] param
  745. * Pointer to the structure populated as in \ref ACCESS_CONFIG_GATT_PROXY_SET_PARAM
  746. *
  747. * \return API_SUCCESS or an error code indicating reason for failure
  748. */
  749. #define MS_config_client_gatt_proxy_set(param)\
  750. MS_config_client_send_reliable_pdu \
  751. (\
  752. MS_ACCESS_CONFIG_GATT_PROXY_SET_OPCODE,\
  753. (void *)param, \
  754. MS_ACCESS_CONFIG_GATT_PROXY_STATUS_OPCODE \
  755. )
  756. /**
  757. * \brief API to get the relay state
  758. *
  759. * \par Description
  760. * The Config Relay Get is an acknowledged message used to get the current
  761. * Relay and Relay Retransmit states of a node.
  762. *
  763. * \return API_SUCCESS or an error code indicating reason for failure
  764. */
  765. #define MS_config_client_relay_get()\
  766. MS_config_client_send_reliable_pdu \
  767. (\
  768. MS_ACCESS_CONFIG_RELAY_GET_OPCODE,\
  769. NULL, \
  770. MS_ACCESS_CONFIG_RELAY_STATUS_OPCODE \
  771. )
  772. /**
  773. * \brief API to set the relay state
  774. *
  775. * \par Description
  776. * The Config Relay Set is an acknowledged message used to set the current
  777. * Relay and Relay Retransmit states of a node.
  778. *
  779. * \param [in] param
  780. * Pointer to the structure populated as in \ref ACCESS_CONFIG_RELAY_SET_PARAM
  781. *
  782. * \return API_SUCCESS or an error code indicating reason for failure
  783. */
  784. #define MS_config_client_relay_set(param)\
  785. MS_config_client_send_reliable_pdu \
  786. (\
  787. MS_ACCESS_CONFIG_RELAY_SET_OPCODE,\
  788. (void *)param, \
  789. MS_ACCESS_CONFIG_RELAY_STATUS_OPCODE \
  790. )
  791. /**
  792. * \brief API to get the model publication state
  793. *
  794. * \par Description
  795. * The Config Model Publication Get is an acknowledged message used to get
  796. * the publish address and parameters of an outgoing message that originates
  797. * from a model.
  798. *
  799. * \param [in] param
  800. * Pointer to the structure populated as in \ref ACCESS_CONFIG_MODELPUB_GET_PARAM
  801. *
  802. * \return API_SUCCESS or an error code indicating reason for failure
  803. */
  804. #define MS_config_client_model_publication_get(param)\
  805. MS_config_client_send_reliable_pdu \
  806. (\
  807. MS_ACCESS_CONFIG_MODEL_PUBLICATION_GET_OPCODE,\
  808. (void *)param, \
  809. MS_ACCESS_CONFIG_MODEL_PUBLICATION_STATUS_OPCODE \
  810. )
  811. /**
  812. * \brief API to set the model publication state
  813. *
  814. * \par Description
  815. * The Config Model Publication Set is an acknowledged message used to set
  816. * the Model Publication state of an outgoing message that
  817. * originates from a model.
  818. *
  819. * \param [in] param
  820. * Pointer to the structure populated as in \ref ACCESS_CONFIG_MODELPUB_SET_PARAM
  821. *
  822. * \return API_SUCCESS or an error code indicating reason for failure
  823. */
  824. #define MS_config_client_model_publication_set(param)\
  825. MS_config_client_send_reliable_pdu \
  826. (\
  827. MS_ACCESS_CONFIG_MODEL_PUBLICATION_SET_OPCODE,\
  828. (void *)param, \
  829. MS_ACCESS_CONFIG_MODEL_PUBLICATION_STATUS_OPCODE \
  830. )
  831. /**
  832. * \brief API to set the model publication state
  833. *
  834. * \par Description
  835. * The Config Model Publication Set is an acknowledged message used to set
  836. * the Model Publication state of an outgoing message that
  837. * originates from a model.
  838. *
  839. * \param [in] param
  840. * Pointer to the structure populated as in \ref ACCESS_CONFIG_MODELPUB_VADDR_SET_PARAM
  841. *
  842. * \return API_SUCCESS or an error code indicating reason for failure
  843. */
  844. #define MS_config_client_model_publication_vaddr_set(param)\
  845. MS_config_client_send_reliable_pdu \
  846. (\
  847. MS_ACCESS_CONFIG_MODEL_PUBLICATION_VIRTUAL_ADDRESS_SET_OPCODE,\
  848. (void *)param, \
  849. MS_ACCESS_CONFIG_MODEL_PUBLICATION_STATUS_OPCODE \
  850. )
  851. /**
  852. * \brief API to add subscription address
  853. *
  854. * \par Description
  855. * The Config Model Subscription Add is an acknowledged message used to
  856. * add an address to a Subscription List of a model.
  857. *
  858. * \param [in] param
  859. * Pointer to the structure populated as in \ref ACCESS_CONFIG_MODELSUB_ADD_PARAM
  860. *
  861. * \return API_SUCCESS or an error code indicating reason for failure
  862. */
  863. #define MS_config_client_model_subscription_add(param)\
  864. MS_config_client_send_reliable_pdu \
  865. (\
  866. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_ADD_OPCODE,\
  867. (void *)param, \
  868. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_STATUS_OPCODE \
  869. )
  870. /**
  871. * \brief API to add subscription address
  872. *
  873. * \par Description
  874. * The Config Model Subscription Add is an acknowledged message used to
  875. * add an address to a Subscription List of a model.
  876. *
  877. * \param [in] param
  878. * Pointer to the structure populated as in \ref ACCESS_CONFIG_MODELSUB_VADDR_ADD_PARAM
  879. *
  880. * \return API_SUCCESS or an error code indicating reason for failure
  881. */
  882. #define MS_config_client_model_subscription_vaddr_add(param)\
  883. MS_config_client_send_reliable_pdu \
  884. (\
  885. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_VIRTUAL_ADDRESS_ADD_OPCODE,\
  886. (void *)param, \
  887. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_STATUS_OPCODE \
  888. )
  889. /**
  890. * \brief API to delete subscription address
  891. *
  892. * \par Description
  893. * The Config Model Subscription Delete is an acknowledged message used to
  894. * delete a subscription address from the Subscription List of a model.
  895. *
  896. * \param [in] param
  897. * Pointer to the structure populated as in \ref ACCESS_CONFIG_MODELSUB_DEL_PARAM
  898. *
  899. * \return API_SUCCESS or an error code indicating reason for failure
  900. */
  901. #define MS_config_client_model_subscription_delete(param)\
  902. MS_config_client_send_reliable_pdu \
  903. (\
  904. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_DELETE_OPCODE,\
  905. (void *)param, \
  906. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_STATUS_OPCODE \
  907. )
  908. /**
  909. * \brief API to delete subscription address
  910. *
  911. * \par Description
  912. * The Config Model Subscription Delete is an acknowledged message used to
  913. * delete a subscription address from the Subscription List of a model.
  914. *
  915. * \param [in] param
  916. * Pointer to the structure populated as in \ref ACCESS_CONFIG_MODELSUB_VADDR_DEL_PARAM
  917. *
  918. * \return API_SUCCESS or an error code indicating reason for failure
  919. */
  920. #define MS_config_client_model_subscription_vaddr_delete(param)\
  921. MS_config_client_send_reliable_pdu \
  922. (\
  923. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_VIRTUAL_ADDRESS_DELETE_OPCODE,\
  924. (void *)param, \
  925. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_STATUS_OPCODE \
  926. )
  927. /**
  928. * \brief API to add subscription address to cleared list
  929. *
  930. * \par Description
  931. * The Config Model Subscription Overwrite is an acknowledged message used
  932. * to discard the Subscription List and add an address to the cleared
  933. * Subscription List of a model.
  934. *
  935. * \param [in] param
  936. * Pointer to the structure populated as in \ref ACCESS_CONFIG_MODELSUB_OVERWRITE_PARAM
  937. *
  938. * \return API_SUCCESS or an error code indicating reason for failure
  939. */
  940. #define MS_config_client_model_subscription_overwrite(param)\
  941. MS_config_client_send_reliable_pdu \
  942. (\
  943. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_OVERWRITE_OPCODE,\
  944. (void *)param, \
  945. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_STATUS_OPCODE \
  946. )
  947. /**
  948. * \brief API to add subscription address to cleared list
  949. *
  950. * \par Description
  951. * The Config Model Subscription Overwrite is an acknowledged message used
  952. * to discard the Subscription List and add an address to the cleared
  953. * Subscription List of a model.
  954. *
  955. * \param [in] param
  956. * Pointer to the structure populated as in \ref ACCESS_CONFIG_MODELSUB_VADDR_OVERWRITE_PARAM
  957. *
  958. * \return API_SUCCESS or an error code indicating reason for failure
  959. */
  960. #define MS_config_client_model_subscription_vaddr_overwrite(param)\
  961. MS_config_client_send_reliable_pdu \
  962. (\
  963. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_VIRTUAL_ADDRESS_OVERWRITE_OPCODE,\
  964. (void *)param, \
  965. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_STATUS_OPCODE \
  966. )
  967. /**
  968. * \brief API to discard subscription list
  969. *
  970. * \par Description
  971. * The Config Model Subscription Delete All is an acknowledged message
  972. * used to discard the Subscription List of a model.
  973. *
  974. * \param [in] param
  975. * Pointer to the structure populated as in \ref ACCESS_CONFIG_MODELSUB_DELETEALL_PARAM
  976. *
  977. * \return API_SUCCESS or an error code indicating reason for failure
  978. */
  979. #define MS_config_client_model_subscription_delete_all(param)\
  980. MS_config_client_send_reliable_pdu \
  981. (\
  982. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_DELETE_ALL_OPCODE,\
  983. (void *)param, \
  984. MS_ACCESS_CONFIG_MODEL_SUBSCRIPTION_STATUS_OPCODE \
  985. )
  986. /**
  987. * \brief API to get subscription list
  988. *
  989. * \par Description
  990. * The Config SIG Model Subscription Get is an acknowledged message used to
  991. * get the list of subscription addresses of a model within the element.
  992. * This message is only for SIG Models.
  993. *
  994. * \param [in] param
  995. * Pointer to the structure populated as in \ref ACCESS_CONFIG_SIGMODELSUB_GET_PARAM
  996. *
  997. * \return API_SUCCESS or an error code indicating reason for failure
  998. */
  999. #define MS_config_client_sig_model_subscription_get(param)\
  1000. MS_config_client_send_reliable_pdu \
  1001. (\
  1002. MS_ACCESS_CONFIG_SIG_MODEL_SUBSCRIPTION_GET_OPCODE,\
  1003. (void *)param, \
  1004. MS_ACCESS_CONFIG_SIG_MODEL_SUBSCRIPTION_LIST_OPCODE \
  1005. )
  1006. /**
  1007. * \brief API to get subscription list
  1008. *
  1009. * \par Description
  1010. * The Config SIG Model Subscription Get is an acknowledged message used to
  1011. * get the list of subscription addresses of a model within the element.
  1012. * This message is only for Vendor Models.
  1013. *
  1014. * \param [in] param
  1015. * Pointer to the structure populated as in \ref ACCESS_CONFIG_VENDORMODELSUB_GET_PARAM
  1016. *
  1017. * \return API_SUCCESS or an error code indicating reason for failure
  1018. */
  1019. #define MS_config_client_vendor_model_subscription_get(param)\
  1020. MS_config_client_send_reliable_pdu \
  1021. (\
  1022. MS_ACCESS_CONFIG_VENDOR_MODEL_SUBSCRIPTION_GET_OPCODE,\
  1023. (void *)param, \
  1024. MS_ACCESS_CONFIG_VENDOR_MODEL_SUBSCRIPTION_LIST_OPCODE \
  1025. )
  1026. /**
  1027. * \brief API to add to Netkey list
  1028. *
  1029. * \par Description
  1030. * The Config NetKey Add is an acknowledged message used to add a NetKey
  1031. * to a NetKey List on a node. The added NetKey is then used by the node to
  1032. * authenticate and decrypt messages it receives, as well as authenticate and
  1033. * encrypt messages it sends.
  1034. *
  1035. * \param [in] param
  1036. * Pointer to the structure populated as in \ref ACCESS_CONFIG_NETKEY_ADD_PARAM
  1037. *
  1038. * \return API_SUCCESS or an error code indicating reason for failure
  1039. */
  1040. #define MS_config_client_netkey_add(param)\
  1041. MS_config_client_send_reliable_pdu \
  1042. (\
  1043. MS_ACCESS_CONFIG_NETKEY_ADD_OPCODE,\
  1044. (void *)param, \
  1045. MS_ACCESS_CONFIG_NETKEY_STATUS_OPCODE \
  1046. )
  1047. /**
  1048. * \brief API to update to Netkey list
  1049. *
  1050. * \par Description
  1051. * The Config NetKey Update is an acknowledged message used to update a NetKey
  1052. * on a node. The updated NetKey is then used by the node to authenticate and
  1053. * decrypt messages it receives, as well as authenticate and encrypt messages
  1054. * it sends, as defined by the Key Refresh procedure.
  1055. *
  1056. * \param [in] param
  1057. * Pointer to the structure populated as in \ref ACCESS_CONFIG_NETKEY_UPDATE_PARAM
  1058. *
  1059. * \return API_SUCCESS or an error code indicating reason for failure
  1060. */
  1061. #define MS_config_client_netkey_update(param)\
  1062. MS_config_client_send_reliable_pdu \
  1063. (\
  1064. MS_ACCESS_CONFIG_NETKEY_UPDATE_OPCODE,\
  1065. (void *)param, \
  1066. MS_ACCESS_CONFIG_NETKEY_STATUS_OPCODE \
  1067. )
  1068. /**
  1069. * \brief API to delete from Netkey list
  1070. *
  1071. * \par Description
  1072. * The Config NetKey Delete is an acknowledged message used to
  1073. * delete a NetKey on a NetKey List from a node.
  1074. *
  1075. * \param [in] param
  1076. * Pointer to the structure populated as in \ref ACCESS_CONFIG_NETKEY_DELETE_PARAM
  1077. *
  1078. * \return API_SUCCESS or an error code indicating reason for failure
  1079. */
  1080. #define MS_config_client_netkey_delete(param)\
  1081. MS_config_client_send_reliable_pdu \
  1082. (\
  1083. MS_ACCESS_CONFIG_NETKEY_DELETE_OPCODE,\
  1084. (void *)param, \
  1085. MS_ACCESS_CONFIG_NETKEY_STATUS_OPCODE \
  1086. )
  1087. /**
  1088. * \brief API to get Netkey list
  1089. *
  1090. * \par Description
  1091. * The Config NetKey Get is an acknowledged message used to report
  1092. * all NetKeys known to the node.
  1093. *
  1094. * \return API_SUCCESS or an error code indicating reason for failure
  1095. */
  1096. #define MS_config_client_netkey_get()\
  1097. MS_config_client_send_reliable_pdu \
  1098. (\
  1099. MS_ACCESS_CONFIG_NETKEY_GET_OPCODE,\
  1100. NULL, \
  1101. MS_ACCESS_CONFIG_NETKEY_LIST_OPCODE \
  1102. )
  1103. /**
  1104. * \brief API to add to Appkey list
  1105. *
  1106. * \par Description
  1107. * The Config AppKey Add is an acknowledged message used to add an AppKey to
  1108. * the AppKey List on a node and bind it to the NetKey identified by
  1109. * NetKeyIndex. The added AppKey can be used by the node only as a pair with
  1110. * the specified NetKey. The AppKey is used to authenticate and decrypt
  1111. * messages it receives, as well as authenticate and encrypt messages it sends.
  1112. *
  1113. * \param [in] param
  1114. * Pointer to the structure populated as in \ref ACCESS_CONFIG_APPKEY_ADD_PARAM
  1115. *
  1116. * \return API_SUCCESS or an error code indicating reason for failure
  1117. */
  1118. #define MS_config_client_appkey_add(param)\
  1119. MS_config_client_send_reliable_pdu \
  1120. (\
  1121. MS_ACCESS_CONFIG_APPKEY_ADD_OPCODE,\
  1122. (void *)param, \
  1123. MS_ACCESS_CONFIG_APPKEY_STATUS_OPCODE \
  1124. )
  1125. /**
  1126. * \brief API to update to Appkey list
  1127. *
  1128. * \par Description
  1129. * The Config AppKey Update is an acknowledged message used to update an AppKey value
  1130. * on the AppKey List on a node. The updated AppKey is used by the node to authenticate
  1131. * and decrypt messages it receives, as well as authenticate and encrypt messages it
  1132. * sends, as defined by the Key Refresh procedure.
  1133. *
  1134. * \param [in] param
  1135. * Pointer to the structure populated as in \ref ACCESS_CONFIG_APPKEY_UPDATE_PARAM
  1136. *
  1137. * \return API_SUCCESS or an error code indicating reason for failure
  1138. */
  1139. #define MS_config_client_appkey_update(param)\
  1140. MS_config_client_send_reliable_pdu \
  1141. (\
  1142. MS_ACCESS_CONFIG_APPKEY_UPDATE_OPCODE,\
  1143. (void *)param, \
  1144. MS_ACCESS_CONFIG_APPKEY_STATUS_OPCODE \
  1145. )
  1146. /**
  1147. * \brief API to delete from Appkey list
  1148. *
  1149. * \par Description
  1150. * The Config AppKey Delete is an acknowledged message used to delete an AppKey
  1151. * from the AppKey List on a node
  1152. *
  1153. * \param [in] param
  1154. * Pointer to the structure populated as in \ref ACCESS_CONFIG_APPKEY_DELETE_PARAM
  1155. *
  1156. * \return API_SUCCESS or an error code indicating reason for failure
  1157. */
  1158. #define MS_config_client_appkey_delete(param)\
  1159. MS_config_client_send_reliable_pdu \
  1160. (\
  1161. MS_ACCESS_CONFIG_APPKEY_DELETE_OPCODE,\
  1162. (void *)param, \
  1163. MS_ACCESS_CONFIG_APPKEY_STATUS_OPCODE \
  1164. )
  1165. /**
  1166. * \brief API to get the Appkey list
  1167. *
  1168. * \par Description
  1169. * The AppKey Get is an acknowledged message used to report all AppKeys
  1170. * bound to the NetKey.
  1171. *
  1172. * \param [in] param
  1173. * Pointer to the structure populated as in \ref ACCESS_CONFIG_APPKEY_GET_PARAM
  1174. *
  1175. * \return API_SUCCESS or an error code indicating reason for failure
  1176. */
  1177. #define MS_config_client_appkey_get(param)\
  1178. MS_config_client_send_reliable_pdu \
  1179. (\
  1180. MS_ACCESS_CONFIG_APPKEY_GET_OPCODE,\
  1181. (void *)param, \
  1182. MS_ACCESS_CONFIG_APPKEY_LIST_OPCODE \
  1183. )
  1184. /**
  1185. * \brief API to get the Node Identity state
  1186. *
  1187. * \par Description
  1188. * The Config Node Identity Get is an acknowledged message used to get the
  1189. * current Node Identity state for a subnet.
  1190. *
  1191. * \param [in] param
  1192. * Pointer to the structure populated as in \ref ACCESS_CONFIG_NODEID_GET_PARAM
  1193. *
  1194. * \return API_SUCCESS or an error code indicating reason for failure
  1195. */
  1196. #define MS_config_client_node_identity_get(param)\
  1197. MS_config_client_send_reliable_pdu \
  1198. (\
  1199. MS_ACCESS_CONFIG_NODE_IDENTITY_GET_OPCODE,\
  1200. (void *)param, \
  1201. MS_ACCESS_CONFIG_NODE_IDENTITY_STATUS_OPCODE \
  1202. )
  1203. /**
  1204. * \brief API to set the Node Identity state
  1205. *
  1206. * \par Description
  1207. * The Config Node Identity Set is an acknowledged message used to set the
  1208. * current Node Identity state for a subnet.
  1209. *
  1210. * \param [in] param
  1211. * Pointer to the structure populated as in \ref ACCESS_CONFIG_NODEID_SET_PARAM
  1212. *
  1213. * \return API_SUCCESS or an error code indicating reason for failure
  1214. */
  1215. #define MS_config_client_node_identity_set(param)\
  1216. MS_config_client_send_reliable_pdu \
  1217. (\
  1218. MS_ACCESS_CONFIG_NODE_IDENTITY_SET_OPCODE,\
  1219. (void *)param, \
  1220. MS_ACCESS_CONFIG_NODE_IDENTITY_STATUS_OPCODE \
  1221. )
  1222. /**
  1223. * \brief API to bind Appkey to model
  1224. *
  1225. * \par Description
  1226. * The Config Model App Bind is an acknowledged message used to bind an
  1227. * AppKey to a model.
  1228. *
  1229. * \param [in] param
  1230. * Pointer to the structure populated as in \ref ACCESS_CONFIG_MODEL_APP_BIND_PARAM
  1231. *
  1232. * \return API_SUCCESS or an error code indicating reason for failure
  1233. */
  1234. #define MS_config_client_model_app_bind(param)\
  1235. MS_config_client_send_reliable_pdu \
  1236. (\
  1237. MS_ACCESS_CONFIG_MODEL_APP_BIND_OPCODE,\
  1238. (void *)param, \
  1239. MS_ACCESS_CONFIG_MODEL_APP_STATUS_OPCODE \
  1240. )
  1241. /**
  1242. * \brief API to unbind Appkey to model
  1243. *
  1244. * \par Description
  1245. * The Config Model App Unbind is an acknowledged message used to remove the
  1246. * binding between an AppKey and a model.
  1247. *
  1248. * \param [in] param
  1249. * Pointer to the structure populated as in \ref ACCESS_CONFIG_MODEL_APP_UNBIND_PARAM
  1250. *
  1251. * \return API_SUCCESS or an error code indicating reason for failure
  1252. */
  1253. #define MS_config_client_model_app_unbind(param)\
  1254. MS_config_client_send_reliable_pdu \
  1255. (\
  1256. MS_ACCESS_CONFIG_MODEL_APP_UNBIND_OPCODE,\
  1257. (void *)param, \
  1258. MS_ACCESS_CONFIG_MODEL_APP_STATUS_OPCODE \
  1259. )
  1260. /**
  1261. * \brief API to get all SIG model Appkeys
  1262. *
  1263. * \par Description
  1264. * The Config SIG Model App Get is an acknowledged message used to request
  1265. * report of all AppKeys bound to the SIG Model.
  1266. *
  1267. * \param [in] param
  1268. * Pointer to the structure populated as in \ref ACCESS_CONFIG_SIG_MODEL_APP_GET_PARAM
  1269. *
  1270. * \return API_SUCCESS or an error code indicating reason for failure
  1271. */
  1272. #define MS_config_client_sig_model_app_get(param)\
  1273. MS_config_client_send_reliable_pdu \
  1274. (\
  1275. MS_ACCESS_CONFIG_SIG_MODEL_APP_GET_OPCODE,\
  1276. (void *)param, \
  1277. MS_ACCESS_CONFIG_SIG_MODEL_APP_LIST_OPCODE \
  1278. )
  1279. /**
  1280. * \brief API to get all Vendor model Appkeys
  1281. *
  1282. * \par Description
  1283. * The Config Vendor Model App Get is an acknowledged message used to request
  1284. * report of all AppKeys bound to the Vendor Model.
  1285. *
  1286. * \param [in] param
  1287. * Pointer to the structure populated as in \ref ACCESS_CONFIG_VENDOR_MODEL_APP_GET_PARAM
  1288. *
  1289. * \return API_SUCCESS or an error code indicating reason for failure
  1290. */
  1291. #define MS_config_client_vendor_model_app_get(param)\
  1292. MS_config_client_send_reliable_pdu \
  1293. (\
  1294. MS_ACCESS_CONFIG_VENDOR_MODEL_APP_GET_OPCODE,\
  1295. (void *)param, \
  1296. MS_ACCESS_CONFIG_VENDOR_MODEL_APP_LIST_OPCODE \
  1297. )
  1298. /**
  1299. * \brief API to reset a node
  1300. *
  1301. * \par Description
  1302. * The Config Node Reset is an acknowledged message used to reset a node
  1303. * (other than a Provisioner) and remove it from the network.
  1304. *
  1305. * \return API_SUCCESS or an error code indicating reason for failure
  1306. */
  1307. #define MS_config_client_node_reset()\
  1308. MS_config_client_send_reliable_pdu \
  1309. (\
  1310. MS_ACCESS_CONFIG_NODE_RESET_OPCODE,\
  1311. NULL, \
  1312. MS_ACCESS_CONFIG_NODE_RESET_STATUS_OPCODE \
  1313. )
  1314. /**
  1315. * \brief API to get friend state
  1316. *
  1317. * \par Description
  1318. * The Config Friend Get is an acknowledged message used to get the
  1319. * current Friend state of a node.
  1320. *
  1321. * \return API_SUCCESS or an error code indicating reason for failure
  1322. */
  1323. #define MS_config_client_friend_get()\
  1324. MS_config_client_send_reliable_pdu \
  1325. (\
  1326. MS_ACCESS_CONFIG_FRIEND_GET_OPCODE,\
  1327. NULL, \
  1328. MS_ACCESS_CONFIG_FRIEND_STATUS_OPCODE \
  1329. )
  1330. /**
  1331. * \brief API to set friend state
  1332. *
  1333. * \par Description
  1334. * The Config Friend Set is an acknowledged message used to set the
  1335. * Friend state of a node.
  1336. *
  1337. * \param [in] param
  1338. * Pointer to the structure populated as in \ref ACCESS_CONFIG_FRIEND_SET_PARAM
  1339. *
  1340. * \return API_SUCCESS or an error code indicating reason for failure
  1341. */
  1342. #define MS_config_client_friend_set(param)\
  1343. MS_config_client_send_reliable_pdu \
  1344. (\
  1345. MS_ACCESS_CONFIG_FRIEND_SET_OPCODE,\
  1346. (void *)param, \
  1347. MS_ACCESS_CONFIG_FRIEND_STATUS_OPCODE \
  1348. )
  1349. /**
  1350. * \brief API to get key refresh phase state
  1351. *
  1352. * \par Description
  1353. * The Config Key Refresh Phase Get is an acknowledged message used
  1354. * to get the current Key Refresh Phase state of the identified network key.
  1355. *
  1356. * \param [in] param
  1357. * Pointer to the structure populated as in \ref ACCESS_CONFIG_KEYREFRESH_PHASE_GET_PARAM
  1358. *
  1359. * \return API_SUCCESS or an error code indicating reason for failure
  1360. */
  1361. #define MS_config_client_keyrefresh_phase_get(param)\
  1362. MS_config_client_send_reliable_pdu \
  1363. (\
  1364. MS_ACCESS_CONFIG_KEY_REFRESH_PHASE_GET_OPCODE,\
  1365. (void *)param, \
  1366. MS_ACCESS_CONFIG_KEY_REFRESH_PHASE_STATUS_OPCODE \
  1367. )
  1368. /**
  1369. * \brief API to set key refresh phase state
  1370. *
  1371. * \par Description
  1372. * The Config Key Refresh Phase Set is an acknowledged message used
  1373. * to set the current Key Refresh Phase state of the identified network key.
  1374. *
  1375. * \param [in] param
  1376. * Pointer to the structure populated as in \ref ACCESS_CONFIG_KEYREFRESH_PHASE_SET_PARAM
  1377. *
  1378. * \return API_SUCCESS or an error code indicating reason for failure
  1379. */
  1380. #define MS_config_client_keyrefresh_phase_set(param)\
  1381. MS_config_client_send_reliable_pdu \
  1382. (\
  1383. MS_ACCESS_CONFIG_KEY_REFRESH_PHASE_SET_OPCODE,\
  1384. (void *)param, \
  1385. MS_ACCESS_CONFIG_KEY_REFRESH_PHASE_STATUS_OPCODE \
  1386. )
  1387. /**
  1388. * \brief API to get heartbeat publication state
  1389. *
  1390. * \par Description
  1391. * The Config Heartbeat Publication Get is an acknowledged message used to get
  1392. * the current Heartbeat Publication state of an element.
  1393. *
  1394. * \return API_SUCCESS or an error code indicating reason for failure
  1395. */
  1396. #define MS_config_client_heartbeat_publication_get()\
  1397. MS_config_client_send_reliable_pdu \
  1398. (\
  1399. MS_ACCESS_CONFIG_HEARTBEAT_PUBLICATION_GET_OPCODE,\
  1400. NULL, \
  1401. MS_ACCESS_CONFIG_HEARTBEAT_PUBLICATION_STATUS_OPCODE \
  1402. )
  1403. /**
  1404. * \brief API to set heartbeat publication state
  1405. *
  1406. * \par Description
  1407. * The Config Heartbeat Publication Set is an acknowledged message
  1408. * used to set the current Heartbeat Publication state of an element.
  1409. *
  1410. * \param [in] param
  1411. * Pointer to the structure populated as in \ref ACCESS_CONFIG_HEARTBEATPUB_SET_PARAM
  1412. *
  1413. * \return API_SUCCESS or an error code indicating reason for failure
  1414. */
  1415. #define MS_config_client_heartbeat_publication_set(param)\
  1416. MS_config_client_send_reliable_pdu \
  1417. (\
  1418. MS_ACCESS_CONFIG_HEARTBEAT_PUBLICATION_SET_OPCODE,\
  1419. (void *)param, \
  1420. MS_ACCESS_CONFIG_HEARTBEAT_PUBLICATION_STATUS_OPCODE \
  1421. )
  1422. /**
  1423. * \brief API to get heartbeat subscription state
  1424. *
  1425. * \par Description
  1426. * The Config Heartbeat Subscription Get is an acknowledged message used
  1427. * to get the current Heartbeat Subscription state of an element.
  1428. *
  1429. * \return API_SUCCESS or an error code indicating reason for failure
  1430. */
  1431. #define MS_config_client_heartbeat_subscription_get()\
  1432. MS_config_client_send_reliable_pdu \
  1433. (\
  1434. MS_ACCESS_CONFIG_HEARTBEAT_SUBSCRIPTION_GET_OPCODE,\
  1435. NULL, \
  1436. MS_ACCESS_CONFIG_HEARTBEAT_SUBSCRIPTION_STATUS_OPCODE \
  1437. )
  1438. /**
  1439. * \brief API to set heartbeat subscription state
  1440. *
  1441. * \par Description
  1442. * The Config Heartbeat Publication Set is an acknowledged message
  1443. * used to set the current Heartbeat Subscription state of an element.
  1444. *
  1445. * \param [in] param
  1446. * Pointer to the structure populated as in \ref ACCESS_CONFIG_HEARTBEATSUB_SET_PARAM
  1447. *
  1448. * \return API_SUCCESS or an error code indicating reason for failure
  1449. */
  1450. #define MS_config_client_heartbeat_subscription_set(param)\
  1451. MS_config_client_send_reliable_pdu \
  1452. (\
  1453. MS_ACCESS_CONFIG_HEARTBEAT_SUBSCRIPTION_SET_OPCODE,\
  1454. (void *)param, \
  1455. MS_ACCESS_CONFIG_HEARTBEAT_SUBSCRIPTION_STATUS_OPCODE \
  1456. )
  1457. /**
  1458. * \brief API to get LPN Polltimeout state
  1459. *
  1460. * \par Description
  1461. * The Config Low Power Node PollTimeout Get is an acknowledged message used
  1462. * to get the current value of PollTimeout timer of the Low Power node within
  1463. * a Friend node. The message is sent to a Friend node that has claimed to be
  1464. * handling messages by sending ACKs On Behalf Of (OBO) the indicated Low
  1465. * Power node. This message should only be sent to a node that has the Friend
  1466. * feature supported and enabled.
  1467. *
  1468. * \param [in] param
  1469. * Pointer to the structure populated as in \ref ACCESS_CONFIG_LPNPOLLTIMEOUT_GET_PARAM
  1470. *
  1471. * \return API_SUCCESS or an error code indicating reason for failure
  1472. */
  1473. #define MS_config_client_lpn_polltimeout_get(param)\
  1474. MS_config_client_send_reliable_pdu \
  1475. (\
  1476. MS_ACCESS_CONFIG_LOW_POWER_NODE_POLLTIMEOUT_GET_OPCODE,\
  1477. (void *)param, \
  1478. MS_ACCESS_CONFIG_LOW_POWER_NODE_POLLTIMEOUT_STATUS_OPCODE \
  1479. )
  1480. /**
  1481. * \brief API to get Network transmit state
  1482. *
  1483. * \par Description
  1484. * The Config Network Transmit Get is an acknowledged message used to get
  1485. * the current Network Transmit state of a node.
  1486. *
  1487. * \return API_SUCCESS or an error code indicating reason for failure
  1488. */
  1489. #define MS_config_client_network_transmit_get()\
  1490. MS_config_client_send_reliable_pdu \
  1491. (\
  1492. MS_ACCESS_CONFIG_NETWORK_TRANSMIT_GET_OPCODE,\
  1493. NULL, \
  1494. MS_ACCESS_CONFIG_NETWORK_TRANSMIT_STATUS_OPCODE \
  1495. )
  1496. /**
  1497. * \brief API to set Network transmit state
  1498. *
  1499. * \par Description
  1500. * The Config Network Transmit Set is an acknowledged message used to set
  1501. * the current Network Transmit state of a node.
  1502. *
  1503. * \param [in] param
  1504. * Pointer to the structure populated as in \ref ACCESS_CONFIG_NETWORK_TRANSMIT_SET_PARAM
  1505. *
  1506. * \return API_SUCCESS or an error code indicating reason for failure
  1507. */
  1508. #define MS_config_client_network_transmit_set(param)\
  1509. MS_config_client_send_reliable_pdu \
  1510. (\
  1511. MS_ACCESS_CONFIG_NETWORK_TRANSMIT_SET_OPCODE,\
  1512. (void *)param, \
  1513. MS_ACCESS_CONFIG_NETWORK_TRANSMIT_STATUS_OPCODE \
  1514. )
  1515. /** \} */
  1516. /**
  1517. * \defgroup config_svr_api_defs Configuration Server API Definitions
  1518. * \{
  1519. * This section describes the Configuration Server APIs.
  1520. */
  1521. /**
  1522. * \brief API to initialize configuration server model
  1523. *
  1524. * \par Description
  1525. * This is to initialize configuration server model and to register with Acess layer.
  1526. *
  1527. * \param [in] element_handle
  1528. * Element identifier to be associated with the model instance.
  1529. *
  1530. * \param [in, out] model_handle
  1531. * Model identifier associated with the model instance on successful initialization.
  1532. * After power cycle of an already provisioned node, the model handle will have
  1533. * valid value and the same will be reused for registration.
  1534. *
  1535. * \return API_SUCCESS or an error code indicating reason for failure
  1536. */
  1537. API_RESULT MS_config_server_init
  1538. (
  1539. /* IN */ MS_ACCESS_ELEMENT_HANDLE element_handle,
  1540. /* INOUT */ MS_ACCESS_MODEL_HANDLE * model_handle
  1541. );
  1542. typedef API_RESULT ( *APP_config_server_CB_t )(
  1543. /* IN */ MS_ACCESS_MODEL_HANDLE * ,
  1544. /* IN */ MS_NET_ADDR ,
  1545. /* IN */ MS_NET_ADDR ,
  1546. /* IN */ MS_SUBNET_HANDLE ,
  1547. /* IN */ MS_APPKEY_HANDLE ,
  1548. /* IN */ UINT32 ,
  1549. /* IN */ UCHAR * ,
  1550. /* IN */ UINT16 ,
  1551. /* IN */ API_RESULT ,
  1552. /* IN */ UINT32 ,
  1553. /* IN */ UCHAR * ,
  1554. /* IN */ UINT16 );
  1555. void APP_config_server_CB_init(APP_config_server_CB_t appConfigServerCB);
  1556. /** \} */
  1557. /** \} */
  1558. /** \} */
  1559. #endif /* _H_MS_CONFIG_API_ */