📄 mac.h
字号:
//-------------------------------------------------------------------------------------------------------
// void mlmeOrphanIndication(QWORD orphanAddress, ZBOOL securityUse, UINT8 aclEntry)
//
// DESCRIPTION:
// Callback generated by the MAC sublayer to the higher layer upon reception of a
// orphan notification command frame
// Function must be implemented by the higher layer of a FFD device
//
// PARAMETERS:
// QWORD orphanAddress
// Extended address of the device notifying its orphan state
// ZBOOL securityUse
// Security enabled for the incoming frame?
// UINT8 aclEntry
// The macSecurityMode parameter value from the ACL entry associated with the sender of
// the data frame. This value is set to 0x08 if the sender of the data frame was not
// found in the ACL.
//-------------------------------------------------------------------------------------------------------
void mlmeOrphanIndication(ADDRESS * orphanAddress, ZBOOL securityUse, UINT8 aclEntry);
//-------------------------------------------------------------------------------------------------------
// void mlmeOrphanResponse(QWORD orphanAddress, WORD shortAddress, ZBOOL associatedMember, ZBOOL ...)
//
// DESCRIPTION:
// Respond to an orphan notification by transmitting a coordinator realignment frame.
//
// PARAMETERS:
// QWORD orphanAddress
// Extended address of the orphaned device
// WORD shortAddress
// The short address of the coordinator
// ZBOOL associatedMember
// This node is associated on this PAN
// Note: mlmeOrphanResponse is ignored if set to FALSE
// ZBOOL securityEnable
// Security is enabled for the coordinator realignment command frame?
//-------------------------------------------------------------------------------------------------------
void mlmeOrphanResponse(QWORD orphanAddress, WORD shortAddress, ZBOOL associatedMember, ZBOOL securityEnable);
//-------------------------------------------------------------------------------------------------------
// void mlmePollRequest(BYTE coordAddrMode, WORD coordPANId, ADDRESS *pCoordAddress, ZBOOL ...)
//
// DESCRIPTION:
// Poll indirect data from the coordinator
//
// PARAMETERS:
// BYTE coordAddrMode
// The coordinator address mode (AM_SHORT_16 or AM_EXTENDED_64)
// WORD coordPANId
// The PAN identifier of the coordinator
// ADDRESS *pCoordAddress
// A pointer to the coordinator address (short or extended)
// ZBOOL securityEnable
// Enable security for data-request command frame?
//-------------------------------------------------------------------------------------------------------
void mlmePollRequest(BYTE coordAddrMode, WORD coordPANId, ADDRESS *coordAddress, ZBOOL securityEnable);
//-------------------------------------------------------------------------------------------------------
// void mlmeDisassociateConfirm(MAC_ENUM status)
//
// DESCRIPTION:
// Callback generated by the MAC sublayer to the higher layer upon completion of a
// mlmePollRequest(...) call from the higher layer.
// Function must be implemented by the higher layer.
//
// PARAMETERS:
// MAC_ENUM status
// Status returned by the callback
// (SUCCESS | CHANNEL_ACCESS_FAILURE | NO_ACK | MAC_NO_DATA | UNAVAILABLE_KEY |
// FAILED_SECURITY_CHECK | INVALID_PARAMETER)
//-------------------------------------------------------------------------------------------------------
void mlmePollConfirm(MAC_ENUM status);
//-------------------------------------------------------------------------------------------------------
// MAC_ENUM mlmeResetRequest(ZBOOL setDefaultPIB)
//
// DESCRIPTION:
// Reset the MAC and PHY layers, including CC2420, the microcontroller, and all state variables.
// NOTE: The initialization and power-up sequence must be performed according to
// the MAC documentation prior to calling mlmeResetRequest or other
// MAC primitives
//
// PARAMETERS:
// ZBOOL setDefaultPIB
// Reset the PHY and MAC PIBs
//
// RETURN VALUE:
// MAC_ENUM
// Always SUCCESS
//-------------------------------------------------------------------------------------------------------
MAC_ENUM mlmeResetRequest(ZBOOL setDefaultPIB);
//-------------------------------------------------------------------------------------------------------
// void mlmeRxEnableRequest(ZBOOL deferPermit, UINT32 rxOnTime, UINT32 rxOnDuration)
//
// DESCRIPTION:
// Enable the receiver for after a given timeout (in symbols), and turn it off after the given
// duration (also in symbols). An rxOnDuration = 0 will immediately shut down the receiver.
// Note: Do NOT use on beacon networks, set RX_ON_WHEN_IDLE to TRUE in stead
//
// PARAMETERS:
// ZBOOL deferPermit
// Reception can be deferred until the next superframe
// UINT32 rxOnTime
// The number of symbols to elapse before the receiver should be turned on
// UINT32 rxOnDuration
// The number of symbols to listen before turning the receiver off
//-------------------------------------------------------------------------------------------------------
void mlmeRxEnableRequest(ZBOOL deferPermit, UINT32 rxOnTime, UINT32 rxOnDuration);
//-------------------------------------------------------------------------------------------------------
// void mlmeRxEnableConfirm(MAC_ENUM status)
//
// DESCRIPTION:
// Callback generated by the MAC sublayer to the higher layer upon completion of a
// mlmeRxEnableRequest(...) call from the higher layer.
// Function must be implemented by the higher layer.
//
// PARAMETERS:
// MAC_ENUM status
// Status returned by the callback
// (SUCCESS | TX_ACTIVE | OUT_OF_CAP | INVALID_PARAMETER)
//-------------------------------------------------------------------------------------------------------
void mlmeRxEnableConfirm(MAC_ENUM status);
//-------------------------------------------------------------------------------------------------------
// MAC_ENUM mlmeScanRequest(BYTE scanType, DWORD scanChannels, UINT8 scanDuration)
//
// DESCRIPTION:
// Scan through the selected channels (energy, active, passive and orphan scanning supported).
// Important:
// - The maximum number of results returned for active and passive scans is
// defined by the MAC_OPT_MAX_PAN_DESCRIPTORS (>= 1) mac option
// - This function will not exit before the scan is completed.
//
// PARAMETERS:
// BYTE scanType
// ENERGY_SCAN, ACTIVE_SCAN, PASSIVE_SCAN or ORPHAN_SCAN
// DWORD scanChannels
// The channel index mask (0x07FFF800 are the legal values for 2.4 GHz channels)
// UINT8 scanDuration
// The scan duration defines the time spent scanning each channel, defined as:
// (aBaseSuperframeDuration * (2 ^^ scanDuration + 1)) symbol periods
// = (60 * 16 * (2^^scanDuration+1)) symbol periods
// E.g., scanning all 16 channels with Scanduration 5 takes 8.11 seconds
// MAC_SCAN_RESULT *pScanResult
// The pointer to the MAC_SCAN_RESULT struct (defined by the higher layer) where
// the MAC sublayer shall store the scan result.
//
// RETURN VALUE:
// MAC_ENUM
// INVALID_PARAMETER, SUCCESS or NO_BEACON
//-------------------------------------------------------------------------------------------------------
MAC_ENUM mlmeScanRequest(BYTE scanType, DWORD scanChannels, UINT8 scanDuration, MAC_SCAN_RESULT *pScanResult);
//-------------------------------------------------------------------------------------------------------
// MAC_ENUM mlmeSetRequest(MAC_PIB_ATTR pibAttribute, void *pPibAttributeValue)
//
// DESCRIPTION:
// Set MAC PIB attribute.
//
// PARAMETERS:
// MAC_PIB_ATTR pibAttribute
// The attribute to be changed
// void *pPibAttributeValue
// A pointer to the PIB attribute. Note that this data is _copied_ into the PIB.
//
// RETURN VALUE:
// MAC_ENUM
// INVALID_PARAMETER, SUCCESS or UNSUPPORTED_ATTRIBUTE
//-------------------------------------------------------------------------------------------------------
MAC_ENUM mlmeSetRequest(MAC_PIB_ATTR pibAttribute, void *pPibAttributeValue);
//-------------------------------------------------------------------------------------------------------
// MAC_ENUM mlmeStartRequest(WORD panId, UINT8 logicalChannel, UINT8 beaconOrder, UINT8 ...)
//
// DESCRIPTION:
// As a coordinator: Start or stop transmitting beacons.
//
// PARAMETERS:
// WORD panId
// The new PAN identifier
// UINT8 logicalChannel
// The channel to operate on (11-26)
// UINT8 beaconOrder
// The beacon order, which defines the beacon interval (0-14 for beacon PAN, 15 for non-beacon PAN)
// UINT8 superframeOrder
// The superframe order, which defines the superframe duration (that is the active period of the
// beacon interval). superframeOrder must be <= beaconOrder
// ZBOOL panCoordinator
// TRUE if this node should be the PAN coordinator
// ZBOOL batteryLifeExtension
// Enable battery life extension
// ZBOOL coordRealignment
// Transmit a coordinator realignment frame before making the changes
// ZBOOL securityEnable
// Security is enabled?
//
// RETURN VALUE:
// MAC_ENUM
// SUCCESS, NO_SHORT_ADDRESS or INVALID_PARAMETER
//-------------------------------------------------------------------------------------------------------
MAC_ENUM mlmeStartRequest(WORD panId, UINT8 logicalChannel, UINT8 beaconOrder, UINT8 superframeOrder, ZBOOL panCoordinator, ZBOOL batteryLifeExtension, ZBOOL coordRealignment, ZBOOL securityEnable);
//-------------------------------------------------------------------------------------------------------
// void mlmeSyncRequest(UINT8 logicalChannel, ZBOOL trackBeacon)
//
// DESCRIPTION:
// Switch to the selected channel, locate a single beacon, and start or stop tracking beacons
// (optional).
//
// PARAMETERS:
// UINT8 logicalChannel
// The channel to switch to.
// ZBOOL trackBeacon
// Track beacons if >0.
//-------------------------------------------------------------------------------------------------------
void mlmeSyncRequest(UINT8 logicalChannel, ZBOOL trackBeacon);
//-------------------------------------------------------------------------------------------------------
// void mlmeSyncLossIndication(MAC_ENUM lossReason)
//
// DESCRIPTION:
// Callback generated by the MAC sublayer to the higher layer indicating the loss of
// synchronization with a coordinator, PAN Id conflicts or realignment.
//
// Function must be implemented by the higher layer.
//
// PARAMETERS:
// MAC_ENUM status
// Status generated by the callback
// (PAN_ID_CONFLICT | REALIGNMENT | BEACON_LOST)
//-------------------------------------------------------------------------------------------------------
void mlmeSyncLossIndication(MAC_ENUM lossReason);
//----------------------------------------------------------------------------------------------------------
#endif
/*******************************************************************************************************
* Revision history:
*
* $Log: mac.h,v $
* Revision 1.15 2005/03/01 12:43:02 thl
* Inn CC2420_RXCTRL1 the RXBPF_LOCUR is now enabled,
* result is about 1,2-1,5mA reduction in RX current for the chip.
*
* Revision 1.14 2005/02/03 15:02:58 thl
* added pib attribute MAC_ASSOCIATED_PAN_CORDINATOR.
* used to disable/enable pan conflict message.
*
* Revision 1.13 2005/01/05 10:45:19 thl
* Added full suport for ppib.phyTransmitPower, will also now adjust the transmit power
* of the radio chip. to include set compile switch MAC_OPT_TRANSMIT_POWER=1 in
* make file.
*
* Revision 1.12 2004/12/07 09:48:00 thl
* Fixed potential coruption of memmory when max payload is recived.
*
* Revision 1.11 2004/08/13 13:04:42 jol
* CC2420 MAC Release v0.7
*
*
*******************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -