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

📄 apsmede.h

📁 Zigbee2006入门(源代码+文档讲解+系统推荐)
💻 H
📖 第 1 页 / 共 2 页
字号:
  uint16           nwkAddr;
  uint8            nwkSecure;
} APSME_CmdPkt_t;

// APS Key Data Types
//typedef struct
//{
//  uint16 di;
//  uint8* masterKey;
//} APSME_MasterKeyData_t;

typedef struct
{
  uint8* key;
  uint32 txFrmCntr;
  uint32 rxFrmCntr;
} APSME_LinkKeyData_t;

typedef struct
{
  uint8   frmCtrl;
  uint8   xtndFrmCtrl;
  uint8   srcEP;
  uint8   dstEP;
  uint16  groupID;
  uint16  clusterID;
  uint16  profileID;
  uint8   asduLen;
  uint8*  asdu;
  uint8   hdrLen;
  uint8   apsCounter;
  uint8   transID;
  uint8   blkCount;
  uint8   ackBits;
} APSDE_FrameData_t;

typedef struct
{
  uint8  frmCtrl;
  uint8  xtndFrmCtrl;
  uint8  srcEP;
  uint8  dstEP;
  uint16 clusterID;
  uint16 profileID;
  uint8  asduLen;
  uint16 dstAddr;
  uint8  transID;
} APSDE_StoredFrameData_t;

typedef struct
{
//ZMacDataReq_t     mfd;
  NLDE_FrameData_t  nfd;
  APSDE_FrameData_t afd;
} APSDE_FrameFormat_t;

typedef struct
{
  uint16 dstAddr;
  uint8  frmCtrl;
  uint8  xtndFrmCtrl;
  uint8  asduLen;
} APSDE_FrameAlloc_t;

typedef struct
{
  //input
  APSDE_FrameAlloc_t   fa;

  //output
  APSDE_FrameFormat_t* aff;
  SSP_Info_t*          si;
  uint8                status;
} APSDE_FrameBlk_t;

/******************************************************************************
 * GLOBAL VARIABLES
 */

/******************************************************************************
 * APS Data Service
 *   APSDE-DATA
 */

/*
 * This function requests the transfer of data from the next higher layer
 * to a single peer entity.
 */
extern ZStatus_t APSDE_DataReq( APSDE_DataReq_t* req );

/*
 * This function requests the MTU(Max Transport Unit) of the APS Data Service
 */
extern uint8 APSDE_DataReqMTU( APSDE_DataReqMTU_t* fields );

/*
 * This function reports the results of a request to transfer a data
 * PDU (ASDU) from a local higher layer entity to another single peer entity.
 */
extern void APSDE_DataConfirm( nwkDB_t *rec, ZStatus_t Status );
extern void APSDE_DataCnf( APSDE_DataCnf_t* cnf );

/*
 * This function indicates the transfer of a data PDU (ASDU) from the
 * APS sub-layer to the local application layer entity.
 */
extern void APSDE_DataIndication( aps_FrameFormat_t *aff, zAddrType_t *SrcAddress,
                                uint8 LinkQuality, byte SecurityUse, uint32 timestamp );

/******************************************************************************
 * APS Management Service
 *   APSME-BIND
 *   APSME-UNBIND
 */

/*
 * This function allows the next higher layer to request to bind two devices together
 * either by proxy or directly, if issued on the coordinator.
 *
 * NOTE: The APSME-BIND.confirm is returned by this function and is not a
 *       seperate callback function.
 */
extern ZStatus_t APSME_BindRequest( zAddrType_t *SrcAddr, byte SrcEndpInt,
                            uint16 ClusterId, zAddrType_t *DstAddr, byte DstEndpInt);

/*
 * This function allows the next higher layer to request to unbind two devices
 * either by proxy or directly, if issued on the coordinator.
 *
 * NOTE: The APSME-UNBIND.confirm is returned by this function and is not a
 *       seperate callback function.
 */
