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

📄 sscs_802_15_4.h

📁 802.15.4协议的sscs的c文件和header文件
💻 H
📖 第 1 页 / 共 2 页
字号:
// Copyright (c) 2001-2008, Scalable Network Technologies, Inc.  All Rights Reserved.//                          6701 Center Drive West//                          Suite 520//                          Los Angeles, CA 90045//                          sales@scalable-networks.com//// This source code is licensed, not sold, and is subject to a written// license agreement.  Among other things, no portion of this source// code may be copied, transmitted, disclosed, displayed, distributed,// translated, used as the basis for a derivative work, or used, in// whole or in part, for any program or purpose other than its intended// use in compliance with the license agreement as part of the QualNet// software.  This source code and certain of the algorithms contained// within it are confidential trade secrets of Scalable Network// Technologies, Inc. and may not be used as the basis for any other// software, hardware, product or service.//This is the header file for MAC protocol for IEEE 802.15.4 standards.#ifndef SSCS_802_15_4_H#define SSCS_802_15_4_H#include "api.h"#include "partition.h"#include "mac_802_15_4_cmn.h"#include "mac_802_15_4.h"//--------------------------------------------------------------------------// #define's//--------------------------------------------------------------------------// /**// CONSTANT    :: S802_15_4DEFBOVAL : 3// DESCRIPTION :: Default BO value// **/#define S802_15_4DEF_BOVAL   3// /**// CONSTANT    :: S802_15_4DEFSOVAL : 3// DESCRIPTION :: Default SO value// **/#define S802_15_4DEF_SOVAL   3// /**// CONSTANT    :: S802_15_4DEF_SCANDUR : 3// DESCRIPTION :: Default Scan Duration value// **/#define S802_15_4DEF_SCANDUR   3// /**// CONSTANT    :: S802_15_4SCANCHANNELS : 0x00003800// DESCRIPTION :: Channels to be scanned : only first 3 channels in 2.4G// **/#define S802_15_4SCANCHANNELS   0x00003800// /**// CONSTANT    :: S802_15_4ASSORETRY_INTERVAL : 1 * SECOND// DESCRIPTION :: Retry Association interval// **/#define S802_15_4ASSORETRY_INTERVAL     1 * SECOND//--------------------------------------------------------------------------// typedef's enums//--------------------------------------------------------------------------// /**// ENUM        :: S802_15_4TimerType// DESCRIPTION :: Timers used by SSCS// **/typedef enum{    //SSCS sub-layer timers    S802_15_4STARTDEVICE,    S802_15_4STOPDEVICE,    S802_15_4STARTBEACON,    S802_15_4STOPBEACON,    S802_15_4ASSORETRY,    S802_15_4POLLINT}S802_15_4TimerType;// /**// ENUM        :: S802_15_4State// DESCRIPTION :: SSCS states// **/typedef enum{    S802_15_4NULL,    S802_15_4SCANREQ,    S802_15_4STARTREQ,    S802_15_4ASSOREQ,    S802_15_4DISASSOREQ,    S802_15_4UP}S802_15_4State;//--------------------------------------------------------------------------// typedef's struct//--------------------------------------------------------------------------//                       Layer structure//--------------------------------------------------------------------------// /**// STRUCT      :: S802_15_4Timer// DESCRIPTION :: Timer type for SSCS 802.15.4// **/typedef struct sscs_802_15_4_timer_str{    S802_15_4TimerType timerType;}S802_15_4Timer;// /**// STRUCT      :: S802_15_4Statistics// DESCRIPTION :: Statistics of SSCS802.15.4// **/typedef struct sscs_802_15_4_stats_str{    long numAssociationAcptd;    long numAssociationRejctd;    long numSyncLoss;}S802_15_4Statistics;// /**// STRUCT      :: SscsData802_15_4// DESCRIPTION :: Layer structure of SSCS802.15.4// **/typedef struct sscs_802_15_4_str{    BOOL t_isCT;    BOOL t_txBeacon;    BOOL t_isFFD;    BOOL t_assoPermit;    UInt8 t_BO;    UInt8 t_SO;    int ffdMode;    //0=PAN-cord, 1=coord, 2=device    clocktype pollInt;    //for cluster tree    UInt16 rt_myDepth;    UInt16 rt_myNodeID;    UInt16 rt_myParentNodeID;    UInt32 ScanChannels;    BOOL neverAsso;    //--- store results returned from MLME_SCAN_confirm() ---    UInt32 T_UnscannedChannels;    UInt8  T_ResultListSize;    UInt8* T_EnergyDetectList;    M802_15_4PanEle* T_PANDescriptorList;    M802_15_4PanEle startDevice_panDes;    UInt8 Channel;    UInt8  startDevice_Channel;    //SSCS state    S802_15_4State state;    //Statistics    S802_15_4Statistics stats;    //Seed    RandomSeed seed;}SscsData802_15_4;//--------------------------------------------------------------------------// FUNCTION DECLARATIONS//--------------------------------------------------------------------------// API functions between SSCS and MAC//--------------------------------------------------------------------------// /**// FUNCTION   :: Sscs802_15_4IsDeviceUp// LAYER      :: SSCS// PURPOSE    :: Primitive to find out whether the device is up or not.// PARAMETERS ::// + node           : Node*         : Node receiving call// + interfaceIndex : int       : Interface Index// RETURN  :: BOOL// **/BOOL Sscs802_15_4IsDeviceUp(        Node* node,        int interfaceIndex);// /**// FUNCTION   :: Sscs802_15_4MCPS_DATA_confirm// LAYER      :: Mac// PURPOSE    :: Primitive to report results of a request to tx a data SPDU// PARAMETERS ::// + node           : Node*         : Node receiving call// + interfaceIndex     : int                   : Interface Index// + msduHandle     : UInt8         : Handle associated with MSDU// + status         : M802_15_4_enum: Status of data sent request// RETURN  :: None// **/void Sscs802_15_4MCPS_DATA_confirm(        Node* node,        int interfaceIndex,        UInt8 msduHandle,        M802_15_4_enum status);// /**// FUNCTION   :: Sscs802_15_4MCPS_DATA_indication// LAYER      :: Mac// PURPOSE    :: Primitive to indicate the transfer of a data SPDU to SSCS// PARAMETERS ::// + node           : Node*         : Node receiving call// + interfaceIndex     : int                   : Interface Index// + SrcAddrMode    : UInt8         : Source address mode// + SrcPANId       : UInt16        : source PAN id// + SrcAddr        : MACADDR    : Source address// + DstAddrMode    : UInt8         : Destination address mode// + DstPANId       : UInt16        : Destination PAN id// + DstAddr        : MACADDR    : Destination Address// + msduLength     : UInt8         : MSDU length// + msdu           : Message*      : MSDU// + mpduLinkQuality: UInt8         : LQI value measured during reception of//                                    the MPDU// + SecurityUse    : BOOL          : whether security is used// + ACLEntry       : UInt8         : ACL entry// RETURN  :: None// **/void Sscs802_15_4MCPS_DATA_indication(        Node* node,        int interfaceIndex,        UInt8 SrcAddrMode,        UInt16 SrcPANId,        MACADDR SrcAddr,        UInt8 DstAddrMode,        UInt16 DstPANId,        MACADDR DstAddr,        UInt8 msduLength,        Message *msdu,        UInt8 mpduLinkQuality,        BOOL SecurityUse,        UInt8 ACLEntry);// /**// FUNCTION   :: Sscs802_15_4MCPS_PURGE_confirm// LAYER      :: Mac// PURPOSE    :: Primitive to report result of purge request// PARAMETERS ::// + node           : Node*         : Node receiving call// + interfaceIndex     : int                   : Interface Index// + msduHandle     : UInt8         : Handle associated with MSDU// + status         : M802_15_4_enum: Status of purge request// RETURN  :: None// **/void Sscs802_15_4MCPS_PURGE_confirm(        Node* node,        int interfaceIndex,        UInt8 msduHandle,        M802_15_4_enum status);// /**// FUNCTION   :: Sscs802_15_4MLME_ASSOCIATE_indication// LAYER      :: Mac// PURPOSE    :: Primitive to indicate an incoming associate request// PARAMETERS ::// + node           : Node*         : Node receiving call// + interfaceIndex     : int                   : Interface Index// + DeviceAddress      : MACADDR    : Address of device requesting//                                        association// + CapabilityInformation : UInt8  : capabilities of associating device// + SecurityUse    : BOOL          : Whether enable security or not// + ACLEntry       : UInt8         : ACL entry// RETURN  :: None// **/void Sscs802_15_4MLME_ASSOCIATE_indication(        Node* node,        int interfaceIndex,        MACADDR DeviceAddress,        UInt8 CapabilityInformation,        BOOL SecurityUse,        UInt8 ACLEntry);// /**// FUNCTION   :: Sscs802_15_4MLME_ASSOCIATE_confirm// LAYER      :: Mac// PURPOSE    :: Primitive to report result of associate request// PARAMETERS ::// + node               : Node*         : Node receiving call// + interfaceIndex     : int                   : Interface Index// + AssocShortAddress  : UInt16        : Short address allocated by coord// + status             : M802_15_4_enum: Status of association attempt// RETURN  :: None

⌨️ 快捷键说明

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