📄 nwkformation.h
字号:
#ifndef NWKFORMATION_H
#define NWKFORMATION_H
// Generate a random value.
#define RANDOM16 1234 // (TMR0) the name of the register may be changed
#define NWK_STATE_FORM_BEACON_NETWORK_START 0
#define NWK_STATE_FORM_NON_BEACON_NETWORK_START 1
//-------------------------------------------------------------------------------------------------------
// Network formation state machine
// Initial preparations
#define NWK_FORM_STATE_INITIALIZE 0
//Ask the mac layer to do the energy scan
#define NWK_FORM_STATE_MAC_ENERGY_SCAN 1
// Ask the mac layer to do the active scan on every channel
#define NWK_FORM_STATE_MAC_ACTIVE_SCAN 2
// Preparations for each channel
#define NWK_FORM_STATE_SET_CHANNEL 3
// Network formation complete
#define NWK_FORM_STATE_FINISH 4
#define NWK_PERMIT_JOIN 5
//-------------------------------------------------------------------------------------------------------
// The network formation status returned to nlmeNetworkFormationRequest(...)
typedef enum {
NWK_NETWORK_FORM_STATUS_ACTIVE,
NWK_NETWORK_FORM_STATUS_FINISHED
} NWK_NETWORK_FORM_STATUS;
//the network type ,beacon enabled or beacon disabled
#define BEACON_ENABLED_NETWORK 1
#define BEACON_DISABLED_NETWORK 0
typedef struct
{
DWORD scanChannels;
UINT8 scanDuration;
UINT8 beaconOrder;
UINT8 superframeOrder;
UINT16 panID;
ZBOOL batteryLifeExtension;
UINT8 networkType;
volatile NWK_NETWORK_FORM_STATUS nwkFormStatus;
NWK_ENUM nwkFormNetworkReturnState;
}NWK_FORMATION_INFO;
typedef struct
{
UINT16 panID;
UINT8 logicalChannel;
UINT8 startTime;
UINT8 beaconOrder;
UINT8 superframeOrder;
ZBOOL panCoordinator;
ZBOOL batteryLifeExtension;
ZBOOL coordRealigment;
ZBOOL securityEnable;
}MLME_START_REQUEST_INFO;
/************************function prototypes*************************/
void nwkFormNetworkProcedure(void *nTask);
/*********************************************************************
* ZBOOL RequestedPANIDFound( BYTE channel );
*
* DESCRIPTION:
* Check if PAN ID conflict is present.
* PARAMETER:
* BYTE channel
* the channel to be checked for PAN ID conflicts
* RETURN-VALUE:
* TRUE - conflict found
* FALSE - no conflict found
* Overview: This function determines if a node in our neighbor
* table on the specified channel has the same PAN ID
* as the one requested.
*
* Note: In a Cluster-tree topology,this routine may not work if the destination
* is our child.
********************************************************************/
ZBOOL RequestedPANIDFound( BYTE channel );
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -