⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ztcprimitivehandlercomplexprimwithoneptr.c

📁 freescale的基于802.15.4的无线通讯例程
💻 C
📖 第 1 页 / 共 2 页
字号:
/******************************************************************************
* This module formats the complex primitives having one pointer which are to be
* exchanged between the test client and BeeStack Layers. Complex primitives are
* one, which are of varibale length. ZTC has to format, meaning it has to put 
* the messages in proper way so that BeeStack can understand when test client 
* sends and vice-versa    
*
*
* (c) Copyright 2006, Freescale, Inc. All rights reserved.
*
* Freescale Semiconductor Confidential Proprietary
*
* No part of this document must be reproduced in any form - including copied,
* transcribed, printed or by any electronic means - without specific written
* permission from Freescale Semiconductor Danmark A/S.
*
******************************************************************************/
#if ( gZtcIncluded_d == 1  ) 

#include "EmbeddedTypes.h"
#include "ZtcInterface.h"
#include "AppAspInterface.h"
#include "NwkMacInterface.h"
#include "FunctionLib.h"
#include "MsgSystem.h"
#if gBeeStackIncluded_d == 1 
#include "ApsNwkInterface.h"
#include "AfApsInterface.h"
#endif /*  gBeeStackIncluded_d */
#include "ZtcQueue.h"
#include "ZtcPrimitiveHandlerComplexPrimitive.h"
#include "ZtcConfiguration.h"
#include "ZtcPrimitiveHandlerComplexPrimWithOnePtr.h"

/*If Primitive with one pointer handling capability is  enabled then only this
* part of code will be enabled*/
#if gZTC_PrimitiveWithOnePointerHandlingCapability_d == 1
/******************************************************************************
*******************************************************************************
* Private macros
*******************************************************************************
******************************************************************************/
#define mOffsetForPtrLocInMcpsDataReq_c \
  sizeof( mcpsDataReq_t ) - sizeof( uint8_t* )
#define mOffsetForPtrLocInMCPSDataInd_c \
  sizeof( mcpsDataInd_t ) - sizeof( uint8_t* )
#define mOffsetForPtrLocInMCPSPromInd_c \
  sizeof( mcpsPromInd_t ) - sizeof( uint8_t* )
#define mOffsetForPtrLocInASP_NVMReq_c  \
  sizeof( aspNvRamReq_t ) - sizeof( uint8_t* )  
#define mOffsetForPtrLocInNLDEDataReq_c \
  sizeof( nldeDataReq_t ) - sizeof( uint8_t* )
#define mOffsetForPtrLocInNLDEDataInd_c \
  sizeof( nldeDataIndication_t ) - sizeof( uint8_t* )
#define mOffsetForPtrLocInAFMsgDataInd_c \
  sizeof( appMsgDataMessage_t ) - sizeof( uint8_t* )
#define mOffsetForPtrLocInNLMENwkDiscConf_c 1
#define mOffsetForPtrLocInApsdeDataReq_c		15
#define mOffsetForPtrLocInApsdeDataInd_c		15
#define mOffsetForPtrLocInZDPNwkDiscConf_c  1

#define mOffsetForPosOfnumOfListInMcpsDataReq_c			22
#define mOffsetForPosOfnumOfListInMCPSDataInd_c			22
#define mOffsetForPosOfnumOfListInMCPSPromInd_c			1
#define mOffsetForPosOfnumOfListInASP_NVMReq_c			1
#define mOffsetForPosOfnumOfListInNLDEDataReq_c			2
#define mOffsetForPosOfnumOfListInNLDEDataInd_c			2
#define mOffsetForPosOfnumOfListInAFMsgDataInd_c		13
#define mOffsetForPosOfnumOfListInNLMENwkDiscConf_c 0
#define mOffsetForPosOfnumOfListInApsdeDataReq_c		14
#define mOffsetForPosOfnumOfListInApsdeDataInd_c		14
#define mOffsetForPosOfnumOfListInZDPNwkDiscConf_c  0

#define mLengthOfDataAfterPtrLocInMcpsDataReq_c			 0
#define mLengthOfDataAfterPtrLocInMCPSDataInd_c			 0
#define mLengthOfDataAfterPtrLocInMCPSPromInd_c			 0
#define mLengthOfDataAfterPtrLocInASP_NVMReq_c			 0
#define mLengthOfDataAfterPtrLocInNLDEDataReq_c			 0
#define mLengthOfDataAfterPtrLocInNLDEDataInd_c			 0
#define mLengthOfDataAfterPtrLocInAFMsgDataInd_c		 0
#define mLengthOfDataAfterPtrLocInNLMENwkDiscConf_c	 1
#define mLengthOfDataAfterPtrLocInApsdeDataReq_c		 3
#define mLengthOfDataAfterPtrLocInApsdeDataInd_c		 3
#define mLengthOfDataAfterPtrLocInZDPNwkDiscConf_c	 1

#define mOffsetAddedToThePtrForMcpsDataReq_c				 0
#define mOffsetAddedToThePtrForMCPSDataInd_c				 0
#define mOffsetAddedToThePtrForMCPSPromInd_c				 0
#define mOffsetAddedToThePtrForASP_NVMReq_c					 0
#define mOffsetAddedToThePtrForNLDEDataReq_c				 \
  sizeof( mcpsDataReq_t ) - sizeof( nldeDataReq_t ) + 8 /* APS Header */
#define mOffsetAddedToThePtrForNLDEDataInd_c				 0
#define mOffsetAddedToThePtrForAFMsgDataInd_c				 0
#define mOffsetAddedToThePtrForNLMENwkDiscConf_c		 0
#define mOffsetAddedToThePtrForApsdeDataReq_c				 \
  sizeof( mcpsDataReq_t ) - sizeof( apsdeDataReq_t ) \
  + 8 /* APS Header */ + 6 /* NWK Header */
#define mOffsetAddedToThePtrForApsdeDataInd_c				 0
#define mOffsetAddedToThePtrForZDPNwkDiscConf_c			 0

#define mSizeOfTableForMcpsDataReq_c				 1
#define mSizeOfTableForMCPSDataInd_c				 1
#define mSizeOfTableForMCPSPromInd_c				 1
#define mSizeOfTableForASP_NVMReq_c					 1
#define mSizeOfTableForNLDEDataReq_c				 1
#define mSizeOfTableForNLDEDataInd_c				 1
#define mSizeOfTableForAFMsgDataInd_c				 1
#define mSizeOfTableForNLMENwkDiscConf_c		 sizeof( networkDesc_t )
#define mSizeOfTableForApsdeDataReq_c				 1
#define mSizeOfTableForApsdeDataInd_c				 1
#define mSizeOfTableForZDPNwkDiscConf_c   	 sizeof( networkDesc_t )

/******************************************************************************
*******************************************************************************
* Private prototypes
*******************************************************************************
******************************************************************************/
/* None */

/******************************************************************************
*******************************************************************************
* Private type definitions
*******************************************************************************
******************************************************************************/

 /* The below type definition will be used to locate the pointer and the length 
    to be extracted in the primitive structure */

typedef struct complexPrimWithOnePtr_tag{
	uint8_t ptrLoc;                  /* Location of the pointer infromation in  
	                                    the primitive structure */			 
	uint8_t posOfnumOfList;          /* Location of the number of list in the
	                                     pointer location */
	uint8_t lengthOfDataAfterPtrLoc; /* Length of the data after pointer location
	                                    in the primitive structure */ 
	uint8_t offsetAddedToThePtr;		 /* Offset to be added to write the content 
	                         location after the end of the primitive location */
	uint8_t sizeOfTable; 						 /* Memory used by each table pointed by the
                                    	pointer */
}complexPrimWithOnePtr_t;

/******************************************************************************
*******************************************************************************
* Private memory declarations
*******************************************************************************
******************************************************************************/
 /* Look up table to store information on the primitives with one pointer */

static const complexPrimWithOnePtr_t maComplexPrimWithPtr[] = {
  /*  gMcpsDataReqId_c  */
  { mOffsetForPtrLocInMcpsDataReq_c, mOffsetForPosOfnumOfListInMcpsDataReq_c, 
  mLengthOfDataAfterPtrLocInMcpsDataReq_c, mOffsetAddedToThePtrForMcpsDataReq_c, 
  mSizeOfTableForMcpsDataReq_c },
     
  /*  gMCPSDataIndId_c  */  
  { mOffsetForPtrLocInMCPSDataInd_c, mOffsetForPosOfnumOfListInMCPSDataInd_c,
  mLengthOfDataAfterPtrLocInMCPSDataInd_c, mOffsetAddedToThePtrForMCPSDataInd_c, 
  mSizeOfTableForMCPSDataInd_c },
  
  /*  gMCPSPromIndId_c */
  { mOffsetForPtrLocInMCPSPromInd_c, mOffsetForPosOfnumOfListInMCPSPromInd_c , 
  mLengthOfDataAfterPtrLocInMCPSPromInd_c, mOffsetAddedToThePtrForMCPSPromInd_c, 
  mSizeOfTableForMCPSPromInd_c  },
  
   /*  gASP_NVMReqId_c  */
  { mOffsetForPtrLocInASP_NVMReq_c, mOffsetForPosOfnumOfListInASP_NVMReq_c , 
  mLengthOfDataAfterPtrLocInASP_NVMReq_c, mOffsetAddedToThePtrForASP_NVMReq_c, 
  mSizeOfTableForASP_NVMReq_c }
  
 #if gBeeStackIncluded_d == 1 
   /*  gNLDEDataReqId_c  */
  ,{ mOffsetForPtrLocInNLDEDataReq_c, mOffsetForPosOfnumOfListInNLDEDataReq_c , 
  mLengthOfDataAfterPtrLocInNLDEDataReq_c, mOffsetAddedToThePtrForNLDEDataReq_c, 
  mSizeOfTableForNLDEDataReq_c },
   
   /*  gNLDEDataIndId_c */  
  { mOffsetForPtrLocInNLDEDataInd_c, mOffsetForPosOfnumOfListInNLDEDataInd_c, 
  mLengthOfDataAfterPtrLocInNLDEDataInd_c, mOffsetAddedToThePtrForNLDEDataInd_c, 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -