ZDApp.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. /**************************************************************************************************
  2. Filename: ZDApp.h
  3. Revised: $Date: 2012-02-16 16:04:32 -0800 (Thu, 16 Feb 2012) $
  4. Revision: $Revision: 29348 $
  5. Description: This file contains the interface to the Zigbee Device Application. This is the
  6. Application part that the use can change. This also contains the Task functions.
  7. Copyright 2004-2012 Texas Instruments Incorporated. All rights reserved.
  8. IMPORTANT: Your use of this Software is limited to those specific rights
  9. granted under the terms of a software license agreement between the user
  10. who downloaded the software, his/her employer (which must be your employer)
  11. and Texas Instruments Incorporated (the "License"). You may not use this
  12. Software unless you agree to abide by the terms of the License. The License
  13. limits your use, and you acknowledge, that the Software may not be modified,
  14. copied or distributed unless embedded on a Texas Instruments microcontroller
  15. or used solely and exclusively in conjunction with a Texas Instruments radio
  16. frequency transceiver, which is integrated into your product. Other than for
  17. the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  18. works of, modify, distribute, perform, display or sell this Software and/or
  19. its documentation for any purpose.
  20. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  21. PROVIDED “AS IS?WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  22. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  23. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  24. TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  25. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  26. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  27. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  28. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  29. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  30. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  31. Should you have any questions regarding your right to use this Software,
  32. contact Texas Instruments Incorporated at www.TI.com.
  33. **************************************************************************************************/
  34. #ifndef ZDAPP_H
  35. #define ZDAPP_H
  36. #ifdef __cplusplus
  37. extern "C"
  38. {
  39. #endif
  40. /*********************************************************************
  41. * INCLUDES
  42. */
  43. #include "ZComDef.h"
  44. #include "ZMac.h"
  45. #include "NLMEDE.h"
  46. #include "APS.h"
  47. #include "AF.h"
  48. #include "ZDProfile.h"
  49. /*********************************************************************
  50. * MACROS
  51. */
  52. /*********************************************************************
  53. * CONSTANTS
  54. */
  55. // Set this value for use in choosing a PAN to join
  56. // modify ZDApp.c to enable this...
  57. #define ZDO_CONFIG_MAX_BO 15
  58. // Task Events
  59. #define ZDO_NETWORK_INIT 0x0001
  60. #define ZDO_NETWORK_START 0x0002
  61. #define ZDO_DEVICE_RESET 0x0004
  62. #define ZDO_COMMAND_CNF 0x0008
  63. #define ZDO_STATE_CHANGE_EVT 0x0010
  64. #define ZDO_ROUTER_START 0x0020
  65. #define ZDO_NEW_DEVICE 0x0040
  66. #define ZDO_DEVICE_AUTH 0x0080
  67. #define ZDO_SECMGR_EVENT 0x0100
  68. #define ZDO_NWK_UPDATE_NV 0x0200
  69. #define ZDO_FRAMECOUNTER_CHANGE 0x0400
  70. #define ZDO_TCLK_FRAMECOUNTER_CHANGE 0x0800
  71. #define ZDO_APS_FRAMECOUNTER_CHANGE 0x1000
  72. // Incoming to ZDO
  73. #define ZDO_NWK_DISC_CNF 0x01
  74. #define ZDO_NWK_JOIN_IND 0x02
  75. #define ZDO_NWK_JOIN_REQ 0x03
  76. #define ZDO_ESTABLISH_KEY_CFM 0x04
  77. #define ZDO_ESTABLISH_KEY_IND 0x05
  78. #define ZDO_TRANSPORT_KEY_IND 0x06
  79. #define ZDO_UPDATE_DEVICE_IND 0x07
  80. #define ZDO_REMOVE_DEVICE_IND 0x08
  81. #define ZDO_REQUEST_KEY_IND 0x09
  82. #define ZDO_SWITCH_KEY_IND 0x0A
  83. #define ZDO_AUTHENTICATE_IND 0x0B
  84. #define ZDO_AUTHENTICATE_CFM 0x0C
  85. // ZDO command message fields
  86. #define ZDO_CMD_ID 0
  87. #define ZDO_CMD_ID_LEN 1
  88. // ZDO security message fields
  89. #define ZDO_ESTABLISH_KEY_CFM_LEN \
  90. ((uint8) \
  91. (sizeof(ZDO_EstablishKeyCfm_t) ) )
  92. #define ZDO_ESTABLISH_KEY_IND_LEN \
  93. ((uint8) \
  94. (sizeof(ZDO_EstablishKeyInd_t) ) )
  95. #define ZDO_TRANSPORT_KEY_IND_LEN \
  96. ((uint8) \
  97. (sizeof(ZDO_TransportKeyInd_t) ) )
  98. #define ZDO_UPDATE_DEVICE_IND_LEN \
  99. ((uint8) \
  100. (sizeof(ZDO_UpdateDeviceInd_t) ) )
  101. #define ZDO_REMOVE_DEVICE_IND_LEN \
  102. ((uint8) \
  103. (sizeof(ZDO_RemoveDeviceInd_t) ) )
  104. #define ZDO_REQUEST_KEY_IND_LEN \
  105. ((uint8) \
  106. (sizeof(ZDO_RequestKeyInd_t) ) )
  107. #define ZDO_SWITCH_KEY_IND_LEN \
  108. ((uint8) \
  109. (sizeof(ZDO_SwitchKeyInd_t) ) )
  110. #define ZDO_AUTHENTICATE_IND_LEN \
  111. ((uint8) \
  112. (sizeof(ZDO_AuthenticateInd_t) ) )
  113. #define ZDO_AUTHENTICATE_CFM_LEN \
  114. ((uint8) \
  115. (sizeof(ZDO_AuthenticateCfm_t) ) )
  116. #define NWK_RETRY_DELAY 1000 // in milliseconds
  117. #define ZDO_MATCH_DESC_ACCEPT_ACTION 1 // Message field
  118. #if !defined NUM_DISC_ATTEMPTS
  119. #define NUM_DISC_ATTEMPTS 2
  120. #endif
  121. // ZDOInitDevice return values
  122. #define ZDO_INITDEV_RESTORED_NETWORK_STATE 0x00
  123. #define ZDO_INITDEV_NEW_NETWORK_STATE 0x01
  124. #define ZDO_INITDEV_LEAVE_NOT_STARTED 0x02
  125. #if defined ( MANAGED_SCAN )
  126. // Only use in a battery powered device
  127. // This is the number of times a channel is scanned at the shortest possible
  128. // scan time (which is 30 MS (2 x 15). The idea is to scan one channel at a
  129. // time (from the channel list), but scan it multiple times.
  130. #define MANAGEDSCAN_TIMES_PRE_CHANNEL 5
  131. #define MANAGEDSCAN_DELAY_BETWEEN_SCANS 150 // milliseconds
  132. extern uint8 zdoDiscCounter;
  133. #endif // MANAGED_SCAN
  134. // Use the following to delay application data request after startup.
  135. #define ZDAPP_HOLD_DATA_REQUESTS_TIMEOUT 0 // in milliseconds
  136. /*********************************************************************
  137. * TYPEDEFS
  138. */
  139. typedef enum
  140. {
  141. DEV_HOLD, // Initialized - not started automatically
  142. DEV_INIT, // Initialized - not connected to anything
  143. DEV_NWK_DISC, // Discovering PAN's to join
  144. DEV_NWK_JOINING, // Joining a PAN
  145. DEV_NWK_REJOIN, // ReJoining a PAN, only for end devices
  146. DEV_END_DEVICE_UNAUTH, // Joined but not yet authenticated by trust center
  147. DEV_END_DEVICE, // Started as device after authentication
  148. DEV_ROUTER, // Device joined, authenticated and is a router
  149. DEV_COORD_STARTING, // Started as Zigbee Coordinator
  150. DEV_ZB_COORD, // Started as Zigbee Coordinator
  151. DEV_NWK_ORPHAN // Device has lost information about its parent..
  152. } devStates_t;
  153. typedef enum
  154. {
  155. ZDO_SUCCESS,
  156. ZDO_FAIL
  157. } zdoStatus_t;
  158. typedef struct
  159. {
  160. osal_event_hdr_t hdr;
  161. uint8 dstAddrDstEP;
  162. zAddrType_t dstAddr;
  163. uint8 dstAddrClusterIDLSB;
  164. uint8 dstAddrClusterIDMSB;
  165. uint8 dstAddrRemove;
  166. uint8 dstAddrEP;
  167. } ZDO_NewDstAddr_t;
  168. // ZDO security message types
  169. typedef struct
  170. {
  171. osal_event_hdr_t hdr;
  172. uint8 partExtAddr[Z_EXTADDR_LEN];
  173. uint8 status;
  174. } ZDO_EstablishKeyCfm_t;
  175. typedef struct
  176. {
  177. osal_event_hdr_t hdr;
  178. uint16 srcAddr;
  179. uint8 initExtAddr[Z_EXTADDR_LEN];
  180. uint8 method;
  181. uint8 apsSecure;
  182. uint8 nwkSecure;
  183. //devtag.0604.todo - remove obsolete
  184. } ZDO_EstablishKeyInd_t;
  185. typedef struct
  186. {
  187. osal_event_hdr_t hdr;
  188. uint16 srcAddr;
  189. uint8 keyType;
  190. uint8 keySeqNum;
  191. uint8 key[SEC_KEY_LEN];
  192. uint8 srcExtAddr[Z_EXTADDR_LEN];
  193. uint8 initiator;
  194. uint8 secure;
  195. } ZDO_TransportKeyInd_t;
  196. typedef struct
  197. {
  198. osal_event_hdr_t hdr;
  199. uint16 srcAddr;
  200. uint8 devExtAddr[Z_EXTADDR_LEN];
  201. uint16 devAddr;
  202. uint8 status;
  203. } ZDO_UpdateDeviceInd_t;
  204. typedef struct
  205. {
  206. osal_event_hdr_t hdr;
  207. uint16 srcAddr;
  208. uint8 childExtAddr[Z_EXTADDR_LEN];
  209. } ZDO_RemoveDeviceInd_t;
  210. typedef struct
  211. {
  212. osal_event_hdr_t hdr;
  213. uint16 srcAddr;
  214. uint8 keyType;
  215. uint8 partExtAddr[Z_EXTADDR_LEN];
  216. } ZDO_RequestKeyInd_t;
  217. typedef struct
  218. {
  219. osal_event_hdr_t hdr;
  220. uint16 srcAddr;
  221. uint8 keySeqNum;
  222. } ZDO_SwitchKeyInd_t;
  223. typedef struct
  224. {
  225. osal_event_hdr_t hdr;
  226. APSME_AuthenticateInd_t aps;
  227. } ZDO_AuthenticateInd_t;
  228. typedef struct
  229. {
  230. osal_event_hdr_t hdr;
  231. APSME_AuthenticateCfm_t aps;
  232. } ZDO_AuthenticateCfm_t;
  233. typedef struct
  234. {
  235. osal_event_hdr_t hdr;
  236. uint16 nwkAddr;
  237. uint8 numInClusters;
  238. uint16 *pInClusters;
  239. uint8 numOutClusters;
  240. uint16 *pOutClusters;
  241. } ZDO_MatchDescRspSent_t;
  242. typedef struct
  243. {
  244. osal_event_hdr_t hdr;
  245. uint16 shortAddr;
  246. } ZDO_AddrChangeInd_t;
  247. /* ZDO Indication Callback Registration */
  248. typedef void* (*pfnZdoCb)( void *param );
  249. /* ZDO Indication callback ID */
  250. enum
  251. {
  252. ZDO_SRC_RTG_IND_CBID,
  253. ZDO_CONCENTRATOR_IND_CBID,
  254. ZDO_NWK_DISCOVERY_CNF_CBID,
  255. ZDO_BEACON_NOTIFY_IND_CBID,
  256. ZDO_JOIN_CNF_CBID,
  257. ZDO_LEAVE_CNF_CBID,
  258. ZDO_LEAVE_IND_CBID,
  259. MAX_ZDO_CB_FUNC // Must be at the bottom of the list
  260. };
  261. typedef struct
  262. {
  263. uint16 srcAddr;
  264. uint8 relayCnt;
  265. uint16 *pRelayList;
  266. } zdoSrcRtg_t;
  267. typedef struct
  268. {
  269. uint16 nwkAddr;
  270. uint8 *extAddr;
  271. uint8 pktCost;
  272. } zdoConcentratorInd_t;
  273. /* Keep the same format as NLME_beaconInd_t */
  274. typedef struct
  275. {
  276. uint16 sourceAddr; /* Short address of the device sends the beacon */
  277. uint16 panID;
  278. uint8 logicalChannel;
  279. uint8 permitJoining;
  280. uint8 routerCapacity;
  281. uint8 deviceCapacity;
  282. uint8 protocolVersion;
  283. uint8 stackProfile ;
  284. uint8 LQI ;
  285. uint8 depth ;
  286. uint8 updateID;
  287. uint8 extendedPanID[8];
  288. } zdoBeaconInd_t;
  289. typedef struct
  290. {
  291. uint8 status;
  292. uint16 deviceAddr;
  293. uint16 parentAddr;
  294. } zdoJoinCnf_t;
  295. /*********************************************************************
  296. * GLOBAL VARIABLES
  297. */
  298. extern uint8 ZDAppTaskID;
  299. extern uint8 nwkStatus;
  300. extern devStates_t devState;
  301. /* Always kept up to date by the network state changed logic, so use this addr
  302. * in function calls the require my network address as one of the parameters.
  303. */
  304. extern zAddrType_t ZDAppNwkAddr;
  305. extern uint8 saveExtAddr[]; // Loaded with value by ZDApp_Init().
  306. extern uint8 zdappMgmtNwkDiscRspTransSeq;
  307. extern uint8 zdappMgmtNwkDiscReqInProgress;
  308. extern zAddrType_t zdappMgmtNwkDiscRspAddr;
  309. extern uint8 zdappMgmtNwkDiscStartIndex;
  310. extern uint8 zdappMgmtSavedNwkState;
  311. extern uint8 ZDO_UseExtendedPANID[Z_EXTADDR_LEN];
  312. /*********************************************************************
  313. * FUNCTIONS - API
  314. */
  315. extern void ZDO_AddrChangeIndicationCB( uint16 newAddr );
  316. /*********************************************************************
  317. * Task Level Control
  318. */
  319. /*
  320. * ZdApp Task Initialization Function
  321. */
  322. extern void ZDApp_Init( uint8 task_id );
  323. /*
  324. * ZdApp Task Event Processing Function
  325. */
  326. extern UINT16 ZDApp_event_loop( uint8 task_id, UINT16 events );
  327. /*********************************************************************
  328. * Application Level Functions
  329. */
  330. /*
  331. * Start the device in the network. This function will read
  332. * ZCD_NV_STARTUP_OPTION (NV item) to determine whether or not to
  333. * restore the network state of the device.
  334. *
  335. * startDelay - timeDelay to start device (in milliseconds).
  336. * There is a jitter added to this delay:
  337. * ((NWK_START_DELAY + startDelay)
  338. * + (osal_rand() & EXTENDED_JOINING_RANDOM_MASK))
  339. *
  340. * NOTE: If the application would like to force a "new" join, the
  341. * application should set the ZCD_STARTOPT_DEFAULT_NETWORK_STATE
  342. * bit in the ZCD_NV_STARTUP_OPTION NV item before calling
  343. * this function.
  344. *
  345. * returns:
  346. * ZDO_INITDEV_RESTORED_NETWORK_STATE - The device's network state was
  347. * restored.
  348. * ZDO_INITDEV_NEW_NETWORK_STATE - The network state was initialized.
  349. * This could mean that ZCD_NV_STARTUP_OPTION said to not restore, or
  350. * it could mean that there was no network state to restore.
  351. * ZDO_INITDEV_LEAVE_NOT_STARTED - Before the reset, a network leave was issued
  352. * with the rejoin option set to TRUE. So, the device was not
  353. * started in the network (one time only). The next time this
  354. * function is called it will start.
  355. */
  356. extern uint8 ZDOInitDevice( uint16 startDelay );
  357. /*
  358. * Sends an osal message to ZDApp with parameter as the msg data byte.
  359. */
  360. extern void ZDApp_SendEventMsg( uint8 cmd, uint8 len, uint8 *buf );
  361. /*
  362. * ZdApp Function for Establishing a Link Key
  363. */
  364. extern ZStatus_t ZDApp_EstablishKey( uint8 endPoint,
  365. uint16 nwkAddr,
  366. uint8* extAddr );
  367. /*
  368. * Start the network formation process
  369. * delay - millisecond wait before
  370. */
  371. extern void ZDApp_NetworkInit( uint16 delay );
  372. /*
  373. * Request a network discovery
  374. */
  375. extern ZStatus_t ZDApp_NetworkDiscoveryReq( uint32 scanChannels, uint8 scanDuration);
  376. /*
  377. * Request the device to join a parent on a network
  378. */
  379. extern ZStatus_t ZDApp_JoinReq( uint8 channel, uint16 panID,
  380. uint8 *extendedPanID, uint16 chosenParent,
  381. uint8 parentDepth, uint8 stackProfile);
  382. /*********************************************************************
  383. * Callback FUNCTIONS - API
  384. */
  385. /*********************************************************************
  386. * Call Back Functions from NWK - API
  387. */
  388. /*
  389. * ZDO_NetworkDiscoveryConfirmCB - scan results
  390. */
  391. extern ZStatus_t ZDO_NetworkDiscoveryConfirmCB( uint8 status );
  392. /*
  393. * ZDO_NetworkFormationConfirm - results of the request to
  394. * initialize a coordinator in a network
  395. */
  396. extern void ZDO_NetworkFormationConfirmCB( ZStatus_t Status );
  397. /*
  398. * ZDApp_beaconIndProcessing - processes the incoming beacon
  399. * indication.
  400. */
  401. extern void ZDO_beaconNotifyIndCB( NLME_beaconInd_t *beacon );
  402. /*
  403. * ZDO_JoinConfirmCB - results of its request to join itself or another
  404. * device to a network
  405. */
  406. extern void ZDO_JoinConfirmCB( uint16 PanId, ZStatus_t Status );
  407. /*
  408. * ZDO_JoinIndicationCB - notified of a remote join request
  409. */
  410. ZStatus_t ZDO_JoinIndicationCB(uint16 ShortAddress, uint8 *ExtendedAddress,
  411. uint8 CapabilityFlags, uint8 type);
  412. /*
  413. * ZDO_ConcentratorIndicationCB - notified of a concentrator existence
  414. */
  415. extern void ZDO_ConcentratorIndicationCB( uint16 nwkAddr, uint8 *extAddr, uint8 pktCost );
  416. /*
  417. * ZDO_StartRouterConfirm - results of the request to
  418. * start functioning as a router in a network
  419. */
  420. extern void ZDO_StartRouterConfirmCB( ZStatus_t Status );
  421. /*
  422. * ZDO_LeaveCnf - results of the request for this or a child device
  423. * to leave
  424. */
  425. extern void ZDO_LeaveCnf( NLME_LeaveCnf_t* cnf );
  426. /*
  427. * ZDO_LeaveInd - notified of a remote leave request or indication
  428. */
  429. extern void ZDO_LeaveInd( NLME_LeaveInd_t* ind );
  430. /*
  431. * ZDO_SyncIndicationCB - notified of sync loss with parent
  432. */
  433. extern void ZDO_SyncIndicationCB( uint8 type, uint16 shortAddr );
  434. /*
  435. * ZDO_ManytoOneFailureIndicationCB - notified a many-to-one route failure
  436. */
  437. extern void ZDO_ManytoOneFailureIndicationCB( void );
  438. /*
  439. * ZDO_PollConfirmCB - notified of poll confirm
  440. */
  441. extern void ZDO_PollConfirmCB( uint8 status );
  442. /*********************************************************************
  443. * Call Back Functions from Security - API
  444. */
  445. extern ZStatus_t ZDO_UpdateDeviceIndication( uint8 *extAddr, uint8 status );
  446. /*
  447. * ZDApp_InMsgCB - Allow the ZDApp to handle messages that are not supported
  448. */
  449. extern void ZDApp_InMsgCB( zdoIncomingMsg_t *inMsg );
  450. extern void ZDO_StartRouterConfirm( ZStatus_t Status );
  451. /*********************************************************************
  452. * Call Back Functions from Apllication - API
  453. */
  454. /*
  455. * ZDO_NwkUpdateCB - Network state info has changed
  456. */
  457. extern void ZDApp_NwkStateUpdateCB( void );
  458. /*********************************************************************
  459. * ZDO Control Functions
  460. */
  461. /*
  462. * ZDApp_ChangeMatchDescRespPermission
  463. * - Change the Match Descriptor Response permission.
  464. */
  465. extern void ZDApp_ChangeMatchDescRespPermission( uint8 endpoint, uint8 action );
  466. /*
  467. * ZDApp_SaveNwkKey
  468. * - Save off the Network key information.
  469. */
  470. extern void ZDApp_SaveNwkKey( void );
  471. /*
  472. * ZDApp_ResetNwkKey
  473. * - Re initialize the NV Nwk Key
  474. */
  475. extern void ZDApp_ResetNwkKey( void );
  476. /*
  477. * ZDApp_StartJoiningCycle
  478. * - Starts the joining cycle of a device. This will only continue an
  479. * already started (or stopped) joining cycle.
  480. *
  481. * returns TRUE if joining started, FALSE if not in joining or rejoining
  482. */
  483. extern uint8 ZDApp_StartJoiningCycle( void );
  484. /*
  485. * ZDApp_StopJoiningCycle
  486. * - Stops the joining or rejoining process of a device.
  487. *
  488. * returns TRUE if joining stopped, FALSE if joining or rejoining
  489. */
  490. extern uint8 ZDApp_StopJoiningCycle( void );
  491. /*
  492. * ZDApp_AnnounceNewAddress
  493. * - Announce a new address
  494. */
  495. extern void ZDApp_AnnounceNewAddress( void );
  496. /*
  497. * ZDApp_NVUpdate - Initiate an NV update
  498. */
  499. extern void ZDApp_NVUpdate( void );
  500. /*
  501. * Callback from network layer when coordinator start has a conflict with
  502. * an existing PAN ID.
  503. */
  504. extern uint16 ZDApp_CoordStartPANIDConflictCB( uint16 panid );
  505. /*
  506. * ZDApp_LeaveReset
  507. * - Setup a device reset due to a leave indication/confirm
  508. */
  509. extern void ZDApp_LeaveReset( uint8 ra );
  510. /*
  511. * ZDApp_LeaveCtrlReset
  512. * - Re-initialize the leave control logic
  513. */
  514. extern void ZDApp_LeaveCtrlReset( void );
  515. /*
  516. * ZDApp_DeviceConfigured
  517. * - Check to see if the local device is configured
  518. */
  519. extern uint8 ZDApp_DeviceConfigured( void );
  520. /*********************************************************************
  521. * @fn ZDO_SrcRtgIndCB
  522. *
  523. * @brief This function notifies the ZDO available src route record received.
  524. *
  525. * @param srcAddr - source address of the source route
  526. * @param relayCnt - number of devices in the relay list
  527. * @param relayList - relay list of the source route
  528. *
  529. * @return none
  530. */
  531. extern void ZDO_SrcRtgIndCB (uint16 srcAddr, uint8 relayCnt, uint16* pRelayList );
  532. /*********************************************************************
  533. * @fn ZDO_RegisterForZdoCB
  534. *
  535. * @brief Call this function to register the higher layer (for
  536. * example, the Application layer or MT layer) with ZDO
  537. * callbacks to get notified of some ZDO indication like
  538. * existence of a concentrator or receipt of a source
  539. * route record.
  540. *
  541. * @param indID - ZDO Indication ID
  542. * @param pFn - Callback function pointer
  543. *
  544. * @return ZSuccess - successful, ZInvalidParameter if not
  545. */
  546. extern ZStatus_t ZDO_RegisterForZdoCB( uint8 indID, pfnZdoCb pFn );
  547. /*********************************************************************
  548. * @fn ZDO_DeregisterForZdoCB
  549. *
  550. * @brief Call this function to de-register the higher layer (for
  551. * example, the Application layer or MT layer) with ZDO
  552. * callbacks to get notified of some ZDO indication like
  553. * existence of a concentrator or receipt of a source
  554. * route record.
  555. *
  556. * @param indID - ZDO Indication ID
  557. *
  558. * @return ZSuccess - successful, ZInvalidParameter if not
  559. */
  560. extern ZStatus_t ZDO_DeregisterForZdoCB( uint8 indID );
  561. /*********************************************************************
  562. *********************************************************************/
  563. #ifdef __cplusplus
  564. }
  565. #endif
  566. #endif /* ZDOBJECT_H */