extern ZStatus_t APSME_UnBindRequest( zAddrType_t *SrcAddr, byte SrcEndpInt,
                            uint16 ClusterId, zAddrType_t *DstAddr, byte DstEndpInt);

/*
 * This function allows the next higher layer to read the value of an attribute
 * from the AIB (APS Information Base)
 */
extern ZStatus_t APSME_GetRequest( ZApsAttributes_t AIBAttribute,
                                    uint16 Index, byte *AttributeValue );

/*
 * This function allows the next higher layer to write the value of an attribute
 * into the AIB (APS Information Base)
 */
extern ZStatus_t APSME_SetRequest( ZApsAttributes_t AIBAttribute,
                                    uint16 Index, byte *AttributeValue );

/*
 * This function gets the EXT address based on the NWK address.
 */
extern uint8 APSME_LookupExtAddr( uint16 nwkAddr, uint8* extAddr );

/*
 * This function gets the NWK address based on the EXT address.
 */
extern uint8 APSME_LookupNwkAddr( uint8* extAddr, uint16* nwkAddr );

#if 0     // NOT IMPLEMENTED
/*
 * This function allows the next higher layer to be notified of the results of its
 * request to unbind two devices directly or by proxy.
 */
extern void APSME_UnbindConfirm( zAddrType_t CoorAddr,ZStatus_t Status,
                           uint16 SrcAddr, byte SrcEndpInt, byte ObjectId,
                           uint16 DstAddr, byte DstEndpInt);
/*
 * This function allows the next higher layer to be notified of the results of its
 * request to bind two devices directly or by proxy.
 */
extern void APSME_BindConfirm( zAddrType_t CoorAddr,ZStatus_t Status,
                           uint16 SrcAddr, byte SrcEndpInt, byte ObjectId,
                           uint16 DstAddr, byte DstEndpInt);
#endif  // NOT IMPLEMENTED

/******************************************************************************
 * APS Incoming Command Packet Handler
 */

/*
 * APSME_CmdPkt handles APS CMD packets.
 */
extern void APSME_CmdPkt( APSME_CmdPkt_t* pkt );

/******************************************************************************
 * APS Frame Allocation And Routing
 */
/*
 * APSDE_FrameAlloc allocates an APS frame.
 */
extern void APSDE_FrameAlloc( APSDE_FrameBlk_t* blk );

/*
 * APSDE_FrameSend sends an APS frame.
 */
extern void APSDE_FrameSend( APSDE_FrameBlk_t* blk );

/******************************************************************************
 * APS Security Related Functions
 */
/*
 * APSME_FrameSecurityRemove removes security from APS frame.
 */
extern ZStatus_t APSME_FrameSecurityRemove(uint16             srcAddr,
                                           aps_FrameFormat_t* aff);

/*
 * APSME_FrameSecurityApply applies security from APS frame.
 */
extern ZStatus_t APSME_FrameSecurityApply(uint16             dstAddr,
                                          aps_FrameFormat_t* aff);

/*
 * Configure APS security mode
 */
void APSME_SecurityNM( void );   // NULL MODE        - NO SECURITY
void APSME_SecurityRM_ED( void );// RESIDENTIAL MODE - END DEVICE
void APSME_SecurityRM_RD( void );// RESIDENTIAL MODE - ROUTER DEVICE
void APSME_SecurityRM_CD( void );// RESIDENTIAL MODE - COORD DEVICE
void APSME_SecurityCM_ED( void );// COMMERCIAL MODE  - END DEVICE
void APSME_SecurityCM_RD( void );// COMMERCIAL MODE  - ROUTER DEVICE
void APSME_SecurityCM_CD( void );// COMMERCIAL MODE  - COORD DEVICE

/*
 * Configure SKKE slot data
 */
void APSME_SKKE_SlotInit( uint8 total );

/******************************************************************************
 * APS Security Service Primitives - API, NHLE Calls Routines
 *
 *   APSME_EstablishKeyReq
 *   APSME_EstablishKeyRsp
 *   APSME_TransportKeyReq
 *   APSME_UpdateDeviceReq
 *   APSME_RemoveDeviceReq
 *   APSME_RequestKeyReq
 *   APSME_SwitchKeyReq
 */
