📄 zdprofile.lst
字号:
\ 000003 7F08 MOV R7,#0x8
\ 000005 02.... LJMP ?BANKED_LEAVE_XDATA
\ In segment BANKED_CODE, align 1, keep-with-next
\ ?Subroutine25:
\ 000000 12.... LCALL ?Subroutine40 & 0xFFFF
\ ??CrossCallReturnLabel_90:
\ 000003 22 RET
\ In segment BANKED_CODE, align 1, keep-with-next
\ ?Subroutine40:
\ 000000 12.... LCALL ??Subroutine41_0 & 0xFFFF
\ ??CrossCallReturnLabel_93:
\ 000003 22 RET
\ In segment BANKED_CODE, align 1, keep-with-next
\ ?Subroutine16:
\ 000000 90.... MOV DPTR,#??ZDP_TmpBuf
\ 000003 12.... LCALL ?Subroutine33 & 0xFFFF
\ ??CrossCallReturnLabel_76:
\ 000006 ; Setup parameters for call to function NLME_GetProtocolVersion
\ 000006 ; Setup parameters for call to function NLME_GetProtocolVersion
\ 000006 02.... LJMP ?Subroutine49 & 0xFFFF
\ In segment BANKED_CODE, align 1, keep-with-next
\ ?Subroutine15:
\ 000000 E0 MOVX A,@DPTR
\ 000001 FC MOV R4,A
\ 000002 A3 INC DPTR
\ 000003 E0 MOVX A,@DPTR
\ 000004 FD MOV R5,A
\ 000005 7A.. MOV R2,#(ZDP_TransID & 0xff)
\ 000007 7B.. MOV R3,#((ZDP_TransID >> 8) & 0xff)
\ 000009 90.... MOV DPTR,#(??fillAndSend & 0xffff)
\ 00000C 74.. MOV A,#((??fillAndSend >> 16) & 0xff)
\ 00000E 22 RET
\ In segment BANKED_CODE, align 1, keep-with-next
\ ?Subroutine32:
\ 000000 F583 MOV DPH,A
\ 000002 A3 INC DPTR
\ 000003 12.... LCALL ?Subroutine41 & 0xFFFF
\ ??CrossCallReturnLabel_92:
\ 000006 22 RET
\ In segment BANKED_CODE, align 1, keep-with-next
\ ?Subroutine41:
\ 000000 E0 MOVX A,@DPTR
\ 000001 85..82 MOV DPL,?V0 + 2
\ 000004 85..83 MOV DPH,?V0 + 3
\ ??Subroutine41_0:
\ 000007 F0 MOVX @DPTR,A
\ 000008 A3 INC DPTR
\ 000009 8582.. MOV ?V0 + 2,DPL
\ 00000C 8583.. MOV ?V0 + 3,DPH
\ 00000F 22 RET
\ In segment BANKED_CODE, align 1, keep-with-next
\ ?Subroutine30:
\ 000000 F583 MOV DPH,A
\ 000002 12.... LCALL ?Subroutine41 & 0xFFFF
\ ??CrossCallReturnLabel_91:
\ 000005 7401 MOV A,#0x1
\ 000007 22 RET
346 #endif // ZDO_MATCH_REQUEST
347
348 #if defined ( ZDO_SIMPLEDESC_REQUEST )
349 /*********************************************************************
350 * @fn ZDP_SimpleDescReq
351 *
352 * @brief This builds and send a NWK_Simple_Desc_req
353 * message. This function sends unicast message to the
354 * destination device.
355 *
356 * @param dstAddr - destination address
357 * @param nwkAddr - 16 bit address
358 * @param epIntf - endpoint/interface
359 * @param SecurityEnable - Security Options
360 *
361 * @return afStatus_t
362 */
363 afStatus_t ZDP_SimpleDescReq( zAddrType_t *dstAddr, uint16 nwkAddr,
364 byte endPoint, byte SecurityEnable )
365
366 {
367 ZDP_TmpBuf[0] = LO_UINT16( nwkAddr );
368 ZDP_TmpBuf[1] = HI_UINT16( nwkAddr );
369 ZDP_TmpBuf[2] = endPoint;
370
371 return fillAndSend( &ZDP_TransID, dstAddr, Simple_Desc_req, 3 );
372 }
373 #endif // ZDO_SIMPLEDESC_REQUEST
374
375 #if defined ( ZDO_USERDESCSET_REQUEST )
376 /*********************************************************************
377 * @fn ZDP_UserDescSet
378 *
379 * @brief This builds and send a User_Desc_set message to set
380 * the user descriptor. This function sends unicast
381 * message to the destination device.
382 *
383 * @param dstAddr - destination address
384 * @param nwkAddr - 16 bit address
385 * @param UserDescriptor - user descriptor
386 * @param SecurityEnable - Security Options
387 *
388 * @return afStatus_t
389 */
390 afStatus_t ZDP_UserDescSet( zAddrType_t *dstAddr, uint16 nwkAddr,
391 UserDescriptorFormat_t *UserDescriptor,
392 byte SecurityEnable )
393 {
394 byte *pBuf = ZDP_TmpBuf;
395 byte len = (UserDescriptor->len < AF_MAX_USER_DESCRIPTOR_LEN) ?
396 UserDescriptor->len : AF_MAX_USER_DESCRIPTOR_LEN;
397 byte addrLen = 2;
398
399 *pBuf++ = LO_UINT16( nwkAddr );
400 *pBuf++ = HI_UINT16( nwkAddr );
401
402 if ( NLME_GetProtocolVersion() == ZB_PROT_V1_1 )
403 {
404 *pBuf++ = len;
405 addrLen = 3;
406 }
407 pBuf = osal_memcpy( pBuf, UserDescriptor->desc, len );
408 osal_memset( pBuf, AF_USER_DESCRIPTOR_FILL, AF_MAX_USER_DESCRIPTOR_LEN-len );
409
410 return fillAndSend( &ZDP_TransID, dstAddr, User_Desc_set, (AF_MAX_USER_DESCRIPTOR_LEN + addrLen) );
411 }
412 #endif // ZDO_USERDESCSET_REQUEST
413
414 #if defined ( ZDO_SERVERDISC_REQUEST )
415 /*********************************************************************
416 * @fn ZDP_ServerDiscReq
417 *
418 * @brief Build and send a Server_Discovery_req request message.
419 *
420 * @param serverMask - 16-bit bit-mask of server services being sought.
421 * @param SecurityEnable - Security Options
422 *
423 * @return afStatus_t
424 */
425 afStatus_t ZDP_ServerDiscReq( uint16 serverMask, byte SecurityEnable )
426 {
427 byte *pBuf = ZDP_TmpBuf;
428 zAddrType_t dstAddr;
429
430 dstAddr.addrMode = AddrBroadcast;
431 dstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR_DEVZCZR;
432
433 *pBuf++ = LO_UINT16( serverMask );
434 *pBuf = HI_UINT16( serverMask );
435
436 FillAndSendTxOptions( &ZDP_TransID, &dstAddr, Server_Discovery_req, 2,
437 ((SecurityEnable) ? AF_EN_SECURITY : AF_TX_OPTIONS_NONE) );
438 }
439 #endif
440
441 #if defined ( ZDO_ENDDEVICE_ANNCE_REQUEST ) || defined ( ZDO_ENDDEVICE_ANNCE_GENERATE )
442 /*********************************************************************
443 * @fn ZDP_EndDeviceAnnce
444 *
445 * @brief This builds and send an End_Device_Annce
446 * message. This function sends a broadcast message.
447 *
448 * @param nwkAddr - 16 bit address of the device
449 * @param IEEEAddr - 64 bit address of the device
450 * @param capabilities - device capabilities. This field is only
451 * sent for v1.1 networks.
452 * @param SecurityEnable - Security Options
453 *
454 * @return afStatus_t
455 */
456 afStatus_t ZDP_EndDeviceAnnce( uint16 nwkAddr, byte *IEEEAddr,
457 byte capabilities, byte SecurityEnable )
458 {
459 zAddrType_t dstAddr;
460 uint8 len;
461
462 dstAddr.addrMode = (afAddrMode_t)AddrBroadcast;
463 dstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR;
464
465 ZDP_TmpBuf[0] = LO_UINT16( nwkAddr );
466 ZDP_TmpBuf[1] = HI_UINT16( nwkAddr );
467 osal_cpyExtAddr( &ZDP_TmpBuf[2], IEEEAddr );
468 len = 2 + Z_EXTADDR_LEN;
469
470 if ( NLME_GetProtocolVersion() != ZB_PROT_V1_0 )
471 {
472 ZDP_TmpBuf[10] = capabilities;
473 len++;
474 }
475
476 return fillAndSend( &ZDP_TransID, &dstAddr, End_Device_annce, len );
477 }
478 #endif // ZDO_ENDDEVICE_ANNCE_REQUEST
479
480 /*********************************************************************
481 * Address Responses
482 */
483
484 /*********************************************************************
485 * @fn zdpProcessAddrReq
486 *
487 * @brief Process an incoming NWK_addr_req or IEEE_addr_req message and then
488 * build and send a corresponding NWK_addr_rsp or IEEE_addr_rsp msg.
489 *
490 * @param seq - Message sequence number of the request.
491 * @param src - Source address of the request.
492 * @param msg - Incoming request message.
493 * @param cId - Cluster ID of the request.
494 * @param sty - Security enable/disable options.
495 *
496 * @return none
497 */
\ In segment BANKED_CODE, align 1, keep-with-next
498 static void zdpProcessAddrReq(
\ ??zdpProcessAddrReq:
499 byte seq, zAddrType_t *src, byte *msg, uint16 cId, byte sty )
500 {
\ 000000 74F0 MOV A,#-0x10
\ 000002 12.... LCALL ?BANKED_ENTER_XDATA
\ 000005 ; Saved register size: 16
\ 000005 ; Auto size: 6
\ 000005 74FA MOV A,#-0x6
\ 000007 12.... LCALL ?ALLOC_XSTACK8
\ 00000A 7403 MOV A,#0x3
\ 00000C 12.... LCALL ?XSTACK_DISP0_8
\ 00000F E9 MOV A,R1
\ 000010 F0 MOVX @DPTR,A
\ 000011 7404 MOV A,#0x4
\ 000013 12.... LCALL ?XSTACK_DISP0_8
\ 000016 EA MOV A,R2
\ 000017 F0 MOVX @DPTR,A
\ 000018 A3 INC DPTR
\ 000019 EB MOV A,R3
\ 00001A F0 MOVX @DPTR,A
\ 00001B 7401 MOV A,#0x1
\ 00001D 12.... LCALL ?XSTACK_DISP0_8
\ 000020 EC MOV A,R4
\ 000021 F0 MOVX @DPTR,A
\ 000022 A3 INC DPTR
\ 000023 ED MOV A,R5
\ 000024 F0 MOVX @DPTR,A
\ 000025 7416 MOV A,#0x16
\ 000027 12.... LCALL ?XSTACK_DISP0_8
\ 00002A E0 MOVX A,@DPTR
\ 00002B F5
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -