📄 zdapp.lst
字号:
113 // Address Manager Stub Implementation
114 #define ZDApp_NwkWriteNVRequest AddrMgrWriteNVRequest
115
116 /*********************************************************************
117 * TYPEDEFS
118 */
119
120 /*********************************************************************
121 * GLOBAL VARIABLES
122 */
123
124 #if defined( LCD_SUPPORTED )
125 byte MatchRsps = 0;
126 #endif
127
\ In segment XDATA_I, align 1, keep-with-next
128 byte zdoDiscCounter = 1;
\ zdoDiscCounter:
\ 000000 DS 1
\ 000001 REQUIRE `?<Initializer for zdoDiscCounter>`
\ 000001 REQUIRE __INIT_XDATA_I
129
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
130 zAddrType_t ZDAppNwkAddr;
\ ZDAppNwkAddr:
\ 000000 DS 9
131
132 #if defined ( ZDO_MGMT_NWKDISC_RESPONSE )
133 byte zdappMgmtNwkDiscRspTransSeq;
134 byte zdappMgmtNwkDiscReqInProgress = FALSE;
135 zAddrType_t zdappMgmtNwkDiscRspAddr;
136 byte zdappMgmtNwkDiscStartIndex;
137 byte zdappMgmtSavedNwkState;
138 #endif
139
140 #if ( SECURE != 0 )
141 uint16 nwkFrameCounterChanges = 0;
142 #endif
143
144 #if defined ( SOFT_START )
145 static uint8 softStartAllowCoord = TRUE;
146 #endif
147
\ In segment XDATA_I, align 1, keep-with-next
148 uint8 continueJoining = TRUE;
\ continueJoining:
\ 000000 DS 1
\ 000001 REQUIRE `?<Initializer for continueJoining>`
\ 000001 REQUIRE __INIT_XDATA_I
149
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
150 byte _tmpRejoinState;
\ _tmpRejoinState:
\ 000000 DS 1
151
152 /*********************************************************************
153 * EXTERNAL VARIABLES
154 */
155
156 /*********************************************************************
157 * EXTERNAL FUNCTIONS
158 */
159
160 /*********************************************************************
161 * LOCAL FUNCTIONS
162 */
163
164 void ZDApp_NetworkStartEvt( void );
165 void ZDApp_DeviceAuthEvt( void );
166 void ZDApp_SaveNetworkStateEvt( void );
167
168 uint8 ZDApp_ReadNetworkRestoreState( void );
169 uint8 ZDApp_RestoreNetworkState( void );
170 void ZDAppDetermineDeviceType( void );
171 void ZDAppSetupProtoVersion( void );
172 void ZDApp_InitUserDesc( void );
173 void ZDAppCheckForHoldKey( void );
174 void ZDApp_ProcessOSALMsg( osal_event_hdr_t *msgPtr );
175 void ZDApp_ProcessNetworkJoin( void );
176 void ZDApp_SetCoordAddress( byte endPoint, byte dstEP );
177 void ZDApp_SendNewDstAddr( byte dstEP, zAddrType_t *dstAddr,
178 cId_t clusterID, byte removeFlag, byte task_id, byte endpoint );
179
180 #if ( SECURE != 0 )
181 void ZDApp_SaveNwkKey( void );
182 byte ZDApp_RestoreNwkKey( void );
183 #endif
184
185 void ZDApp_SendMsg( byte taskID, byte cmd, byte len, byte *buf );
186
187 #if defined ( ZDO_BIND_UNBIND_RESPONSE ) && !defined ( REFLECTOR )
188 extern void ZDApp_AppBindReq( byte TransSeq, zAddrType_t *SrcAddr, byte *SrcAddress,
189 byte SrcEndPoint, cId_t ClusterID, byte *DstAddress,
190 byte DstEndPoint, byte SecurityUse, uint8 Type );
191 #endif
192
193 void ZDApp_ResetTimerStart( uint16 delay );
194 void ZDApp_ResetTimerCancel( void );
195 void ZDApp_LeaveCtrlInit( void );
196 void ZDApp_LeaveCtrlSet( uint8 ra );
197 uint8 ZDApp_LeaveCtrlBypass( void );
198 void ZDApp_LeaveCtrlStartup( devStates_t* state, uint16* startDelay );
199 void ZDApp_LeaveReset( uint8 ra );
200 void ZDApp_LeaveUpdate( uint16 nwkAddr, uint8* extAddr,
201 uint8 removeChildren );
202 void ZDApp_NodeProfileSync( ZDO_NetworkDiscoveryCfm_t* cfm );
203
204 /*********************************************************************
205 * LOCAL VARIABLES
206 */
207
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
208 byte ZDAppTaskID;
\ ZDAppTaskID:
\ 000000 DS 1
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
209 byte nwkStatus;
\ nwkStatus:
\ 000000 DS 1
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
210 endPointDesc_t *ZDApp_AutoFindMode_epDesc = (endPointDesc_t *)NULL;
\ ZDApp_AutoFindMode_epDesc:
\ 000000 DS 2
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
211 uint8 ZDApp_LeaveCtrl;
\ ZDApp_LeaveCtrl:
\ 000000 DS 1
212
213 #if defined( HOLD_AUTO_START )
214 devStates_t devState = DEV_HOLD;
215 #else
\ In segment XDATA_I, align 1, keep-with-next
216 devStates_t devState = DEV_INIT;
\ devState:
\ 000000 DS 1
\ 000001 REQUIRE `?<Initializer for devState>`
\ 000001 REQUIRE __INIT_XDATA_I
217 #endif
218
219 #if defined( ZDO_COORDINATOR ) && !defined( SOFT_START )
220 // Set the default to coodinator
\ In segment XDATA_I, align 1, keep-with-next
221 devStartModes_t devStartMode = MODE_HARD;
\ devStartMode:
\ 000000 DS 1
\ 000001 REQUIRE `?<Initializer for devStartMode>`
\ 000001 REQUIRE __INIT_XDATA_I
222 #else
223 devStartModes_t devStartMode = MODE_JOIN; // Assume joining
224 //devStartModes_t devStartMode = MODE_RESUME; // if already "directly joined"
225 // to parent. Set to make the device do an Orphan scan.
226 #endif
227
228 #if defined ( ZDO_IEEEADDR_REQUEST )
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
229 static byte ZDApp_IEEEAddrRsp_TaskID = 0; // Initialized to NO TASK
\ ??ZDApp_IEEEAddrRsp_TaskID:
\ 000000 DS 1
230 #endif
231
232 #if defined ( ZDO_NWKADDR_REQUEST )
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
233 static byte ZDApp_NwkAddrRsp_TaskID = 0; // Initialized to NO TASK
\ ??ZDApp_NwkAddrRsp_TaskID:
\ 000000 DS 1
234 #endif
235
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
236 static byte ZDApp_MatchDescRsp_TaskID = 0; // Initialized to NO TASK
\ ??ZDApp_MatchDescRsp_TaskID:
\ 000000 DS 1
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
237 static byte ZDApp_EndDeviceAnnounce_TaskID = 0; // Initialized to NO TASK
\ ??ZDApp_EndDeviceAnnounce_TaskID:
\ 000000 DS 1
238
239 #if defined ( ZDO_BIND_UNBIND_REQUEST )
240 static byte ZDApp_BindUnbindRsp_TaskID = TASK_NO_TASK;
241 #endif
242
243 #if defined ( ZDO_BIND_UNBIND_RESPONSE ) && !defined ( REFLECTOR )
244 static byte ZDApp_BindReq_TaskID = 0; // Initialized to NO TASK
245 #endif
246
247 #if defined ( ZDO_MGMT_BIND_RESPONSE ) && !defined ( REFLECTOR )
248 static byte ZDApp_MgmtBindReq_TaskID = 0; // Initialized to NO TASK
249 #endif
250
251 #if !defined( ZDO_COORDINATOR ) || defined( SOFT_START )
252 static uint8 retryCnt;
253 #endif
254
255 // a little awkward -- this is will hold the list of versions that are legal given other
256 // constraints such as NV value, macro values etc. list used in ZDO_NetworkDiscoveryConfirmCB()
257 // when a joining device is deciding which network to join.
\ In segment XDATA_I, align 1, keep-with-next
258 static byte sPVerList[] = {ZB_PROT_V1_1, ZB_PROT_V1_0};
\ ??sPVerList:
\ 000000 DS 2
\ 000002 REQUIRE `?<Initializer for sPVerList>`
\ 000002 REQUIRE __INIT_XDATA_I
259
\ In segment XDATA_I, align 1, keep-with-next
260 endPointDesc_t ZDApp_epDesc =
\ ZDApp_epDesc:
\ 000000 DS 6
\ 000006 REQUIRE `?<Initializer for ZDApp_epDesc>`
\ 000006 REQUIRE __INIT_XDATA_I
261 {
262 ZDO_EP,
263 &ZDAppTaskID,
264 (SimpleDescriptionFormat_t *)NULL, // No Simple description for ZDO
265 (afNetworkLatencyReq_t)0 // No Network Latency req
266 };
267
268 /*********************************************************************
269 * @fn ZDApp_Init
270 *
271 * @brief ZDApp Initialization function.
272 *
273 * @param task_id - ZDApp Task ID
274 *
275 * @return None
276 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -