MS_access_api.h 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960
  1. /**
  2. * \file MS_access_api.h
  3. *
  4. * \brief This file defines the Mesh Access Application Interface - includes
  5. * Data Structures and Methods.
  6. */
  7. /*
  8. * Copyright (C) 2017. Mindtree Ltd.
  9. * All rights reserved.
  10. */
  11. #ifndef _H_MS_ACCESS_API_
  12. #define _H_MS_ACCESS_API_
  13. /* --------------------------------------------- Header File Inclusion */
  14. /* Transport Layer */
  15. #include "MS_trn_api.h"
  16. #ifdef MS_STORAGE
  17. #include "nvsto.h"
  18. #endif /* MS_STORAGE */
  19. /* --------------------------------------------- Global Definitions */
  20. /**
  21. * \defgroup access_module ACCESS (Mesh Access Layer)
  22. * \{
  23. * This section describes the interfaces & APIs offered by the EtherMind
  24. * Mesh Access (ACCESS) module to the Application and other upper
  25. * layers of the stack.
  26. */
  27. /**
  28. * \defgroup access_defines Defines
  29. * \{
  30. * Describes defines for the module.
  31. */
  32. /**
  33. * \defgroup access_constants Constants
  34. * \{
  35. * Describes Constants defined by the module.
  36. */
  37. /**
  38. * Maximum Access Packet size.
  39. * 32 segments of 12 octets each.
  40. */
  41. #define MS_ACCESS_MAX_PKT_SIZE 384
  42. /** Array sizes for use in the Access layer */
  43. /** Size of Virtual Address (Label UUID) */
  44. #define MS_ACCESS_VADDR_LABEL_UUID_SIZE 16
  45. /** Size of NetKey */
  46. #define MS_ACCESS_NETKEY_SIZE 16
  47. /** Size of AppKey */
  48. #define MS_ACCESS_APPKEY_SIZE 16
  49. /** Default Node Identifier */
  50. #define MS_ACCESS_DEFAULT_NODE_ID 0x00
  51. /** Default Element Handle */
  52. #define MS_ACCESS_DEFAULT_ELEMENT_HANDLE 0x00
  53. /** Get Request */
  54. #define MS_ACCESS_GET_REQ 0x01
  55. /** Set Request */
  56. #define MS_ACCESS_SET_REQ 0x02
  57. /** Invalid default TTL value */
  58. #define ACCESS_INVALID_DEFAULT_TTL 0xFF
  59. /** Maximum TTL value - used as initializer */
  60. #define ACCESS_MAX_TTL 0x05 //0x7F
  61. /** Model Specific Request Message Type: Get, Set or Others */
  62. /** Model Specific Request Message Type: Get */
  63. #define MS_ACCESS_MODEL_REQ_MSG_T_GET 0
  64. /** Model Specific Request Message Type: Set */
  65. #define MS_ACCESS_MODEL_REQ_MSG_T_SET 1
  66. /** Model Specific Request Message Type: Others */
  67. #define MS_ACCESS_MODEL_REQ_MSG_T_OTHERS 2
  68. /** Key Refersh Phase states */
  69. /** Key Refersh Phase - Normal */
  70. #define MS_ACCESS_KEY_REFRESH_PHASE_NORMAL 0x00
  71. /** Key Refersh Phase - 1 */
  72. #define MS_ACCESS_KEY_REFRESH_PHASE_1 0x01
  73. /** Key Refersh Phase - 2 */
  74. #define MS_ACCESS_KEY_REFRESH_PHASE_2 0x02
  75. /** Key Refersh Phase - 3 */
  76. #define MS_ACCESS_KEY_REFRESH_PHASE_3 0x03
  77. /** Invalid Access Address */
  78. #define MS_ACCESS_ADDRESS_INVALID_HANDLE 0xFFFFFFFF
  79. /** \} */
  80. /** \} */
  81. /**
  82. * \defgroup access_events Events
  83. * \{
  84. * This section lists the Asynchronous Events notified to Application by the
  85. * Module.
  86. */
  87. /** \} */
  88. /**
  89. * \defgroup access_marcos Utility Macros
  90. * \{
  91. * This section defines the utility macros for use by the application.
  92. *
  93. */
  94. /** Populates the given element with the Model information */
  95. #define MS_ACCESS_ASSIGN_ELEMENT(pelement, loc) \
  96. (pelement)->loc = (loc)
  97. /** Initializes the SIG model with the given ID and callback information */
  98. #define MS_ACCESS_INIT_SIG_MODEL(pmodel, id, eh, cb, pub_cb, num_op, op) \
  99. (pmodel)->model_id.type = MS_ACCESS_MODEL_TYPE_SIG; \
  100. (pmodel)->model_id.id = (id); \
  101. (pmodel)->elem_handle = (eh); \
  102. (pmodel)->cb = (cb); \
  103. (pmodel)->pub_cb = (pub_cb); \
  104. (pmodel)->num_opcodes = (num_op); \
  105. (pmodel)->opcodes = (op)
  106. /** Initializes the Vendor model with the given ID and callback information */
  107. #define MS_ACCESS_INIT_VENDOR_MODEL(pmodel, id, eh, cb, pub_cb, num_op, op) \
  108. (pmodel)->model_id.type = MS_ACCESS_MODEL_TYPE_VENDOR; \
  109. (pmodel)->model_id.id = (id); \
  110. (pmodel)->elem_handle = (eh); \
  111. (pmodel)->cb = (cb); \
  112. (pmodel)->pub_cb = (pub_cb); \
  113. (pmodel)->num_opcodes = (num_op); \
  114. (pmodel)->opcodes = (op)
  115. /** \} */
  116. /* --------------------------------------------- Data Types/ Structures */
  117. /** Access Model Handle */
  118. typedef UINT16 MS_ACCESS_MODEL_HANDLE;
  119. /**
  120. * \defgroup access_cb Application Callback
  121. * \{
  122. * This Section Describes the module Notification Callback interface offered
  123. * to the application
  124. */
  125. /**
  126. * Access Layer Application Asynchronous Notification Callback.
  127. *
  128. * Access Layer calls the registered callback to indicate events occurred to the
  129. * application.
  130. *
  131. * \param handle Model Handle.
  132. * \param saddr 16 bit Source Address.
  133. * \param daddr 16 bit Destination Address.
  134. * \param subnet_handle Subnet Handle.
  135. * \param appkey_handle AppKey Handle.
  136. * \param opcode Opcode.
  137. * \param data_param Data associated with the event if any or NULL.
  138. * \param data_len Size of the event data. 0 if event data is NULL.
  139. */
  140. typedef API_RESULT (* MS_ACCESS_MODEL_CB)
  141. (
  142. MS_ACCESS_MODEL_HANDLE * handle,
  143. MS_NET_ADDR saddr,
  144. MS_NET_ADDR daddr,
  145. MS_SUBNET_HANDLE subnet_handle,
  146. MS_APPKEY_HANDLE appkey_handle,
  147. UINT32 opcode,
  148. UCHAR * data_param,
  149. UINT16 data_len
  150. ) DECL_REENTRANT;
  151. /**
  152. * Access Layer Model Publication Timeout Callback.
  153. *
  154. * Access Layer calls the registered callback to indicate Publication Timeout
  155. * for the associated model.
  156. *
  157. * \param handle Model Handle.
  158. * \param blob Blob if any or NULL.
  159. */
  160. typedef API_RESULT (* MS_ACCESS_MODEL_PUBLISH_TIMEOUT_CB)
  161. (
  162. MS_ACCESS_MODEL_HANDLE * handle,
  163. void * data_param
  164. ) DECL_REENTRANT;
  165. /** \} */
  166. /**
  167. * \defgroup access_structures Structures
  168. * \{
  169. */
  170. /** SIG Model ID */
  171. typedef UINT16 MS_ACCESS_MODEL_ID_SIG;
  172. /** Vendor Model ID */
  173. typedef UINT32 MS_ACCESS_MODEL_ID_VENDOR;
  174. /** Access Node ID */
  175. typedef UINT8 MS_ACCESS_NODE_ID;
  176. /** Access Element Handle */
  177. typedef UINT8 MS_ACCESS_ELEMENT_HANDLE;
  178. /** Access Address Handle */
  179. typedef UINT32 MS_ACCESS_ADDRESS_HANDLE;
  180. /** Device Key Handle */
  181. typedef UINT32 MS_ACCESS_DEV_KEY_HANDLE;
  182. /** Model ID datatype */
  183. typedef struct _MS_ACCESS_MODEL_ID
  184. {
  185. /** Vendor/SIG ID */
  186. UINT32 id;
  187. /**
  188. * Model type
  189. * - SIG or Vendor
  190. */
  191. UCHAR type;
  192. } MS_ACCESS_MODEL_ID;
  193. /**
  194. * Data structure for model.
  195. *
  196. * Models could be bluetooth SIG defined or vendor defined.
  197. */
  198. typedef struct _MS_ACCESS_MODEL
  199. {
  200. /** Model ID */
  201. MS_ACCESS_MODEL_ID model_id;
  202. /** Associated Element Handle */
  203. MS_ACCESS_ELEMENT_HANDLE elem_handle;
  204. /**
  205. * Callback function pointer to receive packets from the underlying
  206. * protocol layers
  207. */
  208. MS_ACCESS_MODEL_CB cb;
  209. /**
  210. * Callback function called when Publication Timer expires.
  211. * Set to NULL if model does not support periodic publication.
  212. */
  213. MS_ACCESS_MODEL_PUBLISH_TIMEOUT_CB pub_cb;
  214. /** Number of Opcodes */
  215. UINT16 num_opcodes;
  216. /** List of Opcodes */
  217. DECL_CONST UINT32 * opcodes;
  218. } MS_ACCESS_MODEL;
  219. /**
  220. * Element description format.
  221. */
  222. typedef struct _MS_ACCESS_ELEMENT_DESC
  223. {
  224. /** Location descriptor */
  225. UINT16 loc;
  226. } MS_ACCESS_ELEMENT_DESC;
  227. /**
  228. * Unicast/Virtual/Group Address.
  229. */
  230. typedef struct _MS_ACCESS_ADDRESS
  231. {
  232. /** Flag - which field to be used */
  233. UINT8 use_label;
  234. /** Address */
  235. MS_NET_ADDR addr;
  236. /** Label UUID */
  237. UINT8 label[MS_LABEL_UUID_LENGTH];
  238. } MS_ACCESS_ADDRESS;
  239. /**
  240. * Access Publication related information
  241. */
  242. typedef struct _MS_ACCESS_PUBLISH_INFO
  243. {
  244. /** PublishAddress (Unicast/Virtual/Group) */
  245. MS_ACCESS_ADDRESS addr;
  246. /**
  247. * - AppKey Index (when set from remote).
  248. * - AppKey Handle (when set from locally for Configuration Client).
  249. */
  250. UINT16 appkey_index;
  251. /** CredentialFlag */
  252. UINT8 crden_flag;
  253. /** PublishTTL */
  254. UINT8 ttl;
  255. /** PublishPeriod */
  256. UINT8 period;
  257. /** PublishRetransmitCount */
  258. UINT8 rtx_count;
  259. /** PublishRetransmitIntervalSteps */
  260. UINT8 rtx_interval_steps;
  261. /** Flag - if called from local or remote */
  262. UINT8 remote;
  263. } MS_ACCESS_PUBLISH_INFO;
  264. /**
  265. * Context of message received for a specific model instance.
  266. * This is required to send response appropriately.
  267. */
  268. typedef struct _MS_ACCESS_MODEL_REQ_MSG_CONTEXT
  269. {
  270. /** Model Handle - for which request is received */
  271. MS_ACCESS_MODEL_HANDLE handle;
  272. /** Source Address - oritinator of request */
  273. MS_NET_ADDR saddr;
  274. /** Destination Address - of the request */
  275. MS_NET_ADDR daddr;
  276. /** Associated Subnet Identifier */
  277. MS_SUBNET_HANDLE subnet_handle;
  278. /** Associated AppKey Identifier */
  279. MS_APPKEY_HANDLE appkey_handle;
  280. } MS_ACCESS_MODEL_REQ_MSG_CONTEXT;
  281. /** Uninterpreted/raw received message for a specific model instance. */
  282. typedef struct _MS_ACCESS_MODEL_REQ_MSG_RAW
  283. {
  284. /** Request Opcode */
  285. UINT32 opcode;
  286. /** Raw received message */
  287. UCHAR * data_param;
  288. /** Raw received message length */
  289. UINT16 data_len;
  290. } MS_ACCESS_MODEL_REQ_MSG_RAW;
  291. /** Requested message type for a specific model instance. */
  292. typedef struct _MS_ACCESS_MODEL_REQ_MSG_T
  293. {
  294. /** Flag: GET, SET or Others */
  295. UINT8 type;
  296. /** Flag: True or False */
  297. UINT8 to_be_acked;
  298. } MS_ACCESS_MODEL_REQ_MSG_T;
  299. /** Model specific state parameters in a request or response message */
  300. typedef struct _MS_ACCESS_MODEL_STATE_PARAMS
  301. {
  302. /** State Type */
  303. UCHAR state_type;
  304. /** State pointer */
  305. void * state;
  306. }MS_ACCESS_MODEL_STATE_PARAMS;
  307. /** Additional paramters in a Model specific request or response message */
  308. typedef struct _MS_ACCESS_MODEL_EXT_PARAMS
  309. {
  310. /** State/Extended Type */
  311. UCHAR ext_type;
  312. /** State/Extended data structure pointer */
  313. void * ext;
  314. }MS_ACCESS_MODEL_EXT_PARAMS;
  315. /**
  316. * Provisioned Device List Data Structure, containing Primary Element Address
  317. * and number of elements.
  318. */
  319. typedef struct _MS_PROV_DEV_ENTRY
  320. {
  321. /** Unicast Address of the first element */
  322. MS_NET_ADDR uaddr;
  323. /** Number of Elements */
  324. UCHAR num_elements;
  325. /*Receive notify count*/
  326. UINT16 rcv_flag;
  327. } MS_PROV_DEV_ENTRY;
  328. /** \} */
  329. /* --------------------------------------------- Function */
  330. /**
  331. * \defgroup access_api_defs API Definitions
  332. * \{
  333. * This section describes the EtherMind Mesh Access Layer APIs.
  334. */
  335. #ifdef __cplusplus
  336. extern "C" {
  337. #endif
  338. /**
  339. * \brief Create a new node in the device.
  340. *
  341. * \par Description
  342. * This routine creates a new node in the device. This can be used by the
  343. * application to create extra nodes if required in addition to the default
  344. * primary node.
  345. *
  346. * \param [out] node_id Identifier to reference the newly created node.
  347. *
  348. * \return API_SUCCESS or an error code indicating reason for failure
  349. */
  350. API_RESULT MS_access_create_node (/* OUT */ MS_ACCESS_NODE_ID * node_id);
  351. /**
  352. * \brief Register an element with the access layer.
  353. *
  354. * \par Description
  355. * This routine registers an element that can be populated with the models
  356. * information to a specific node in the device identified by the node id.
  357. *
  358. * \param [in] node_id Node to which the element needs to be registered. This
  359. * value is always 0 for the default node.
  360. *
  361. * \param [in] element Pointer to the element descriptor that needs to be
  362. * registered to the node.
  363. *
  364. * \param [out] element_handle Identifier to reference the newly registered element.
  365. *
  366. * \return API_SUCCESS or an error code indicating reason for failure
  367. */
  368. API_RESULT MS_access_register_element
  369. (
  370. /* IN */ MS_ACCESS_NODE_ID node_id,
  371. /* IN */ MS_ACCESS_ELEMENT_DESC * element,
  372. /* OUT */ MS_ACCESS_ELEMENT_HANDLE * element_handle
  373. );
  374. /**
  375. * \brief Register a model with the access layer.
  376. *
  377. * \par Description
  378. * This routine registers a model associated with an element with the access layer.
  379. *
  380. * \param [in] node_id Node to which the model needs to be registered. This
  381. * value is always 0 for the default node.
  382. *
  383. * \param [in] model Pointer to the model descriptor that needs to be
  384. * registered to the node.
  385. *
  386. * \param [in, out] model_handle
  387. * Model identifier associated with the model instance on successful registration.
  388. * After power cycle of an already provisioned node, the model handle will have
  389. * valid value and the same will be reused for registration.
  390. *
  391. * \return API_SUCCESS or an error code indicating reason for failure
  392. */
  393. API_RESULT MS_access_register_model
  394. (
  395. /* IN */ MS_ACCESS_NODE_ID node_id,
  396. /* IN */ MS_ACCESS_MODEL * model,
  397. /* INOUT */ MS_ACCESS_MODEL_HANDLE * model_handle
  398. );
  399. /**
  400. * \brief Get element handle.
  401. *
  402. * \par Description
  403. * This routine searches for the element handle associated with specific element address.
  404. *
  405. * \param [in] elem_addr Address of the corresponding element.
  406. * \param [out] handle Element handle associated with the element address.
  407. *
  408. * \return API_SUCCESS or an error code indicating reason for failure
  409. */
  410. API_RESULT MS_access_get_element_handle
  411. (
  412. /* IN */ MS_NET_ADDR elem_addr,
  413. /* OUT */ MS_ACCESS_ELEMENT_HANDLE * handle
  414. );
  415. /**
  416. * \brief Get model handle.
  417. *
  418. * \par Description
  419. * This routine searches for the model handle associated with specific model ID.
  420. *
  421. * \param [in] elem_handle Element Identifier associated with the Model.
  422. * \param [in] model_id Model Identifier for which the model handle to be searched.
  423. * \param [out] handle Model handle associated with model ID.
  424. * If not found, handle will be set as NULL.
  425. *
  426. * \return API_SUCCESS or an error code indicating reason for failure
  427. */
  428. API_RESULT MS_access_get_model_handle
  429. (
  430. /* IN */ MS_ACCESS_ELEMENT_HANDLE elem_handle,
  431. /* IN */ MS_ACCESS_MODEL_ID model_id,
  432. /* OUT */ MS_ACCESS_MODEL_HANDLE * handle
  433. );
  434. API_RESULT MS_access_get_appkey_handle
  435. (
  436. /* IN */ MS_ACCESS_MODEL_HANDLE * handle,
  437. /* OUT */ MS_APPKEY_HANDLE * appkey_handle
  438. );
  439. /**
  440. * \brief API to publish access layer message.
  441. *
  442. * \par Description
  443. * This routine publishes Access Layer message to the publish address associated with the model.
  444. *
  445. * \param [in] handle
  446. * Access Model Handle for which message to be sent.
  447. *
  448. * \param [in] opcode
  449. * Access Opcode
  450. *
  451. * \param [in] data_param
  452. * Data packet
  453. *
  454. * \param [in] data_len
  455. * Data packet length
  456. *
  457. * \param [in] reliable
  458. * MS_TRUE for reliable message. MS_FALSE otherwise.
  459. *
  460. * \return API_SUCCESS or an error code indicating reason for failure
  461. */
  462. API_RESULT MS_access_publish
  463. (
  464. /* IN */ MS_ACCESS_MODEL_HANDLE * handle,
  465. /* IN */ UINT32 opcode,
  466. /* IN */ UCHAR * data_param,
  467. /* IN */ UINT16 data_len,
  468. /* IN */ UINT8 reliable
  469. );
  470. /**
  471. * \brief API to reliably publish access layer message.
  472. *
  473. * \par Description
  474. * This routine reliably publishes Access Layer message to the publish address associated with the model.
  475. *
  476. * \param [in] handle
  477. * Access Model Handle for which message to be sent.
  478. *
  479. * \param [in] req_opcode
  480. * Request Opcode
  481. *
  482. * \param [in] data_param
  483. * Data packet
  484. *
  485. * \param [in] data_len
  486. * Data packet length
  487. *
  488. * \param [in] rsp_opcode
  489. * Response Opcode
  490. *
  491. * \return API_SUCCESS or an error code indicating reason for failure
  492. */
  493. API_RESULT MS_access_reliable_publish
  494. (
  495. /* IN */ MS_ACCESS_MODEL_HANDLE * handle,
  496. /* IN */ UINT32 req_opcode,
  497. /* IN */ UCHAR * data_param,
  498. /* IN */ UINT16 data_len,
  499. /* IN */ UINT32 rsp_opcode
  500. );
  501. /**
  502. * \brief API to reply to access layer message.
  503. *
  504. * \par Description
  505. * This routine replies to Access Layer message.
  506. *
  507. * \param [in] handle Model Handle.
  508. * \param [in] saddr 16 bit Source Address.
  509. * \param [in] daddr 16 bit Destination Address.
  510. * \param [in] subnet_handle Subnet Handle.
  511. * \param [in] appkey_handle AppKey Handle.
  512. * \param [in] ttl Time to Live.
  513. * \param [in] opcode Access Opcode
  514. * \param [in] data_param Access parameter, based on the opcode
  515. * \param [in] data_length Access parameter length, based on the opcode
  516. *
  517. * \return API_SUCCESS or an error code indicating reason for failure
  518. */
  519. API_RESULT MS_access_reply
  520. (
  521. /* IN */ MS_ACCESS_MODEL_HANDLE * handle,
  522. /* IN */ MS_NET_ADDR saddr,
  523. /* IN */ MS_NET_ADDR daddr,
  524. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  525. /* IN */ MS_APPKEY_HANDLE appkey_handle,
  526. /* IN */ UINT8 ttl,
  527. /* IN */ UINT32 opcode,
  528. /* IN */ UCHAR * data_param,
  529. /* IN */ UINT16 data_length
  530. );
  531. /**
  532. * \brief API to reply to access layer message and optionally also to publish.
  533. *
  534. * \par Description
  535. * This routine replies to Access Layer message and also publish if requested by application.
  536. *
  537. * \param [in] handle Model Handle.
  538. * \param [in] saddr 16 bit Source Address.
  539. * \param [in] daddr 16 bit Destination Address.
  540. * \param [in] subnet_handle Subnet Handle.
  541. * \param [in] appkey_handle AppKey Handle.
  542. * \param [in] ttl Time to Live.
  543. * \param [in] opcode Access Opcode
  544. * \param [in] data_param Access parameter, based on the opcode
  545. * \param [in] data_length Access parameter length, based on the opcode
  546. * \param [in] to_publish Flag to indicate if the message also to be published
  547. *
  548. * \return API_SUCCESS or an error code indicating reason for failure
  549. */
  550. API_RESULT MS_access_reply_and_publish
  551. (
  552. /* IN */ MS_ACCESS_MODEL_HANDLE * handle,
  553. /* IN */ MS_NET_ADDR saddr,
  554. /* IN */ MS_NET_ADDR daddr,
  555. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  556. /* IN */ MS_APPKEY_HANDLE appkey_handle,
  557. /* IN */ UINT8 ttl,
  558. /* IN */ UINT32 opcode,
  559. /* IN */ UCHAR * data_param,
  560. /* IN */ UINT16 data_len,
  561. /* IN */ UINT8 to_publish
  562. );
  563. /**
  564. * \brief API to send Access PDUs
  565. *
  566. * \par Description
  567. * This routine sends transport PDUs to peer device.
  568. *
  569. * \param [in] saddr 16 bit Source Address.
  570. * \param [in] daddr 16 bit Destination Address.
  571. * \param [in] subnet_handle Subnet Handle.
  572. * \param [in] appkey_handle AppKey Handle.
  573. * \param [in] ttl Time to Live.
  574. * \param [in] opcode Access Opcode
  575. * \param [in] data_param Access parameter, based on the opcode
  576. * \param [in] data_length Access parameter length, based on the opcode
  577. * \param [in] reliable If requires lower transport Ack, set reliable as TRUE
  578. *
  579. * \return API_SUCCESS or an error code indicating reason for failure
  580. */
  581. API_RESULT MS_access_send_pdu
  582. (
  583. /* IN */ MS_NET_ADDR saddr,
  584. /* IN */ MS_NET_ADDR daddr,
  585. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  586. /* IN */ MS_APPKEY_HANDLE appkey_handle,
  587. /* IN */ UINT8 ttl,
  588. /* IN */ UINT32 opcode,
  589. /* IN */ UCHAR * data_param,
  590. /* IN */ UINT16 data_length,
  591. /* IN */ UINT8 reliable
  592. );
  593. /** TBD: add function header */
  594. API_RESULT MS_access_get_composition_data(/* OUT */ MS_BUFFER * buffer);
  595. /* Configuration Manager related interfaces */
  596. /**
  597. * \brief To reset a node
  598. *
  599. * \par Description
  600. * This routine resets a node (other than a Provisioner) and removes it from the network.
  601. *
  602. * \return API_SUCCESS or an error code indicating reason for failure
  603. */
  604. API_RESULT MS_access_cm_reset(void);
  605. /**
  606. * \brief To get the number of elements in local node
  607. *
  608. * \par Description
  609. * This routine retrieves the number of elements in local node.
  610. *
  611. * \param [out] count Number of elements
  612. *
  613. * \return API_SUCCESS or an error code indicating reason for failure
  614. */
  615. API_RESULT MS_access_cm_get_element_count
  616. (
  617. /* OUT */ UINT8 * count
  618. );
  619. /**
  620. * \brief To set primary unicast address
  621. *
  622. * \par Description
  623. * This routine sets primary unicast address.
  624. *
  625. * \param [in] addr Primary Unicast Address to be set
  626. *
  627. * \return API_SUCCESS or an error code indicating reason for failure
  628. */
  629. API_RESULT MS_access_cm_set_primary_unicast_address
  630. (
  631. /* IN */ MS_NET_ADDR addr
  632. );
  633. /**
  634. * \brief To get primary unicast address
  635. *
  636. * \par Description
  637. * This routine gets primary unicast address.
  638. *
  639. * \param [out] addr Memory location where Primary Unicast Address to be filled
  640. *
  641. * \return API_SUCCESS or an error code indicating reason for failure
  642. */
  643. API_RESULT MS_access_cm_get_primary_unicast_address
  644. (
  645. /* OUT */ MS_NET_ADDR * addr
  646. );
  647. /**
  648. * \brief To set default TTL
  649. *
  650. * \par Description
  651. * This routine sets default TTL.
  652. *
  653. * \param [in] ttl Default TTL to be set
  654. *
  655. * \return API_SUCCESS or an error code indicating reason for failure
  656. */
  657. API_RESULT MS_access_cm_set_default_ttl
  658. (
  659. /* IN */ UINT8 ttl
  660. );
  661. /**
  662. * \brief To get default TTL
  663. *
  664. * \par Description
  665. * This routine gets default TTL.
  666. *
  667. * \param [in] ttl Memory location where default TTL to be filled
  668. *
  669. * \return API_SUCCESS or an error code indicating reason for failure
  670. */
  671. API_RESULT MS_access_cm_get_default_ttl
  672. (
  673. /* IN */ UINT8 * ttl
  674. );
  675. /**
  676. * \brief To set IV Index
  677. *
  678. * \par Description
  679. * This routine sets IV Index.
  680. *
  681. * \param [in] iv_index IV Index to be set
  682. * \param [in] iv_update_flag IV Update Flag
  683. *
  684. * \return API_SUCCESS or an error code indicating reason for failure
  685. */
  686. API_RESULT MS_access_cm_set_iv_index
  687. (
  688. /* IN */ UINT32 iv_index,
  689. /* IN */ UINT8 iv_update_flag
  690. );
  691. /**
  692. * \brief To get IV Index
  693. *
  694. * \par Description
  695. * This routine gets IV Index.
  696. *
  697. * \param [out] iv_index Memory location where IV Index to be filled
  698. * \param [out] iv_update_flag Memory location where IV Update Flag to be filled
  699. *
  700. * \return API_SUCCESS or an error code indicating reason for failure
  701. */
  702. API_RESULT MS_access_cm_get_iv_index
  703. (
  704. /* OUT */ UINT32 * iv_index,
  705. /* OUT */ UINT8 * iv_update_flag
  706. );
  707. /**
  708. * \brief To get IV Index by IVI
  709. *
  710. * \par Description
  711. * This routine gets IV Index based on the IVI in the received packet.
  712. *
  713. * \param [in] ivi Least Significant bit of the IV Index used
  714. * in the nonce to authenticate and encrypt
  715. * the Network PDU.
  716. * \param [out] iv_index Memory location where IV Index to be filled
  717. *
  718. * \return API_SUCCESS or an error code indicating reason for failure
  719. */
  720. API_RESULT MS_access_cm_get_iv_index_by_ivi
  721. (
  722. /* IN */ UINT8 ivi,
  723. /* OUT */ UINT32 * iv_index
  724. );
  725. /**
  726. * \brief To enable/disable a feature
  727. *
  728. * \par Description
  729. * This routine enables/disables a feature field.
  730. *
  731. * \param [in] enable Enable or Disable
  732. * \param [in] feature Relay, proxy, friend or Low Power
  733. *
  734. * \return API_SUCCESS or an error code indicating reason for failure
  735. */
  736. API_RESULT MS_access_cm_set_features_field
  737. (
  738. /* IN */ UINT8 enable,
  739. /* IN */ UINT8 feature
  740. );
  741. /**
  742. * \brief To get state of a feature
  743. *
  744. * \par Description
  745. * This routine gets the state of a feature field.
  746. *
  747. * \param [out] enable Memory location where Enable or Disable status to be filled.
  748. * \param [in] feature Relay, proxy, friend or Low Power
  749. *
  750. * \return API_SUCCESS or an error code indicating reason for failure
  751. */
  752. API_RESULT MS_access_cm_get_features_field
  753. (
  754. /* OUT */ UINT8 * enable,
  755. /* IN */ UINT8 feature
  756. );
  757. /**
  758. * \brief To get state of all features
  759. *
  760. * \par Description
  761. * This routine gets the state of all features.
  762. *
  763. * \param [out] features State of Relay, proxy, friend and Low Power field
  764. *
  765. * \return API_SUCCESS or an error code indicating reason for failure
  766. */
  767. API_RESULT MS_access_cm_get_features
  768. (
  769. /* OUT */ UINT8 * features
  770. );
  771. /** Enable Relay Feature */
  772. #define MS_ENABLE_RELAY_FEATURE() \
  773. MS_access_cm_set_features_field(MS_ENABLE, MS_FEATURE_RELAY)
  774. /** Disable Relay Feature */
  775. #define MS_DISABLE_RELAY_FEATURE() \
  776. MS_access_cm_set_features_field(MS_DISABLE, MS_FEATURE_RELAY)
  777. /** Enable Proxy Feature */
  778. #define MS_ENABLE_PROXY_FEATURE() \
  779. MS_access_cm_set_features_field(MS_ENABLE, MS_FEATURE_PROXY)
  780. /** Disable Proxy Feature */
  781. #define MS_DISABLE_PROXY_FEATURE() \
  782. MS_access_cm_set_features_field(MS_DISABLE, MS_FEATURE_PROXY)
  783. /** Enable Friend Feature */
  784. #define MS_ENABLE_FRIEND_FEATURE() \
  785. MS_access_cm_set_features_field(MS_ENABLE, MS_FEATURE_FRIEND)
  786. /** Disable Friend Feature */
  787. #define MS_DISABLE_FRIEND_FEATURE() \
  788. MS_access_cm_set_features_field(MS_DISABLE, MS_FEATURE_FRIEND)
  789. /** Enable Low Power Feature */
  790. #define MS_ENABLE_LPN_FEATURE() \
  791. MS_access_cm_set_features_field(MS_ENABLE, MS_FEATURE_LPN)
  792. /** Disable Low Power Feature */
  793. #define MS_DISABLE_LPN_FEATURE() \
  794. MS_access_cm_set_features_field(MS_DISABLE, MS_FEATURE_LPN)
  795. /** Enable Secure Nework Beacon Feature */
  796. #define MS_ENABLE_SNB_FEATURE() \
  797. MS_access_cm_set_features_field(MS_ENABLE, MS_FEATURE_SEC_NET_BEACON)
  798. /** Disable Secure Nework Beacon Feature */
  799. #define MS_DISABLE_SNB_FEATURE() \
  800. MS_access_cm_set_features_field(MS_DISABLE, MS_FEATURE_SEC_NET_BEACON)
  801. /**
  802. * \brief To get friendship role of the node
  803. *
  804. * \par Description
  805. * This routine gets the current friendship role of the node.
  806. *
  807. * \param [out] frnd_role Friend role
  808. *
  809. * \return API_SUCCESS or an error code indicating reason for failure
  810. */
  811. API_RESULT MS_access_cm_get_friendship_role
  812. (
  813. /* OUT */ UINT8 * frnd_role
  814. );
  815. /**
  816. * \brief To set friendship role of the node
  817. *
  818. * \par Description
  819. * This routine sets the current friendship role of the node.
  820. *
  821. * \param [out] frnd_role Friend role
  822. *
  823. * \return API_SUCCESS or an error code indicating reason for failure
  824. */
  825. API_RESULT MS_access_cm_set_friendship_role
  826. (
  827. /* IN */ UINT8 frnd_role
  828. );
  829. /**
  830. * \brief To add Device Key
  831. *
  832. * \par Description
  833. * This routine adds Device Key entry, along with corresponding
  834. * Primary Device Address and Number of elements.
  835. *
  836. * \param [in] dev_key Device Key to be added.
  837. * \param [in] uaddr Unicast Address of the first element.
  838. * \param [in] num_elements Number of elements.
  839. *
  840. * \return API_SUCCESS or an error code indicating reason for failure
  841. */
  842. API_RESULT MS_access_cm_add_device_key
  843. (
  844. /* IN */ UINT8 * dev_key,
  845. /* IN */ MS_NET_ADDR uaddr,
  846. /* IN */ UINT8 num_elements
  847. );
  848. /**
  849. * \brief To get Device Key
  850. *
  851. * \par Description
  852. * This routine gets Device Key entry.
  853. *
  854. * \param [in] dev_key_index Device Key Index.
  855. * \param [out] dev_key Pointer to Device Key to be returned.
  856. *
  857. * \return API_SUCCESS or an error code indicating reason for failure
  858. */
  859. API_RESULT MS_access_cm_get_device_key
  860. (
  861. /* IN */ UINT8 dev_key_index,
  862. /* OUT */ UINT8 ** dev_key
  863. );
  864. /**
  865. * \brief To remove all Device Keys
  866. *
  867. * \par Description
  868. * This routine removes all Device Keys from table.
  869. *
  870. * \return API_SUCCESS or an error code indicating reason for failure
  871. */
  872. API_RESULT MS_access_cm_remove_all_device_keys(void);
  873. /**
  874. * \brief To get list of Provisioned Device List
  875. *
  876. * \par Description
  877. * This routine returns list of Provisioned Devices from the Device Key Table.
  878. *
  879. * \param [in] prov_dev_list Provisioned Device List.
  880. * \param [inout] num_entries Size of the Device Key List provided by the caller.
  881. * This routine will return the number of entries
  882. * in the Device Key Table.
  883. *
  884. * \return API_SUCCESS or an error code indicating reason for failure
  885. */
  886. API_RESULT MS_access_cm_get_prov_devices_list
  887. (
  888. /* IN */ MS_PROV_DEV_ENTRY * prov_dev_list,
  889. /* OUT */ UINT16 * num_entries,
  890. /* OUT */ UINT16 * pointer
  891. );
  892. /**
  893. * \brief To get Device Key Handle
  894. *
  895. * \par Description
  896. * This routine returns Device Key Handle for a given Primary Element Address
  897. * entry in Device Key Table.
  898. *
  899. * \param [in] prim_elem_uaddr Primary element address to be searched
  900. * \param [out] handle Device Key Table Handle, if match is found.
  901. *
  902. * \return API_SUCCESS or an error code indicating reason for failure
  903. */
  904. API_RESULT MS_access_cm_get_device_key_handle
  905. (
  906. /* IN */ MS_NET_ADDR prim_elem_uaddr,
  907. /* OUT */ MS_ACCESS_DEV_KEY_HANDLE * handle
  908. );
  909. /**
  910. * \brief To delete Device Key
  911. *
  912. * \par Description
  913. * This routine returns status for a given Primary Element Address
  914. * entry in Device Key Table.
  915. *
  916. * \param [in] handle Device Key Table Handle, if match is found.
  917. *
  918. * \return API_SUCCESS or an error code indicating reason for failure
  919. */
  920. API_RESULT MS_access_cm_delete_device_key
  921. (
  922. /* IN */ MS_ACCESS_DEV_KEY_HANDLE handle
  923. );
  924. /**
  925. * \brief To get AppKey
  926. *
  927. * \par Description
  928. * This routine gets AppKey along with AID entry.
  929. *
  930. * \param [in] appkey_handle AppKey Handle.
  931. * \param [out] app_key Pointer to AppKey to be returned.
  932. * \param [out] aid Pointer to AID to be returned.
  933. *
  934. * \return API_SUCCESS or an error code indicating reason for failure
  935. */
  936. API_RESULT MS_access_cm_get_app_key
  937. (
  938. /* IN */ MS_APPKEY_HANDLE appkey_handle,
  939. /* OUT */ UINT8 ** app_key,
  940. /* OUT */ UINT8 * aid
  941. );
  942. /**
  943. * \brief To add/update NetKey
  944. *
  945. * \par Description
  946. * This routine adds/updates NetKey entry. Each NetKey is associated with a subnet.
  947. *
  948. * \param [in] netkey_index Identifies global Index of NetKey. A 12-bit value.
  949. * \param [in] opcode To identify Add or Update NetKey
  950. * \param [in] net_key Associated NetKey to be added/updated.
  951. *
  952. * \return API_SUCCESS or an error code indicating reason for failure
  953. */
  954. API_RESULT MS_access_cm_add_update_netkey
  955. (
  956. /* IN */ UINT16 netkey_index,
  957. /* IN */ UINT32 opcode,
  958. /* IN */ UINT8 * net_key
  959. );
  960. /**
  961. * \brief To add Security Credential of a LPN or the Friend.
  962. *
  963. * \par Description
  964. * This routine adds NID, privacy and encryption keys associated with a friendship.
  965. *
  966. * \param [in] subnet_handle Identifies associated subnet.
  967. * \param [in] friend_offset Friend Offset.
  968. * \param [in] lpn_addr Address of the LPN.
  969. * \param [in] friend_addr Address of the Friend.
  970. * \param [in] lpn_counter Number of Friend Request messages the LPN has sent.
  971. * \param [in] friend_counter Number of Friend Offer messages the Friend has sent.
  972. *
  973. * \return API_SUCCESS or an error code indicating reason for failure
  974. */
  975. API_RESULT MS_access_cm_add_friend_sec_credential
  976. (
  977. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  978. /* IN */ UINT16 friend_offset,
  979. /* IN */ MS_NET_ADDR lpn_addr,
  980. /* IN */ MS_NET_ADDR friend_addr,
  981. /* IN */ UINT16 lpn_counter,
  982. /* IN */ UINT16 friend_counter
  983. );
  984. /**
  985. * \brief To delete the Security Credential of a LPN or the Friend.
  986. *
  987. * \par Description
  988. * This routine deletes NID, privacy and encryption keys associated with a friendship.
  989. *
  990. * \param [in] subnet_handle Identifies associated subnet.
  991. * \param [in] friend_index Friend Index.
  992. *
  993. * \return API_SUCCESS or an error code indicating reason for failure
  994. */
  995. API_RESULT MS_access_cm_delete_friend_sec_credential
  996. (
  997. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  998. /* IN */ UINT16 friend_index
  999. );
  1000. /**
  1001. * \brief To find a Subnet associated with the NetKey
  1002. *
  1003. * \par Description
  1004. * This routine finds a Subnet based on the NetKey entry. Each NetKey is associated with a subnet.
  1005. *
  1006. * \param [in] netkey_index Identifies global Index of NetKey, corresponding Subnet to be returned.
  1007. * \param [out] subnet_handle Memory location to be filled with Subnet Handle, if search is successful.
  1008. *
  1009. * \return API_SUCCESS or an error code indicating reason for failure
  1010. */
  1011. API_RESULT MS_access_cm_find_subnet
  1012. (
  1013. /* IN */ UINT16 netkey_index,
  1014. /* OUT */ MS_SUBNET_HANDLE * subnet_handle
  1015. );
  1016. /**
  1017. * \brief To find the Master Subnet associated with the friend security credential, identified by Friend Subnet Handle.
  1018. *
  1019. * \par Description
  1020. * This routine finds the Master Subnet based on the friend security credential, identified by Friend Subnet Handle.
  1021. *
  1022. * \param [out] friend_subnet_handle Idetifies the Friend Subnet Handle, corresponding to Friend Subnet Handle.
  1023. * \param [in] master_subnet_handle Memory location to be filled with Master Subnet Handle, if search is successful.
  1024. *
  1025. * \return API_SUCCESS or an error code indicating reason for failure
  1026. */
  1027. API_RESULT MS_access_cm_find_master_subnet
  1028. (
  1029. /* IN */ MS_SUBNET_HANDLE friend_subnet_handle,
  1030. /* OUT */ MS_SUBNET_HANDLE * master_subnet_handle
  1031. );
  1032. /**
  1033. * \brief To delete NetKey
  1034. *
  1035. * \par Description
  1036. * This routine deletes a NetKey entry. Each NetKey is associated with a subnet.
  1037. *
  1038. * \param [in] subnet_handle Handle of the Subnet for which NetKey to be deleted.
  1039. *
  1040. * \return API_SUCCESS or an error code indicating reason for failure
  1041. */
  1042. API_RESULT MS_access_cm_delete_netkey
  1043. (
  1044. /* IN */ MS_SUBNET_HANDLE subnet_handle
  1045. );
  1046. /**
  1047. * \brief To get NetKey
  1048. *
  1049. * \par Description
  1050. * This routine fetches a NetKey entry. Each NetKey is associated with a subnet.
  1051. *
  1052. * \param [in] subnet_handle Handle of the Subnet for which NetKey to be deleted.
  1053. * \param [out] net_key Netkey associated with the Subnet.
  1054. *
  1055. * \return API_SUCCESS or an error code indicating reason for failure
  1056. */
  1057. API_RESULT MS_access_cm_get_netkey_at_offset
  1058. (
  1059. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  1060. /* IN */ UINT8 offset,
  1061. /* OUT */ UINT8 * net_key
  1062. );
  1063. /**
  1064. * \brief To get list of all known NetKeys
  1065. *
  1066. * \par Description
  1067. * This routine returns a list of known NetKey Indices.
  1068. *
  1069. * \param [inout] netkey_count Caller fills with maximum number of NetKey Indices
  1070. * that can be stored in 'netkey_index_list'.
  1071. * This function will update the value with how many NetKey
  1072. * Indices has been filled. If the number of available
  1073. * NetKey Indices is more than that can be returned,
  1074. * maximum possible Indices will be filled and
  1075. * an appropriate error values will inform the caller,
  1076. * there are more NetKey Indices (as an information).
  1077. * \param [out] netkey_index_list Memory to be filled with the available NetKey Indices.
  1078. *
  1079. * \return API_SUCCESS or an error code indicating reason for failure
  1080. */
  1081. API_RESULT MS_access_cm_get_netkey_index_list
  1082. (
  1083. /* INOUT */ UINT16 * netkey_count,
  1084. /* OUT */ UINT16 * netkey_index_list
  1085. );
  1086. /**
  1087. * \brief To search for NID
  1088. *
  1089. * \par Description
  1090. * This routine searches for matching NID in subnet table.
  1091. *
  1092. * \param [in] nid NID to be searched in all known subnets for match.
  1093. * \param [inout] subnet_handle Same NID can match with multiple subnets.
  1094. * Caller will fill this value to indicate from which
  1095. * subnet handle the search to be started. This function
  1096. * will return the subnet handle, where the match is found
  1097. * (in case of match). Caller while searching for the same
  1098. * NID, in the subsequent call can pass the subnet_handle
  1099. * received in the previous match for the NID.
  1100. * For the very first call when searching for a NID,
  1101. * the caller need to use Invalid Subnet Handle
  1102. * \ref MS_INVALID_SUBNET_HANDLE.
  1103. * \param [out] privacy_key Privacy Key associated with the subnet.
  1104. * \param [out] encrypt_key Encyption Key associated with the subnet.
  1105. *
  1106. * \return API_SUCCESS or an error code indicating reason for failure
  1107. */
  1108. API_RESULT MS_access_cm_lookup_nid
  1109. (
  1110. /* IN */ UINT8 nid,
  1111. /* INOUT */ MS_SUBNET_HANDLE * subnet_handle,
  1112. /* OUT */ UINT8 * privacy_key,
  1113. /* OUT */ UINT8 * encrypt_key
  1114. );
  1115. /**
  1116. * \brief To search for Network ID
  1117. *
  1118. * \par Description
  1119. * This routine searches for matching Network ID in subnet table.
  1120. *
  1121. * \param [in] network_id Network ID to be searched in all known subnets for match.
  1122. * \param [inout] subnet_handle Same NID can match with multiple subnets.
  1123. * Caller will fill this value to indicate from which
  1124. * subnet handle the search to be started. This function
  1125. * will return the subnet handle, where the match is found
  1126. * (in case of match). Caller while searching for the same
  1127. * NID, in the subsequent call can pass the subnet_handle
  1128. * received in the previous match for the NID.
  1129. * For the very first call when searching for a NID,
  1130. * the caller need to use Invalid Subnet Handle
  1131. * \ref MS_INVALID_SUBNET_HANDLE.
  1132. * \param [out] beacon_key Beacon Key associated with the subnet.
  1133. * \param [out] is_new_key Flag to indicate if the network ID is associated with
  1134. * the new Network Key being updated.
  1135. *
  1136. * \return API_SUCCESS or an error code indicating reason for failure
  1137. */
  1138. API_RESULT MS_access_cm_lookup_network_id
  1139. (
  1140. /* IN */ UINT8 * network_id,
  1141. /* INOUT */ MS_SUBNET_HANDLE * subnet_handle,
  1142. /* OUT */ UINT8 * beacon_key,
  1143. /* OUT */ UINT8 * is_new_key
  1144. );
  1145. /**
  1146. * \brief To search for AID
  1147. *
  1148. * \par Description
  1149. * This routine searches for matching NID in subnet table.
  1150. *
  1151. * \param [in] aid AID to be searched in all known AppKeys for match.
  1152. * \param [inout] appkey_handle Same AID can match with multiple AppKeys.
  1153. * Caller will fill this value to indicate from which
  1154. * AppKey handle the search to be started. This function
  1155. * will return the AppKey handle, where the match is found
  1156. * (in case of match). Caller while searching for the same
  1157. * AID, in the subsequent call can pass the appkey_handle
  1158. * received in the previous match for the AID.
  1159. * For the very first call when searching for a AID,
  1160. * the caller need to use Invalid Subnet Handle
  1161. * \ref MS_INVALID_APPKEY_HANDLE.
  1162. * \param [out] app_key AppKey associated with the AID.
  1163. *
  1164. * \return API_SUCCESS or an error code indicating reason for failure
  1165. */
  1166. API_RESULT MS_access_cm_lookup_aid
  1167. (
  1168. /* IN */ UINT8 aid,
  1169. /* INOUT */ MS_APPKEY_HANDLE * appkey_handle,
  1170. /* OUT */ UINT8 * app_key
  1171. );
  1172. /**
  1173. * \brief Set Provisioning Data
  1174. *
  1175. * \par Description
  1176. * This routine configures the provisioning data with Access Layer.
  1177. *
  1178. * \param prov_data
  1179. * Provisioning data received during provisioning procedure.
  1180. *
  1181. * \return API_SUCCESS or an error code indicating reason for failure
  1182. */
  1183. API_RESULT MS_access_cm_set_prov_data
  1184. (
  1185. /* IN */ PROV_DATA_S * prov_data
  1186. );
  1187. API_RESULT MS_access_cm_set_prov_data_provsioner
  1188. (
  1189. /* IN */ PROV_DATA_S * prov_data
  1190. );
  1191. /**
  1192. * \brief To get NID associated with a subnet
  1193. *
  1194. * \par Description
  1195. * This routine fetches the NID associated with a subnet.
  1196. *
  1197. * \param [in] handle Handle identifing the subnet.
  1198. * \param [out] nid NID associated with the subnet.
  1199. *
  1200. * \return API_SUCCESS or an error code indicating reason for failure
  1201. */
  1202. API_RESULT MS_access_cm_get_subnet_nid
  1203. (
  1204. /* IN */ MS_SUBNET_HANDLE handle,
  1205. /* OUT */ UINT8 * nid
  1206. );
  1207. /**
  1208. * \brief To get Privacy Key associated with a subnet
  1209. *
  1210. * \par Description
  1211. * This routine fetches the Privacy Key associated with a subnet.
  1212. *
  1213. * \param [in] handle Handle identifing the subnet.
  1214. * \param [out] privacy_key Privacy Key associated with the subnet.
  1215. *
  1216. * \return API_SUCCESS or an error code indicating reason for failure
  1217. */
  1218. API_RESULT MS_access_cm_get_subnet_privacy_key
  1219. (
  1220. /* IN */ MS_SUBNET_HANDLE handle,
  1221. /* OUT */ UINT8 * privacy_key
  1222. );
  1223. /**
  1224. * \brief To get Network ID associated with a subnet
  1225. *
  1226. * \par Description
  1227. * This routine fetches the Netowrk ID associated with a subnet.
  1228. *
  1229. * \param [in] handle Handle identifing the subnet.
  1230. * \param [out] network_id Network ID associated with the subnet.
  1231. *
  1232. * \return API_SUCCESS or an error code indicating reason for failure
  1233. */
  1234. API_RESULT MS_access_cm_get_subnet_network_id
  1235. (
  1236. /* IN */ MS_SUBNET_HANDLE handle,
  1237. /* OUT */ UINT8 * network_id
  1238. );
  1239. /**
  1240. * \brief To get Beacon Key associated with a subnet
  1241. *
  1242. * \par Description
  1243. * This routine fetches the Beacon Key associated with a subnet.
  1244. *
  1245. * \param [in] handle Handle identifing the subnet.
  1246. * \param [out] beacon_key Beacon Key associated with the subnet.
  1247. *
  1248. * \return API_SUCCESS or an error code indicating reason for failure
  1249. */
  1250. API_RESULT MS_access_cm_get_subnet_beacon_key
  1251. (
  1252. /* IN */ MS_SUBNET_HANDLE handle,
  1253. /* OUT */ UINT8 * beacon_key
  1254. );
  1255. /**
  1256. * \brief To get Identity Key associated with a subnet
  1257. *
  1258. * \par Description
  1259. * This routine fetches the Identity Key associated with a subnet.
  1260. *
  1261. * \param [in] handle Handle identifing the subnet.
  1262. * \param [out] identity_key Identity Key associated with the subnet.
  1263. *
  1264. * \return API_SUCCESS or an error code indicating reason for failure
  1265. */
  1266. API_RESULT MS_access_cm_get_subnet_identity_key
  1267. (
  1268. /* IN */ MS_SUBNET_HANDLE handle,
  1269. /* OUT */ UINT8 * identity_key
  1270. );
  1271. /**
  1272. * \brief To get Encryption Key associated with a subnet
  1273. *
  1274. * \par Description
  1275. * This routine fetches the Encryption Key associated with a subnet.
  1276. *
  1277. * \param [in] handle Handle identifing the subnet.
  1278. * \param [out] encrypt_key Encyption Key associated with the subnet.
  1279. *
  1280. * \return API_SUCCESS or an error code indicating reason for failure
  1281. */
  1282. API_RESULT MS_access_cm_get_subnet_encryption_key
  1283. (
  1284. /* IN */ MS_SUBNET_HANDLE handle,
  1285. /* OUT */ UINT8 * encrypt_key
  1286. );
  1287. /**
  1288. * \brief To get Node Identity
  1289. *
  1290. * \par Description
  1291. * This routine gets Node Identity State of a node
  1292. *
  1293. * \param [in] subnet_handle Handle identifing the subnet.
  1294. * \param [out] id_state Memory location where Node Identity state to be filled.
  1295. *
  1296. * \return API_SUCCESS or an error code indicating reason for failure
  1297. */
  1298. API_RESULT MS_access_cm_get_node_identity
  1299. (
  1300. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  1301. /* OUT */ UINT8 * id_state
  1302. );
  1303. /**
  1304. * \brief To set Node Identity
  1305. *
  1306. * \par Description
  1307. * This routine sets Node Identity State of a node
  1308. *
  1309. * \param [in] subnet_handle Handle identifing the subnet.
  1310. * \param [in, out] id_state Node Identity state to be set.
  1311. *
  1312. * \return API_SUCCESS or an error code indicating reason for failure
  1313. */
  1314. API_RESULT MS_access_cm_set_node_identity
  1315. (
  1316. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  1317. /* INOUT */ UINT8 * id_state
  1318. );
  1319. /**
  1320. * \brief To get Key Refresh Phase
  1321. *
  1322. * \par Description
  1323. * This routine gets Key Refresh Phase State of a node
  1324. *
  1325. * \param [in] subnet_handle Handle identifing the subnet.
  1326. * \param [out] key_refresh_state Memory location where Key Refresh Phase state to be filled.
  1327. *
  1328. * \return API_SUCCESS or an error code indicating reason for failure
  1329. */
  1330. API_RESULT MS_access_cm_get_key_refresh_phase
  1331. (
  1332. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  1333. /* OUT */ UINT8 * key_refresh_state
  1334. );
  1335. /**
  1336. * \brief To set Key Refresh Phase
  1337. *
  1338. * \par Description
  1339. * This routine sets Key Refresh Phase State of a node
  1340. *
  1341. * \param [in] subnet_handle Handle identifing the subnet.
  1342. * \param [in, out] key_refresh_state Key Refresh Phase state to be set.
  1343. *
  1344. * \return API_SUCCESS or an error code indicating reason for failure
  1345. */
  1346. API_RESULT MS_access_cm_set_key_refresh_phase
  1347. (
  1348. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  1349. /* IN */ UINT8 * key_refresh_state
  1350. );
  1351. /**
  1352. * \brief To set Network/Relay Transmit state
  1353. *
  1354. * \par Description
  1355. * This routine sets Network/Relay Transmit state.
  1356. *
  1357. * \param [in] tx_state_type Transmit State Type (Network or Relay)
  1358. * \param [in] tx_state Composite state (3-bits of Tx Count and 5-bits of Tx Interval Steps)
  1359. *
  1360. * \return API_SUCCESS or an error code indicating reason for failure
  1361. */
  1362. API_RESULT MS_access_cm_set_transmit_state
  1363. (
  1364. /* IN */ UINT8 tx_state_type,
  1365. /* IN */ UINT8 tx_state
  1366. );
  1367. /**
  1368. * \brief To get Network/Relay Transmit state
  1369. *
  1370. * \par Description
  1371. * This routine gets Network/Relay Transmit state.
  1372. *
  1373. * \param [in] tx_state_type Transmit State Type (Network or Relay)
  1374. * \param [out] tx_state Memory location to fill Composite state
  1375. * (3-bits of Tx Count and 5-bits of Tx Interval Steps)
  1376. *
  1377. * \return API_SUCCESS or an error code indicating reason for failure
  1378. */
  1379. API_RESULT MS_access_cm_get_transmit_state
  1380. (
  1381. /* IN */ UINT8 tx_state_type,
  1382. /* OUT */ UINT8 * tx_state
  1383. );
  1384. /**
  1385. * \brief To add AppKey
  1386. *
  1387. * \par Description
  1388. * This routine adds AppKey entry. Each AppKey is associated with a subnet.
  1389. *
  1390. * \param [in] subnet_handle Handle of the Subnet for which AppKey to be added.
  1391. * \param [in] appkey_index Identifies global Index of AppKey. A 12-bit value.
  1392. * \param [in] app_key Associated AppKey to be added.
  1393. *
  1394. * \return API_SUCCESS or an error code indicating reason for failure
  1395. */
  1396. API_RESULT MS_access_cm_add_appkey
  1397. (
  1398. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  1399. /* IN */ UINT16 appkey_index,
  1400. /* IN */ UINT8 * app_key
  1401. );
  1402. /**
  1403. * \brief To update/delete AppKey
  1404. *
  1405. * \par Description
  1406. * This routine updates/deletes AppKey entry. Each AppKey is associated with a subnet.
  1407. *
  1408. * \param [in] subnet_handle Handle of the Subnet for which AppKey to be updated/deleted.
  1409. * \param [in] appkey_index Identifies global Index of AppKey. A 12-bit value.
  1410. * \param [in] opcode To identify Delete or Update NetKey
  1411. * \param [in] app_key Associated AppKey to be updated.
  1412. *
  1413. * \return API_SUCCESS or an error code indicating reason for failure
  1414. */
  1415. API_RESULT MS_access_cm_update_delete_appkey
  1416. (
  1417. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  1418. /* IN */ UINT16 appkey_index,
  1419. /* IN */ UINT32 opcode,
  1420. /* IN */ UINT8 * app_key
  1421. );
  1422. /**
  1423. * \brief To update AppKey
  1424. *
  1425. * \par Description
  1426. * This routine/macro updates AppKey entry. Each AppKey is associated with a subnet.
  1427. *
  1428. * \param [in] subnet_handle Handle of the Subnet for which AppKey to be updated.
  1429. * \param [in] appkey_index Identifies global Index of AppKey. A 12-bit value.
  1430. * \param [in] app_key Associated AppKey to be updated.
  1431. *
  1432. * \return API_SUCCESS or an error code indicating reason for failure
  1433. */
  1434. #define MS_access_cm_update_appkey(sn, aki, ak) \
  1435. MS_access_cm_update_delete_appkey((sn), (aki), MS_ACCESS_CONFIG_APPKEY_UPDATE_OPCODE, (ak))
  1436. /**
  1437. * \brief To delete AppKey
  1438. *
  1439. * \par Description
  1440. * This routine/macro deletes AppKey entry. Each AppKey is associated with a subnet.
  1441. *
  1442. * \param [in] subnet_handle Handle of the Subnet for which AppKey to be deleted.
  1443. * \param [in] appkey_index Identifies global Index of AppKey. A 12-bit value.
  1444. * \param [in] app_key Associated AppKey to be updated.
  1445. *
  1446. * \return API_SUCCESS or an error code indicating reason for failure
  1447. */
  1448. #define MS_access_cm_delete_appkey(sn, aki, ak) \
  1449. MS_access_cm_update_delete_appkey((sn), (aki), MS_ACCESS_CONFIG_APPKEY_DELETE_OPCODE, (ak))
  1450. /**
  1451. * \brief To get AppKey Handle for a given AppKey Index
  1452. *
  1453. * \par Description
  1454. * This routine gets AppKey Handle for a given AppKey Index. Each AppKey is associated with a subnet.
  1455. *
  1456. * \param [in] subnet_handle Handle of the Subnet for which AppKey to be updated.
  1457. * \param [in] appkey_index Identifies global Index of AppKey. A 12-bit value.
  1458. * \param [in] app_key Associated AppKey to be matched.
  1459. * \param [out] appkey_handle Memory to hold the associated AppKey Handle.
  1460. *
  1461. * \return API_SUCCESS or an error code indicating reason for failure
  1462. */
  1463. API_RESULT MS_access_cm_get_appkey_handle
  1464. (
  1465. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  1466. /* IN */ UINT16 appkey_index,
  1467. /* IN */ UINT8 * app_key,
  1468. /* OUT */ MS_APPKEY_HANDLE * appkey_handle
  1469. );
  1470. /**
  1471. * \brief To get list of all known AppKeys
  1472. *
  1473. * \par Description
  1474. * This routine returns a list of known AppKey Indices associated with a subnet.
  1475. *
  1476. * \param [in] subnet_handle Handle of the Subnet for which AppKey to be returned.
  1477. * \param [inout] appkey_count Caller fills with maximum number of AppKey Indices
  1478. * that can be stored in 'apptkey_index_list'.
  1479. * This function will update the value with how many AppKey
  1480. * Indices has been filled. If the number of available
  1481. * AppKey Indices is more than that can be returned,
  1482. * maximum possible Indices will be filled and
  1483. * an appropriate error values will inform the caller,
  1484. * there are more NetKey Indices (as an information).
  1485. * \param [out] appkey_index_list Memory to be filled with the available AppKey Indices.
  1486. *
  1487. * \return API_SUCCESS or an error code indicating reason for failure
  1488. */
  1489. API_RESULT MS_access_cm_get_appkey_index_list
  1490. (
  1491. /* IN */ MS_SUBNET_HANDLE subnet_handle,
  1492. /* INOUT */ UINT16 * appkey_count,
  1493. /* OUT */ UINT16 * appkey_index_list
  1494. );
  1495. /**
  1496. * \brief To bind a model with an AppKey
  1497. *
  1498. * \par Description
  1499. * This routine binds a model with an AppKey.
  1500. *
  1501. * \param [in] model_handle Model handle identifing the model.
  1502. * \param [in] appkey_index Identifies global Index of AppKey. A 12-bit value.
  1503. *
  1504. * \return API_SUCCESS or an error code indicating reason for failure
  1505. */
  1506. API_RESULT MS_access_bind_model_app
  1507. (
  1508. /* IN */ MS_ACCESS_MODEL_HANDLE model_handle,
  1509. /* IN */ UINT16 appkey_index
  1510. );
  1511. /**
  1512. * \brief To unbind a model with an AppKey
  1513. *
  1514. * \par Description
  1515. * This routine unbinds a model with an AppKey.
  1516. *
  1517. * \param [in] model_handle Model handle identifing the model.
  1518. * \param [in] appkey_index Identifies global Index of AppKey. A 12-bit value.
  1519. *
  1520. * \return API_SUCCESS or an error code indicating reason for failure
  1521. */
  1522. API_RESULT MS_access_unbind_model_app
  1523. (
  1524. /* IN */ MS_ACCESS_MODEL_HANDLE model_handle,
  1525. /* IN */ UINT16 appkey_index
  1526. );
  1527. /**
  1528. * \brief To get list of all AppKeys associated with a model
  1529. *
  1530. * \par Description
  1531. * This routine returns a list of known AppKey Indices associated with a model.
  1532. *
  1533. * \param [in] model_handle Handle of the Model for which AppKey to be returned.
  1534. * \param [inout] appkey_count Caller fills with maximum number of AppKey Indices
  1535. * that can be stored in 'apptkey_index_list'.
  1536. * This function will update the value with how many AppKey
  1537. * Indices has been filled. If the number of available
  1538. * AppKey Indices is more than that can be returned,
  1539. * maximum possible Indices will be filled and
  1540. * an appropriate error values will inform the caller,
  1541. * there are more NetKey Indices (as an information).
  1542. * \param [out] appkey_index_list Memory to be filled with the available AppKey Indices.
  1543. *
  1544. * \return API_SUCCESS or an error code indicating reason for failure
  1545. */
  1546. API_RESULT MS_access_cm_get_model_app_list
  1547. (
  1548. /* IN */ MS_ACCESS_MODEL_HANDLE model_handle,
  1549. /* INOUT */ UINT16 * appkey_count,
  1550. /* OUT */ UINT16 * appkey_index_list
  1551. );
  1552. /**
  1553. * \brief To set Publication information associated with a model
  1554. *
  1555. * \par Description
  1556. * This routine sets Publication information associated with a model.
  1557. *
  1558. * \param [in] model_handle Handle of the Model for which Publication info to be set.
  1559. * \param [inout] publish_info Publication Information to be set.
  1560. * If Label UUID is used, on success corresponding
  1561. * Virtual Address will be filled and returned.
  1562. *
  1563. * \return API_SUCCESS or an error code indicating reason for failure
  1564. */
  1565. API_RESULT MS_access_cm_set_model_publication
  1566. (
  1567. /* IN */ MS_ACCESS_MODEL_HANDLE model_handle,
  1568. /* INOUT */ MS_ACCESS_PUBLISH_INFO * publish_info
  1569. );
  1570. /**
  1571. * \brief To set Publication Fast Period Divisor information associated with a model
  1572. *
  1573. * \par Description
  1574. * This routine sets Publication Fast Period Divisor information associated with a model.
  1575. *
  1576. * \param [in] model_handle Handle of the Model for which Publication info to be set.
  1577. * \param [in] period_divisor The value range for the Health Fast Period Divisor state is
  1578. * 0 through 15, all other values are prohibited.
  1579. * This is used to divide the Health Publish Period by 2^n,
  1580. * where the n is the value of the Health Fast Period Divisor state.
  1581. *
  1582. * \return API_SUCCESS or an error code indicating reason for failure
  1583. */
  1584. API_RESULT MS_access_cm_set_model_publication_period_divisor
  1585. (
  1586. /* IN */ MS_ACCESS_MODEL_HANDLE model_handle,
  1587. /* IN */ UINT8 period_divisor
  1588. );
  1589. /**
  1590. * \brief To get Publication information associated with a model
  1591. *
  1592. * \par Description
  1593. * This routine returns Publication information associated with a model.
  1594. *
  1595. * \param [in] model_handle Handle of the Model for which Publication info to be returned.
  1596. * \param [out] publish_info Memory to be filled with associated Publication info.
  1597. *
  1598. * \return API_SUCCESS or an error code indicating reason for failure
  1599. */
  1600. API_RESULT MS_access_cm_get_model_publication
  1601. (
  1602. /* IN */ MS_ACCESS_MODEL_HANDLE model_handle,
  1603. /* OUT */ MS_ACCESS_PUBLISH_INFO * publish_info
  1604. );
  1605. /**
  1606. * \brief To add an address to a model subscription list
  1607. *
  1608. * \par Description
  1609. * This routine adds an address to a subscription list of a model
  1610. *
  1611. * \param [in] model_handle Handle of the Model for which address to be added in the subscription list.
  1612. * \param [in] sub_addr Address to be added in subscription list.
  1613. *
  1614. * \return API_SUCCESS or an error code indicating reason for failure
  1615. */
  1616. API_RESULT MS_access_cm_add_model_subscription
  1617. (
  1618. /* IN */ MS_ACCESS_MODEL_HANDLE model_handle,
  1619. /* IN */ MS_ACCESS_ADDRESS * sub_addr
  1620. );
  1621. /**
  1622. * \brief To delete an address to a model subscription list
  1623. *
  1624. * \par Description
  1625. * This routine deletes an address to a subscription list of a model
  1626. *
  1627. * \param [in] model_handle Handle of the Model for which address to be deleteed in the subscription list.
  1628. * \param [in] sub_addr Address to be deleted from subscription list.
  1629. *
  1630. * \return API_SUCCESS or an error code indicating reason for failure
  1631. */
  1632. API_RESULT MS_access_cm_delete_model_subscription
  1633. (
  1634. /* IN */ MS_ACCESS_MODEL_HANDLE model_handle,
  1635. /* IN */ MS_ACCESS_ADDRESS * sub_addr
  1636. );
  1637. /**
  1638. * \brief To discard a model subscription list
  1639. *
  1640. * \par Description
  1641. * This routine discards a subscription list of a model
  1642. *
  1643. * \param [in] model_handle Handle of the Model for which the subscription list to be discarded.
  1644. *
  1645. * \return API_SUCCESS or an error code indicating reason for failure
  1646. */
  1647. API_RESULT MS_access_cm_delete_all_model_subscription
  1648. (
  1649. /* IN */ MS_ACCESS_MODEL_HANDLE model_handle
  1650. );
  1651. /**
  1652. * \brief To get list of subscription addresses of a model
  1653. *
  1654. * \par Description
  1655. * This routine returns a list of subscription addresses of a model.
  1656. *
  1657. * \param [in] model_handle Handle of the Model for which the subscription addresses to be returned.
  1658. * \param [inout] sub_addr_count Caller fills with maximum number of subscription addresses
  1659. * that can be stored in 'sub_addr_list'.
  1660. * This function will update the value with how many subscription addresses
  1661. * has been filled. If the number of available subscription addresses is more than that can be returned,
  1662. * maximum possible addresses will be filled and an appropriate error values will inform the caller,
  1663. * there are more subscription addresses (as an information).
  1664. * \param [out] sub_addr_list Memory to be filled with the available subscription addresses.
  1665. *
  1666. * \return API_SUCCESS or an error code indicating reason for failure
  1667. */
  1668. API_RESULT MS_access_cm_get_model_subscription_list
  1669. (
  1670. /* IN */ MS_ACCESS_MODEL_HANDLE model_handle,
  1671. /* INOUT */ UINT16 * sub_addr_count,
  1672. /* OUT */ UINT16 * sub_addr_list
  1673. );
  1674. /**
  1675. * \brief To get list of subscription addresses of all the models
  1676. *
  1677. * \par Description
  1678. * This routine returns a consolidated list of subscription addresses of all the models.
  1679. *
  1680. * \param [inout] sub_addr_count Caller fills with maximum number of subscription addresses
  1681. * that can be stored in 'sub_addr_list'.
  1682. * This function will update the value with how many subscription addresses
  1683. * has been filled. If the number of available subscription addresses is more than that can be returned,
  1684. * maximum possible addresses will be filled and an appropriate error values will inform the caller,
  1685. * there are more subscription addresses (as an information).
  1686. * \param [out] sub_addr_list Memory to be filled with the available subscription addresses.
  1687. *
  1688. * \return API_SUCCESS or an error code indicating reason for failure
  1689. */
  1690. API_RESULT MS_access_cm_get_all_model_subscription_list
  1691. (
  1692. /* INOUT */ UINT16 * sub_addr_count,
  1693. /* OUT */ UINT16 * sub_addr_list
  1694. );
  1695. /**
  1696. * \brief To check if valid element address to receive a packet
  1697. *
  1698. * \par Description
  1699. * This routine checks if destination address in a received packet matches
  1700. * with any of the known element address of local or friend device.
  1701. *
  1702. * \param [in] addr Unicast Address to search
  1703. *
  1704. * \return API_SUCCESS or an error code indicating reason for failure
  1705. */
  1706. API_RESULT MS_access_is_valid_element_address
  1707. (
  1708. /* IN */ MS_NET_ADDR addr
  1709. );
  1710. /**
  1711. * \brief To check if Fixed Group Address in receive packet to be processed
  1712. *
  1713. * \par Description
  1714. * This routine checks if destination address in a received packet
  1715. * as a Fixed Group Address to be processed.
  1716. *
  1717. * \param [in] addr A valid Fixed Group Address, to be checked
  1718. *
  1719. * \return API_SUCCESS or an error code indicating reason for failure
  1720. */
  1721. API_RESULT MS_access_is_fixed_group_addr_to_be_processed
  1722. (
  1723. /* IN */ MS_NET_ADDR addr
  1724. );
  1725. /**
  1726. * \brief To check if valid subscription address to receive a packet
  1727. *
  1728. * \par Description
  1729. * This routine checks if destination address in a received packet matches
  1730. * with any of the known subscription address of local or friend device.
  1731. *
  1732. * \param [in] addr Address to search
  1733. *
  1734. * \return API_SUCCESS or an error code indicating reason for failure
  1735. */
  1736. API_RESULT MS_access_is_valid_subscription_address
  1737. (
  1738. /* IN */ MS_NET_ADDR addr
  1739. );
  1740. #ifdef MS_STORAGE
  1741. /**
  1742. * \brief Get Core Modules storage handle and offset from persistent storage.
  1743. *
  1744. * \par Description
  1745. * This function returns the storage handle and offset for Core Modules.
  1746. *
  1747. * \param [out] ps_handle Persistent Storage Handle.
  1748. * \param [out] offset The memory to be filled with the storage offset information.
  1749. */
  1750. API_RESULT MS_access_ps_get_handle_and_offset
  1751. (
  1752. /* OUT */ NVSTO_HANDLE * ps_handle,
  1753. /* OUT */ UINT32 * offset
  1754. );
  1755. #endif /* MS_STORAGE */
  1756. #ifdef __cplusplus
  1757. };
  1758. #endif
  1759. /** \} */
  1760. /** \} */
  1761. #endif /* _H_MS_ACCESS_API_ */