/*
 * APSME_EstablishKeyReq primitive.
 */
extern ZStatus_t APSME_EstablishKeyReq( APSME_EstablishKeyReq_t* req );

/*
 * APSME_EstablishKeyRsp primitive.
 */
extern ZStatus_t APSME_EstablishKeyRsp( APSME_EstablishKeyRsp_t* rsp );

/*
 * APSME_TransportKeyReq primitive.
 */
extern ZStatus_t APSME_TransportKeyReq( APSME_TransportKeyReq_t* req );

/*
 * APSME_UpdateDeviceReq primitive.
 */
extern ZStatus_t APSME_UpdateDeviceReq( APSME_UpdateDeviceReq_t* req );

/*
 * APSME_RemoveDeviceReq primitive.
 */
extern ZStatus_t APSME_RemoveDeviceReq( APSME_RemoveDeviceReq_t* req );

/*
 * APSME_RequestKeyReq primitive.
 */
extern ZStatus_t APSME_RequestKeyReq( APSME_RequestKeyReq_t* req );

/*
 * APSME_SwitchKeyReq primitive.
 */
extern ZStatus_t APSME_SwitchKeyReq( APSME_SwitchKeyReq_t* req );

/******************************************************************************
 * APS Security Primitive Stubs - API, NHLE Implements Callback Stubs
 *
 *   APSME_EstablishKeyCfm
 *   APSME_EstablishKeyInd
 *   APSME_TransportKeyInd
 *   APSME_UpdateDeviceInd
 *   APSME_RemoveDeviceInd
 *   APSME_RequestKeyInd
 *   APSME_SwitchKeyInd
 */

/*
 * APSME_EstablishKeyCfm primitive.
 */
extern void APSME_EstablishKeyCfm( APSME_EstablishKeyCfm_t* cfm );

/*
 * APSME_EstablishKeyInd primitive.
 */
extern void APSME_EstablishKeyInd( APSME_EstablishKeyInd_t* ind );

/*
 * APSME_TransportKeyInd primitive.
 */
extern void APSME_TransportKeyInd( APSME_TransportKeyInd_t* ind );

/*
 * APSME_UpdateDeviceInd primitive.
 */
extern void APSME_UpdateDeviceInd( APSME_UpdateDeviceInd_t* ind );

/*
 * APSME_RemoveDeviceInd primitive.
 */
extern void APSME_RemoveDeviceInd( APSME_RemoveDeviceInd_t* ind );

/*
 * APSME_RequestKeyInd primitive.
 */
extern void APSME_RequestKeyInd( APSME_RequestKeyInd_t* ind );

/*
 * APSME_SwitchKeyInd primitive.
 */
extern void APSME_SwitchKeyInd( APSME_SwitchKeyInd_t* ind );

/******************************************************************************
 * APS Security Support - NHLE Implements Callback Stubs
 *
 *   APSME_MasterKeyGet
 *   APSME_LinkKeySet
 *   APSME_LinkKeyDataGet
 *   APSME_KeyFwdToChild
 */

/*
 * APSME_MasterKeyExtGet stub.
 */
extern ZStatus_t APSME_MasterKeyGet( uint8*  extAddr, uint8** key );

/*
 * APSME_LinkKeyDataGet stub.
 */
extern ZStatus_t APSME_LinkKeySet( uint8* extAddr, uint8* key );

/*
 * APSME_LinkKeyDataGet stub.
 */
extern ZStatus_t APSME_LinkKeyDataGet( uint16                nwkAddr,
                                       APSME_LinkKeyData_t** data );

/*
 * APSME_FwdKeyToChild stub.
 */
extern uint8 APSME_KeyFwdToChild( APSME_TransportKeyInd_t* ind );

/******************************************************************************
******************************************************************************/
#ifdef __cplusplus
}
#endif

#endif /* NLMEDE_H */


⌨️ 快捷键说明

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