📄 zdapp.lst
字号:
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
214
215 #if defined( ZDO_COORDINATOR ) && !defined( SOFT_START )
216 // Set the default to coodinator
217 devStartModes_t devStartMode = MODE_HARD;
218 #else
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
219 devStartModes_t devStartMode = MODE_JOIN; // Assume joining
\ devStartMode:
\ 000000 DS 1
220 //devStartModes_t devStartMode = MODE_RESUME; // if already "directly joined"
221 // to parent. Set to make the device do an Orphan scan.
222 #endif
223
224 #if defined ( ZDO_IEEEADDR_REQUEST )
225 static byte ZDApp_IEEEAddrRsp_TaskID = 0; // Initialized to NO TASK
226 #endif
227
228 #if defined ( ZDO_NWKADDR_REQUEST )
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
229 static byte ZDApp_NwkAddrRsp_TaskID = 0; // Initialized to NO TASK
\ ??ZDApp_NwkAddrRsp_TaskID:
\ 000000 DS 1
230 #endif
231
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
232 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
233 static byte ZDApp_EndDeviceAnnounce_TaskID = 0; // Initialized to NO TASK
\ ??ZDApp_EndDeviceAnnounce_TaskID:
\ 000000 DS 1
234
235 #if defined ( ZDO_BIND_UNBIND_REQUEST )
236 static byte ZDApp_BindUnbindRsp_TaskID = TASK_NO_TASK;
237 #endif
238
239 #if defined ( ZDO_BIND_UNBIND_RESPONSE ) && !defined ( REFLECTOR )
240 static byte ZDApp_BindReq_TaskID = 0; // Initialized to NO TASK
241 #endif
242
243 #if defined ( ZDO_MGMT_BIND_RESPONSE ) && !defined ( REFLECTOR )
244 static byte ZDApp_MgmtBindReq_TaskID = 0; // Initialized to NO TASK
245 #endif
246
247 #if !defined( ZDO_COORDINATOR ) || defined( SOFT_START )
\ In segment XDATA_Z, align 1, keep-with-next
\ 000000 REQUIRE __INIT_XDATA_Z
248 static uint8 retryCnt;
\ ??retryCnt:
\ 000000 DS 1
249 #endif
250
251 // a little awkward -- this is will hold the list of versions that are legal given other
252 // constraints such as NV value, macro values etc. list used in ZDO_NetworkDiscoveryConfirmCB()
253 // when a joining device is deciding which network to join.
\ In segment XDATA_I, align 1, keep-with-next
254 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
255
\ In segment XDATA_I, align 1, keep-with-next
256 endPointDesc_t ZDApp_epDesc =
\ ZDApp_epDesc:
\ 000000 DS 6
\ 000006 REQUIRE `?<Initializer for ZDApp_epDesc>`
\ 000006 REQUIRE __INIT_XDATA_I
257 {
258 ZDO_EP,
259 &ZDAppTaskID,
260 (SimpleDescriptionFormat_t *)NULL, // No Simple description for ZDO
261 (afNetworkLatencyReq_t)0 // No Network Latency req
262 };
263
264 #if defined( HOLD_AUTO_START )
265 devStates_t devState = DEV_HOLD;
266 #else
\ In segment XDATA_I, align 1, keep-with-next
267 devStates_t devState = DEV_INIT;
\ devState:
\ 000000 DS 1
\ 000001 REQUIRE `?<Initializer for devState>`
\ 000001 REQUIRE __INIT_XDATA_I
268 #endif
269
270 extern uint8 SampleApp_TaskID;
271 /*********************************************************************
272 * @fn ZDApp_Init
273 *
274 * @brief ZDApp Initialization function.
275 *
276 * @param task_id - ZDApp Task ID
277 *
278 * @return None
279 */
\ In segment BANKED_CODE, align 1, keep-with-next
280 void ZDApp_Init( byte task_id )
\ ZDApp_Init:
281 {
\ 000000 C082 PUSH DPL
\ 000002 C083 PUSH DPH
\ 000004 ; Saved register size: 2
\ 000004 ; Auto size: 1
\ 000004 74FF MOV A,#-0x1
\ 000006 12.... LCALL ?ALLOC_XSTACK8
282 uint8 capabilities;
283
284 // Save the task ID
285 ZDAppTaskID = task_id;
\ 000009 E9 MOV A,R1
\ 00000A 90.... MOV DPTR,#ZDAppTaskID
\ 00000D F0 MOVX @DPTR,A
286
287 // Initialize the ZDO global device short address storage
288 ZDAppNwkAddr.addrMode = Addr16Bit;
\ 00000E 7402 MOV A,#0x2
\ 000010 90.... MOV DPTR,#(ZDAppNwkAddr + 8)
\ 000013 F0 MOVX @DPTR,A
289 ZDAppNwkAddr.addr.shortAddr = INVALID_NODE_ADDR;
\ 000014 90.... MOV DPTR,#ZDAppNwkAddr
\ 000017 74FE MOV A,#-0x2
\ 000019 F0 MOVX @DPTR,A
\ 00001A A3 INC DPTR
\ 00001B 74FF MOV A,#-0x1
\ 00001D F0 MOVX @DPTR,A
290 (void)NLME_GetExtAddr(); // Load the saveExtAddr pointer.
\ 00001E ; Setup parameters for call to function NLME_GetExtAddr
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -