📄 af.s51
字号:
CFI `VB.BR9` SameValue
CFI `VB.BR10` SameValue
CFI `VB.BR11` SameValue
CFI `VB.BR12` SameValue
CFI `VB.BR13` SameValue
CFI `VB.BR14` SameValue
CFI `VB.BR15` SameValue
CFI VB SameValue
CFI B SameValue
CFI A SameValue
CFI PSW SameValue
CFI DPL0 SameValue
CFI DPH0 SameValue
CFI R0 SameValue
CFI R1 SameValue
CFI R2 SameValue
CFI R3 SameValue
CFI R4 SameValue
CFI R5 SameValue
CFI R6 SameValue
CFI R7 SameValue
CFI V0 SameValue
CFI V1 SameValue
CFI V2 SameValue
CFI V3 SameValue
CFI V4 SameValue
CFI V5 SameValue
CFI V6 SameValue
CFI V7 SameValue
CFI PSPH Undefined
CFI PSPL Undefined
CFI XSPH Undefined
CFI XSPL Undefined
CFI ?RET Concat
CFI ?BRET_EXT SameValue
CFI ?RET_HIGH Frame(CFA_SP, 2)
CFI ?RET_LOW Frame(CFA_SP, 1)
CFI EndCommon cfiCommon1
EXTERN osal_mem_alloc
FUNCTION osal_mem_alloc,0202H
ARGFRAME XSTACK, 14, STACK
EXTERN osal_msg_allocate
FUNCTION osal_msg_allocate,0202H
ARGFRAME XSTACK, 21, STACK
EXTERN osal_msg_send
FUNCTION osal_msg_send,0202H
ARGFRAME XSTACK, 21, STACK
EXTERN NLME_GetProtocolVersion
FUNCTION NLME_GetProtocolVersion,0202H
ARGFRAME XSTACK, 25, STACK
EXTERN aps_FindGroupForEndpoint
FUNCTION aps_FindGroupForEndpoint,0202H
ARGFRAME XSTACK, 25, STACK
EXTERN osal_mem_free
FUNCTION osal_mem_free,0202H
ARGFRAME XSTACK, 43, STACK
EXTERN osal_memcpy
FUNCTION osal_memcpy,0202H
ARGFRAME XSTACK, 24, STACK
EXTERN NLME_IsAddressBroadcast
FUNCTION NLME_IsAddressBroadcast,0202H
ARGFRAME XSTACK, 43, STACK
EXTERN APSDE_DataReq
FUNCTION APSDE_DataReq,0202H
ARGFRAME XSTACK, 43, STACK
EXTERN NLME_GetShortAddr
FUNCTION NLME_GetShortAddr,0202H
ARGFRAME XSTACK, 43, STACK
EXTERN APSDE_DataReqMTU
FUNCTION APSDE_DataReqMTU,0202H
ARGFRAME XSTACK, 9, STACK
EXTERN apsfSendFragmented
// C:\Texas Instruments\ZStack-1.4.2-1.1.0\Components\stack\af\AF.c
// 1 /*********************************************************************
// 2 Filename: AF.c
// 3 Revised: $Date: 2007-05-14 17:34:18 -0700 (Mon, 14 May 2007) $
// 4 Revision: $Revision: 14296 $
// 5
// 6 Description: General Operational Framework
// 7 - Device Description helper functions
// 8
// 9 Notes:
// 10
// 11 If supporting KVP, then afRegister() ties endpoint to KVP only in V2.
// 12 If KVP in V2,
// 13
// 14 Copyright (c) 2006 by Texas Instruments, Inc.
// 15 All Rights Reserved. Permission to use, reproduce, copy, prepare
// 16 derivative works, modify, distribute, perform, display or sell this
// 17 software and/or its documentation for any purpose is prohibited
// 18 without the express written consent of Texas Instruments, Inc.
// 19 *********************************************************************/
// 20
// 21 /*********************************************************************
// 22 * INCLUDES
// 23 */
// 24
// 25 #include "OSAL.h"
// 26 #include "AF.h"
// 27 #include "nwk_globals.h"
// 28 #include "nwk_util.h"
// 29 #include "aps_groups.h"
// 30 #include "ZDProfile.h"
// 31 #include "aps_frag.h"
// 32
// 33 #if ( AF_FLOAT_SUPPORT )
// 34 #include "math.h"
// 35 #endif
// 36
// 37 #if defined ( MT_AF_CB_FUNC )
// 38 #include "MT_AF.h"
// 39 #endif
// 40
// 41 /*********************************************************************
// 42 * MACROS
// 43 */
// 44
// 45 /*********************************************************************
// 46 * @fn afSend
// 47 *
// 48 * @brief Helper macro for V1 API to invoke V2 API.
// 49 *
// 50 * input parameters
// 51 *
// 52 * @param *dstAddr - Full ZB destination address: Nwk Addr + End Point.
// 53 * @param srcEP - Origination (i.e. respond to or ack to) End Point.
// 54 * @param cID - A valid cluster ID as specified by the Profile.
// 55 * @param len - Number of bytes of data pointed to by next param.
// 56 * @param *buf - A pointer to the data bytes to send.
// 57 * @param options - Valid bit mask of AF Tx Options as defined in AF.h.
// 58 * @param *transID - A pointer to a byte which can be modified and which will
// 59 * be used as the transaction sequence number of the msg.
// 60 *
// 61 * output parameters
// 62 *
// 63 * @param *transID - Incremented by one if the return value is success.
// 64 *
// 65 * @return afStatus_t - See previous definition of afStatus_... types.
// 66 */
// 67 #if ( AF_V1_SUPPORT )
// 68 #define afSend( dstAddr, srcEP, cID, len, buf, transID, options, radius ) \
// 69 afDataRequest( (dstAddr), afFindEndPointDesc( (srcEP) ), \
// 70 (cID), (len), (buf), (transID), (options), (radius) )
// 71 #else
// 72 #define afSend( dstAddr, srcEP, cID, len, buf, transID, options, radius ) \
// 73 AF_DataRequest( (dstAddr), afFindEndPointDesc( (srcEP) ), \
// 74 (cID), (len), (buf), (transID), (options), (radius) )
// 75 #endif
// 76
// 77 /*********************************************************************
// 78 * CONSTANTS
// 79 */
// 80
// 81 /*********************************************************************
// 82 * TYPEDEFS
// 83 */
// 84
// 85 #if ( AF_KVP_SUPPORT )
// 86 typedef struct
// 87 {
// 88 uint16 clusterID;
// 89 byte transCount;
// 90 byte options;
// 91 byte srcEP;
// 92 afAddrType_t dstAddr;
// 93 uint16 msgLen;
// 94 byte *msg;
// 95 } afMultiHdr_t;
// 96 #endif
// 97
// 98 /*********************************************************************
// 99 * GLOBAL VARIABLES
// 100 */
// 101
RSEG XDATA_Z:XDATA:NOROOT(0)
REQUIRE __INIT_XDATA_Z
// 102 epList_t *epList;
epList:
DS 2
// 103
// 104 /*********************************************************************
// 105 * EXTERNAL VARIABLES
// 106 */
// 107
// 108 /*********************************************************************
// 109 * EXTERNAL FUNCTIONS
// 110 */
// 111
// 112 /*********************************************************************
// 113 * LOCAL VARIABLES
// 114 */
// 115
// 116 /*********************************************************************
// 117 * LOCAL FUNCTIONS
// 118 */
// 119
// 120 #if ( AF_KVP_SUPPORT )
// 121 static void afBuildKVPIncoming( aps_FrameFormat_t *aff, endPointDesc_t *epDesc,
// 122 zAddrType_t *SrcAddress, uint8 LinkQuality, byte SecurityUse );
// 123 #endif
// 124
// 125 static void afBuildMSGIncoming( aps_FrameFormat_t *aff, endPointDesc_t *epDesc,
// 126 zAddrType_t *SrcAddress, uint8 LinkQuality, byte SecurityUse,
// 127 uint32 timestamp );
// 128
// 129 #if ( AF_KVP_SUPPORT )
// 130 static afMultiHdr_t *multiInit( afAddrType_t *dstAddr,
// 131 byte srcEndPoint, uint16 clusterID, byte FrameType,
// 132 byte txOptions, bool DiscoverRoute, byte RadiusCounter );
// 133
// 134 static bool multiAppend( afMultiHdr_t *hdr, byte bufLen, byte *buf,
// 135 byte CommandType, byte AttribDataType, uint16 AttribId, byte ErrorCode );
// 136
// 137 static afStatus_t multiSend( afMultiHdr_t *hdr, byte *seqNum, byte radius );
// 138 #endif
// 139
// 140 #if ( AF_V1_SUPPORT )
// 141 static afStatus_t afDataRequest( afAddrType_t *dstAddr, endPointDesc_t *srcEP,
// 142 uint16 cID, uint16 len, uint8 *buf, uint8 *transID,
// 143 uint8 options, uint8 radius );
// 144 #endif
// 145
// 146 static epList_t *afFindEndPointDescList( byte EndPoint );
// 147
// 148 static pDescCB afGetDescCB( endPointDesc_t *epDesc );
// 149
// 150 /*********************************************************************
// 151 * NETWORK LAYER CALLBACKS
// 152 */
// 153
// 154 /*********************************************************************
// 155 * PUBLIC FUNCTIONS
// 156 */
// 157
// 158 /*********************************************************************
// 159 * @fn afInit
// 160 *
// 161 * @brief Initialization function for the AF.
// 162 *
// 163 * @param none
// 164 *
// 165 * @return none
// 166 */
RSEG BANKED_CODE:CODE:NOROOT(0)
// 167 void afInit( void )
afInit:
CFI Block cfiBlock0 Using cfiCommon0
CFI Function afInit
// 168 {
PUSH DPL
CFI DPL0 Frame(CFA_SP, 4)
CFI CFA_SP SP+-4
PUSH DPH
CFI DPH0 Frame(CFA_SP, 5)
CFI CFA_SP SP+-5
; Saved register size: 2
; Auto size: 0
// 169 // Start with no endpoint defined
// 170 epList = NULL;
MOV DPTR,#epList
CLR A
MOVX @DPTR,A
INC DPTR
MOVX @DPTR,A
// 171 }
LJMP ?Subroutine30 & 0xFFFF
CFI EndBlock cfiBlock0
// 172
// 173 /*********************************************************************
// 174 * @fn afRegisterExtended
// 175 *
// 176 * @brief Register an Application's EndPoint description.
// 177 *
// 178 * @param epDesc - pointer to the Application's endpoint descriptor.
// 179 * @param descFn - pointer to descriptor callback function
// 180 *
// 181 * NOTE: The memory that epDesc is pointing to must exist after this call.
// 182 *
// 183 * @return Pointer to epList_t on success, NULL otherwise.
// 184 */
RSEG BANKED_CODE:CODE:NOROOT(0)
// 185 epList_t *afRegisterExtended( endPointDesc_t *epDesc, pDescCB descFn )
afRegisterExtended:
CFI Block cfiBlock1 Using cfiCommon0
CFI Function afRegisterExtended
// 186 {
FUNCALL afRegisterExtended, osal_mem_alloc
LOCFRAME XSTACK, 14, STACK
ARGFRAME XSTACK, 14, STACK
MOV A,#-0xe
LCALL ?BANKED_ENTER_XDATA
CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
CFI CFA_SP SP+0
CFI CFA_XSP16 add(XSP16, 14)
; Saved register size: 14
; Auto size: 0
MOV A,R2
MOV R6,A
MOV A,R3
MOV R7,A
MOV A,#0xe
LCALL ?XSTACK_DISP0_8
MOVX A,@DPTR
MOV ?V0 + 0,A
INC DPTR
MOVX A,@DPTR
MOV ?V0 + 1,A
INC DPTR
MOVX A,@DPTR
MOV ?V0 + 2,A
// 187 epList_t *ep;
// 188 epList_t *epSearch;
// 189
// 190 ep = osal_mem_alloc( sizeof ( epList_t ) );
; Setup parameters for call to function osal_mem_alloc
MOV R2,#0xa
MOV R3,#0x0
MOV DPTR,#(osal_mem_alloc & 0xffff)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -