📄 ztcprimitivehandlerothercomplexprimitive.c
字号:
/******************************************************************************
* This module formats the complex primitives which are to be exchanged between
* the test client and BeeStack Layers. Complex primitives are one for which
* ZTC has to format.Here formatting means ZTC 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 "MsgSystem.h"
#include "FunctionLib.h"
#include "ZtcInterface.h"
#include "NwkMacInterface.h"
#include "ZtcQueue.h"
#include "ZtcPrimitiveHandler.h"
#include "ZtcPrimitiveHandlerComplexPrimitive.h"
#if gBeeStackIncluded_d == 1
#include "BeeStackConfiguration.h"
#endif
#include "ZtcConfiguration.h"
#include "ZtcPrimitiveHandlerComplexPrimWithOnePtr.h"
#include "ZtcPrimitiveHandlerComplexPrimWithTableList.h"
#include "ZtcPrimitiveHandlerComplexPrimSyncPrim.h"
#include "ZtcPrimitiveHandlerComplexPrimUtilitySupport.h"
#include "ZtcPrimitiveHandlerOtherComplexPrimitive.h"
/******************************************************************************
*******************************************************************************
* Private macros
******************************************************************************/
#define mMaxBeaconLengthForZigBee_c 30 /* Approximate value */
#define mBufferLengthSimpleDesc_c 73
#define mCharString_c 14
#define mOctetString_c 15
#define mOffsetOfNumberOfCIDFldInSimpleDesc_c 6
#define mOffsetOfNumberOfSimpleDescInSimpleDescStruct_c 3
#define mOffsetAttributeIdInKVPIndication_c 13
/*If Other complex primitive handling capability is enabled then only this
part of code will be enabled*/
#if gZTC_OtherComplexPrimitiveHandlingCapability_d == 1
/******************************************************************************
*******************************************************************************
* Private prototypes
*******************************************************************************
******************************************************************************/
/*****************************************************************************
* Stores kvp indication frame to ZTC buffer to send it to the SAP
*
* Interface assumptions:
* None
*
*
* The routine limitations.
* None
*
* Return value:
* If Success returns msgLength + resultListSize
* If Failed returns 0xFF
*
* Effects on global data.
* None
*
* Source of algorithm used.
* None
*
* Revison history:
*
* date Author Comments
* ------ ------ --------
* 240306 LS, Updated
*****************************************************************************/
uint8_t ZTCPrimHandle_StoreKVPIndInZTCQueue
(
const uint8_t* const pMsg /* IN: Pointer to the messge from test client */
) ;
/*****************************************************************************
* Stores NwkScanCnf frame to ZTC buffer to send it to the SAP
*
* Interface assumptions:
* None
*
*
* The routine limitations.
* None
*
* Return value:
* If Success returns msgLength + resultListSize
* If Failed returns 0xFF
*
* Effects on global data.
* None
*
* Source of algorithm used.
* None
*
* Revison history:
*
* date Author Comments
* ------ ------ --------
* 240306 LS, Updated
*****************************************************************************/
uint8_t ZTCPrimHandle_StoreNwkScanConfInZTCQueue
(
const uint8_t* const pMsg /* IN: Pointer to the messge from test client */
) ;
/*****************************************************************************
* Stores BeaconNotification indication frame to ZTC buffer to send it to the
* SAP
*
* Interface assumptions:
* None
*
*
* The routine limitations.
* None
*
* Return value:
* If Success returns msgLength + resultListSize
* If Failed returns 0xFF
*
* Effects on global data.
* None
*
* Source of algorithm used.
* None
*
* Revison history:
*
* date Author Comments
* ------ ------ --------
* 240306 LS, Updated
*****************************************************************************/
uint8_t ZTCPrimHandle_StoreBeaconNotificationIndInZTCQueue
(
const uint8_t* const pMsg /* IN: Pointer to the messge from test client */
) ;
/*****************************************************************************
* Sends Match descriptor request sent by the test client to the ZDP.
*
* Interface assumptions:
* None
*
*
* The routine limitations.
* None
*
* Return value:
* Returns the length of data it copied from the ZTC queue to the memory
* location pointed by the pMsgToSend
*
* Effects on global data.
* None
*
* Source of algorithm used.
* None
*
* Revison history:
*
* date Author Comments
* ------ ------ --------
* 240306 LS, Updated
*****************************************************************************/
uint8_t ZTCPrimHandle_SendMatchDescToSAP
(
uint8_t* pMsgToSend, /* IN/OUT: Pointer to the message to be
sent to the Beestack */
const uint8_t* const pMsgReceived /* IN: Pointer to the message received
from test client */
);
/*****************************************************************************
* Sends End device Bind request sent by the test client to the ZDP.
*
* Interface assumptions:
* None
*
*
* The routine limitations.
* None
*
* Return value:
* Returns the length of data it copied from the ZTC queue to the memory
* location pointed by the pMsgToSend
*
* Effects on global data.
* None
*
* Source of algorithm used.
* None
*
* Revison history:
*
* date Author Comments
* ------ ------ --------
* 240306 LS, Updated
*****************************************************************************/
uint8_t ZTCPrimHandle_SendEndDeviceBindToSAP
(
uint8_t* pMsgToSend, /*IN/OUT: Pointer to the message to be
sent to the Beestack */
const uint8_t* const pMsgReceived /* IN: Pointer to the message received
from test client */
);
/*****************************************************************************
* Sends KVP data request sent by the test client to the AF.
*
* Interface assumptions:
* None
*
*
* The routine limitations.
* None
*
* Return value:
* Returns the length of data it copied from the ZTC queue to the memory
* location pointed by the pMsgToSend
*
* Effects on global data.
* None
*
* Source of algorithm used.
* None
*
* Revison history:
*
* date Author Comments
* ------ ------ --------
* 240306 LS, Updated
*****************************************************************************/
uint8_t ZTCPrimHandle_SendAF_KVPDataReqToSAP
(
uint8_t* pMsgToSend, /*IN/OUT: Pointer to the message to be sent to the
Beestack */
uint8_t* pMsgReceived /*IN: Pointer to the message received from test
client */
);
/*****************************************************************************
* Sends Aggregated KVP data request sent by the test client to the AF.
*
* Interface assumptions:
* None
*
*
* The routine limitations.
* None
*
* Return value:
* Returns the length of data it copied from the ZTC queue to the memory
* location pointed by the pMsgToSend
*
* Effects on global data.
* None
*
* Source of algorithm used.
* None
*
* Revison history:
*
* date Author Comments
* ------ ------ --------
* 240306 LS, Updated
*****************************************************************************/
uint8_t ZTCPrimHandle_SendAF_KVPDataReqForAggregationToSAP
(
uint8_t* pMsgToSend, /* IN/OUT: Pointer to the message to be sent
to the Beestack */
const uint8_t* const pMsgReceived/* IN: Pointer to the message received
from test client */
);
/*****************************************************************************
* Sends Aggregated MSG data request sent by the test client to the AF.
*
* Interface assumptions:
* None
*
*
* The routine limitations.
* None
*
* Return value:
* Returns the length of data it copied from the ZTC queue to the memory
* location pointed by the pMsgToSend
*
* Effects on global data.
* None
*
* Source of algorithm used.
* None
*
* Revison history:
*
* date Author Comments
* ------ ------ --------
* 240306 LS, Updated
*****************************************************************************/
uint8_t ZTCPrimHandle_SendAF_MSGDataReqForAggregationToSAP
(
uint8_t* pMsgToSend, /* IN/OUT: Pointer to the message to be
sent to the Beestack */
const uint8_t* const pMsgReceived /* IN: Pointer to the message received from test
client */
);
/*****************************************************************************
* Stores Simple descriptor response to ZTC buffer to send it to the
* SAP
*
* Interface assumptions:
* None
*
*
* The routine limitations.
* None
*
* Return value:
* If Success returns msgLength + resultListSize
* If Failed returns 0xFF
*
* Effects on global data.
* None
*
* Source of algorithm used.
* None
*
* Revison history:
*
* date Author Comments
* ------ ------ --------
* 240306 LS, Updated
*****************************************************************************/
uint8_t ZTCPrimHandle_StoreSimpleDescriptorRespInZTCQueue
(
uint8_t* pMsg /* IN/OUT: Pointer to the message to be sent to
the ZTC Queue */
);
/******************************************************************************
*******************************************************************************
* Private type definitions
*******************************************************************************
******************************************************************************/
/* None */
/******************************************************************************
*******************************************************************************
* Private memory declarations
*******************************************************************************
******************************************************************************/
static const uint8_t maLocOfFirstPlaceHolderLengthForMatchDescAndEndDeviceBind[] = {
7, 8 };
/******************************************************************************
*******************************************************************************
* Public memory declarations
*******************************************************************************
******************************************************************************/
const otherComplexPrimitive_t gaOtherComplexPrimitiveHandlerList[] = {
{ NULL, ZTCPrimHandle_StoreNwkScanConfInZTCQueue },
{ NULL, ZTCPrimHandle_StoreBeaconNotificationIndInZTCQueue }
#if gBeeStackIncluded_d == 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -