sidnet.stack.std.mac.ieee802_15_4
Class Mac802_15_4Impl

java.lang.Object
  extended by sidnet.stack.std.mac.ieee802_15_4.Mac802_15_4Impl
All Implemented Interfaces:
JistAPI.Proxiable, JistAPI.Timeless, MacInterface, Mac802_15_4

public class Mac802_15_4Impl
extends java.lang.Object
implements Mac802_15_4


Nested Class Summary
 
Nested classes/interfaces inherited from interface jist.swans.mac.MacInterface
MacInterface.Mac802_11
 
Field Summary
static boolean ack4data
           
 byte backoffStatus
           
 TimerInterface802_15_4 bcnRxT
           
 byte beaconPeriods
           
 byte beaconPeriods2
           
static byte callBack
           
 DevCapability capability
           
static int DBG_UID
           
 sidnet.stack.std.mac.ieee802_15_4.DEVICELINK deviceLink1
           
 sidnet.stack.std.mac.ieee802_15_4.DEVICELINK deviceLink2
           
 MacAddress localAddr
          mac address of this interface.
static byte macBackoffBoundType
           
 double macBcnOtherRxTime
           
 double macBcnRxTime
           
 double macBcnTxTime
           
 byte macBeaconOrder2
           
 byte macBeaconOrder3
           
static byte macIFSHType
           
static byte macTxBcnCmdDataHType
           
 sidnet.stack.std.mac.ieee802_15_4.MAC_PIB mpib
           
 PAN_ELE panDes
           
 PAN_ELE panDes2
           
 Phy802_15_4 phyEntity
          Physical downcall entity interface.
 MacMessage_802_15_4 rxBeacon
           
 sidnet.stack.std.mac.ieee802_15_4.SuperframeSpec sfSpec
           
 sidnet.stack.std.mac.ieee802_15_4.SuperframeSpec sfSpec2
           
 sidnet.stack.std.mac.ieee802_15_4.SuperframeSpec sfSpec3
           
 sidnet.stack.std.mac.ieee802_15_4.taskPending taskP
           
 PHY_PIB tmp_ppib
           
 MacMessage_802_15_4 txAck
           
static byte TxOp_Acked
           
static byte TxOp_GTS
           
static byte TxOp_Indirect
           
static byte TxOp_SecEnabled
           
static byte txOption
           
static boolean verbose
          NS-2
 
Constructor Summary
Mac802_15_4Impl(MacAddress addr, RadioInfo.RadioInfoShared radioInfo, EnergyManagement energyManagement, Node myNode)
           
Mac802_15_4Impl(MacAddress addr, RadioInfo.RadioInfoShared radioInfo, EnergyManagement energyManagement, Node myNode, sidnet.stack.std.mac.ieee802_15_4.MAC_PIB mp)
           
 
Method Summary
 void assoRspWaitHandler()
           
 void backoffBoundHandler()
           
 void beaconRxHandler()
           
 void beaconSearchHandler()
           
 void beaconTxHandler(boolean forTX)
           
 boolean canProceedWOcsmaca(MacMessage_802_15_4 p)
           
 void csmaca_backoffHandler()
           
 void csmaca_bcnOtherHandler()
           
 void csmaca_deferCCAHandler()
           
 void csmacaCallBack(PHYenum status)
           
 void dataWaitHandler()
           
 void drop(MacMessage_802_15_4 p, java.lang.String reason)
           
 void extractHandler()
           
 byte get_sfSpec2_FinCAP()
           
 int get_sfSpec2_sd()
           
 int getBattLifeExtSlotNum()
           
 double getCAP(boolean small)
           
 double getCAPbyType(int type)
           
 double getMacBcnRxTime()
           
 byte getMacBeaconOrder2()
           
 byte getMpibMacBeaconOrder()
           
 Mac802_15_4 getProxy()
          Return proxy entity of this mac.
 int hdr_dst(char[] hdr, int dst)
           
 int hdr_dst(hdr_mac hdr, int dst)
           
 int hdr_src(char[] hdr, int src)
           
 int hdr_src(hdr_mac hdr, int src)
           
 int hdr_type(char[] hdr, int type)
           
 int hdr_type(hdr_mac hdr, int type)
           
 void IFSHandler()
           
 void init(boolean reset)
           
 void isPanCoor(boolean isPC)
           
 double locateBoundary(boolean parent, double wtime)
           
 void MCPS_DATA_indication(byte SrcAddrMode, int SrcPANId, int SrcAddr, byte DstAddrMode, int DstPANId, int DstAddr, byte msduLength, MacMessage_802_15_4 msdu, byte mpduLinkQuality, boolean SecurityUse, byte ACLEntry)
           
 void MCPS_DATA_request(byte SrcAddrMode, int SrcPANId, int SrcAddr, byte DstAddrMode, int DstPANId, int DstAddr, byte msduLength, MacMessage_802_15_4 msdu, byte msduHandle, byte TxOptions)
           
 void MCPS_PURGE_request(byte msduHandle)
           
 void MLME_ASSOCIATE_request(byte LogicalChannel, byte CoordAddrMode, int CoordPANId, int CoordAddress, byte CapabilityInformation, boolean SecurityEnable)
           
 void MLME_ASSOCIATE_response(int DeviceAddress, int AssocShortAddress, MACenum status, boolean SecurityEnable)
           
 void MLME_DISASSOCIATE_indication(int DeviceAddress, byte DisassociateReason, boolean SecurityUse, byte ACLEntry)
           
 void MLME_DISASSOCIATE_request(IE3ADDR DeviceAddress, byte DisassociateReason, boolean SecurityEnable)
           
 void MLME_GET_request(MPIBAenum PIBAttribute)
           
 void MLME_GTS_confirm(byte GTSCharacteristics, MACenum status)
           
 void MLME_GTS_indication(int DevAddress, byte GTSCharacteristics, boolean SecurityUse, byte ACLEntry)
           
 void MLME_GTS_request(byte GTSCharacteristics, boolean SecurityEnable)
           
 void MLME_ORPHAN_response(int OrphanAddress, int ShortAddress, boolean AssociatedMember, boolean SecurityEnable)
           
 void MLME_POLL_request(byte CoordAddrMode, int CoordPANId, int CoordAddress, boolean SecurityEnable)
           
 void MLME_RESET_request(boolean SetDefaultPIB)
           
 void MLME_RX_ENABLE_request(boolean DeferPermit, int RxOnTime, int RxOnDuration)
           
 void MLME_SCAN_request(byte ScanType, int ScanChannels, byte ScanDuration)
           
 void MLME_SET_request(MPIBAenum PIBAttribute, sidnet.stack.std.mac.ieee802_15_4.MAC_PIB PIBAttributeValue)
           
 void MLME_START_request(int PANId, byte LogicalChannel, byte BeaconOrder, byte SuperframeOrder, boolean PANCoordinator, boolean BatteryLifeExtension, boolean CoordRealignment, boolean SecurityEnable)
           
 void MLME_SYNC_request(byte LogicalChannel, boolean TrackBeacon)
           
 int p802_15_4hdr_dst(hdr_mac hdr, int dst)
           
 int p802_15_4hdr_src(hdr_mac hdr, int src)
           
 int p802_15_4hdr_type(hdr_mac hdr, int type)
           
 void PD_DATA_confirm(PHYenum status)
           
 void peek(Message msg)
          Radio has locked onto a packet signal; mac may have a peek.
 void PLME_CCA_confirm(PHYenum status)
           
 void PLME_ED_confirm(PHYenum status, byte EnergyLevel)
           
 void PLME_GET_confirm(PHYenum status, PPIBAenum PIBAttribute, PHY_PIB PIBAttributeValue)
           
 void PLME_SET_confirm(PHYenum status, PPIBAenum PIBAttribute)
           
 void PLME_SET_TRX_STATE_confirm(PHYenum status)
           
 void plme_set_trx_state_request(PHYenum state)
           
 void receive(Message m)
          Radio has received a packet for mac to process.
 void recv(MacMessage_802_15_4 p)
           
 void recvAck(MacMessage_802_15_4 p)
           
 void recvBeacon(MacMessage_802_15_4 p)
           
 void recvCommand(MacMessage_802_15_4 p)
           
 void recvData(MacMessage_802_15_4 p)
           
 void reset()
           
 void resetTimers()
           
 void resetTRX()
           
 void rxEnableHandler()
           
 void scanHandler()
           
 void send(Message msg, MacAddress nextHop)
          Network layer would like to send the following packet.
 void sendUp(MacMessage_802_15_4 msg)
           
 void setNetEntity(NetInterface net, byte netid)
          Hook up with the network entity.
 void setPhyEntity(Phy802_15_4 phy)
          Hook down with the Physical entity.
 void setRadioMode(byte mode)
          Update mac regarding new mode of its radio.
 boolean sscs_neverAsso()
           
 void startDevice()
           
 boolean toParent(MacMessage_802_15_4 p)
           
 void txBcnCmdDataHandler()
           
 void txHandler()
           
 void txOverHandler()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TxOp_Acked

public static final byte TxOp_Acked
See Also:
Constant Field Values

TxOp_GTS

public static final byte TxOp_GTS
See Also:
Constant Field Values

TxOp_Indirect

public static final byte TxOp_Indirect
See Also:
Constant Field Values

TxOp_SecEnabled

public static final byte TxOp_SecEnabled
See Also:
Constant Field Values

macTxBcnCmdDataHType

public static final byte macTxBcnCmdDataHType
See Also:
Constant Field Values

macIFSHType

public static final byte macIFSHType
See Also:
Constant Field Values

macBackoffBoundType

public static final byte macBackoffBoundType
See Also:
Constant Field Values

localAddr

public MacAddress localAddr
mac address of this interface.


verbose

public static boolean verbose
NS-2


txOption

public static byte txOption

ack4data

public static boolean ack4data

callBack

public static byte callBack

DBG_UID

public static int DBG_UID

taskP

public sidnet.stack.std.mac.ieee802_15_4.taskPending taskP

mpib

public sidnet.stack.std.mac.ieee802_15_4.MAC_PIB mpib

tmp_ppib

public PHY_PIB tmp_ppib

capability

public DevCapability capability

sfSpec

public sidnet.stack.std.mac.ieee802_15_4.SuperframeSpec sfSpec

sfSpec2

public sidnet.stack.std.mac.ieee802_15_4.SuperframeSpec sfSpec2

sfSpec3

public sidnet.stack.std.mac.ieee802_15_4.SuperframeSpec sfSpec3

beaconPeriods

public byte beaconPeriods

beaconPeriods2

public byte beaconPeriods2

panDes

public PAN_ELE panDes

panDes2

public PAN_ELE panDes2

rxBeacon

public MacMessage_802_15_4 rxBeacon

macBcnTxTime

public double macBcnTxTime

macBcnRxTime

public double macBcnRxTime

macBcnOtherRxTime

public double macBcnOtherRxTime

macBeaconOrder2

public byte macBeaconOrder2

macBeaconOrder3

public byte macBeaconOrder3

deviceLink1

public sidnet.stack.std.mac.ieee802_15_4.DEVICELINK deviceLink1

deviceLink2

public sidnet.stack.std.mac.ieee802_15_4.DEVICELINK deviceLink2

bcnRxT

public TimerInterface802_15_4 bcnRxT

txAck

public MacMessage_802_15_4 txAck

backoffStatus

public byte backoffStatus

phyEntity

public Phy802_15_4 phyEntity
Physical downcall entity interface.

Constructor Detail

Mac802_15_4Impl

public Mac802_15_4Impl(MacAddress addr,
                       RadioInfo.RadioInfoShared radioInfo,
                       EnergyManagement energyManagement,
                       Node myNode)

Mac802_15_4Impl

public Mac802_15_4Impl(MacAddress addr,
                       RadioInfo.RadioInfoShared radioInfo,
                       EnergyManagement energyManagement,
                       Node myNode,
                       sidnet.stack.std.mac.ieee802_15_4.MAC_PIB mp)
Method Detail

setNetEntity

public void setNetEntity(NetInterface net,
                         byte netid)
Hook up with the network entity.

Parameters:
net - network entity
netid - network interface number

get_sfSpec2_sd

public int get_sfSpec2_sd()
                   throws JistAPI.Continuation
Specified by:
get_sfSpec2_sd in interface Mac802_15_4
Throws:
JistAPI.Continuation

get_sfSpec2_FinCAP

public byte get_sfSpec2_FinCAP()
                        throws JistAPI.Continuation
Specified by:
get_sfSpec2_FinCAP in interface Mac802_15_4
Throws:
JistAPI.Continuation

getMacBeaconOrder2

public byte getMacBeaconOrder2()
                        throws JistAPI.Continuation
Specified by:
getMacBeaconOrder2 in interface Mac802_15_4
Throws:
JistAPI.Continuation

getMacBcnRxTime

public double getMacBcnRxTime()
                       throws JistAPI.Continuation
Specified by:
getMacBcnRxTime in interface Mac802_15_4
Throws:
JistAPI.Continuation

getMpibMacBeaconOrder

public byte getMpibMacBeaconOrder()
                           throws JistAPI.Continuation
Specified by:
getMpibMacBeaconOrder in interface Mac802_15_4
Throws:
JistAPI.Continuation

sscs_neverAsso

public boolean sscs_neverAsso()
                       throws JistAPI.Continuation
Specified by:
sscs_neverAsso in interface Mac802_15_4
Throws:
JistAPI.Continuation

startDevice

public void startDevice()
Specified by:
startDevice in interface Mac802_15_4

getProxy

public Mac802_15_4 getProxy()
Return proxy entity of this mac.

Returns:
self-referencing proxy entity.

setPhyEntity

public void setPhyEntity(Phy802_15_4 phy)
Hook down with the Physical entity.

Parameters:
phy - physical entity

reset

public void reset()

resetTimers

public void resetTimers()

csmaca_backoffHandler

public void csmaca_backoffHandler()
Specified by:
csmaca_backoffHandler in interface Mac802_15_4

csmaca_bcnOtherHandler

public void csmaca_bcnOtherHandler()
Specified by:
csmaca_bcnOtherHandler in interface Mac802_15_4

csmaca_deferCCAHandler

public void csmaca_deferCCAHandler()
Specified by:
csmaca_deferCCAHandler in interface Mac802_15_4

init

public void init(boolean reset)

PD_DATA_confirm

public void PD_DATA_confirm(PHYenum status)
Specified by:
PD_DATA_confirm in interface Mac802_15_4

PLME_CCA_confirm

public void PLME_CCA_confirm(PHYenum status)
Specified by:
PLME_CCA_confirm in interface Mac802_15_4

PLME_ED_confirm

public void PLME_ED_confirm(PHYenum status,
                            byte EnergyLevel)
Specified by:
PLME_ED_confirm in interface Mac802_15_4

PLME_GET_confirm

public void PLME_GET_confirm(PHYenum status,
                             PPIBAenum PIBAttribute,
                             PHY_PIB PIBAttributeValue)
Specified by:
PLME_GET_confirm in interface Mac802_15_4

PLME_SET_TRX_STATE_confirm

public void PLME_SET_TRX_STATE_confirm(PHYenum status)
Specified by:
PLME_SET_TRX_STATE_confirm in interface Mac802_15_4

PLME_SET_confirm

public void PLME_SET_confirm(PHYenum status,
                             PPIBAenum PIBAttribute)
Specified by:
PLME_SET_confirm in interface Mac802_15_4

MCPS_DATA_request

public void MCPS_DATA_request(byte SrcAddrMode,
                              int SrcPANId,
                              int SrcAddr,
                              byte DstAddrMode,
                              int DstPANId,
                              int DstAddr,
                              byte msduLength,
                              MacMessage_802_15_4 msdu,
                              byte msduHandle,
                              byte TxOptions)

MCPS_DATA_indication

public void MCPS_DATA_indication(byte SrcAddrMode,
                                 int SrcPANId,
                                 int SrcAddr,
                                 byte DstAddrMode,
                                 int DstPANId,
                                 int DstAddr,
                                 byte msduLength,
                                 MacMessage_802_15_4 msdu,
                                 byte mpduLinkQuality,
                                 boolean SecurityUse,
                                 byte ACLEntry)

sendUp

public void sendUp(MacMessage_802_15_4 msg)

MCPS_PURGE_request

public void MCPS_PURGE_request(byte msduHandle)

MLME_ASSOCIATE_request

public void MLME_ASSOCIATE_request(byte LogicalChannel,
                                   byte CoordAddrMode,
                                   int CoordPANId,
                                   int CoordAddress,
                                   byte CapabilityInformation,
                                   boolean SecurityEnable)

MLME_ASSOCIATE_response

public void MLME_ASSOCIATE_response(int DeviceAddress,
                                    int AssocShortAddress,
                                    MACenum status,
                                    boolean SecurityEnable)

MLME_DISASSOCIATE_request

public void MLME_DISASSOCIATE_request(IE3ADDR DeviceAddress,
                                      byte DisassociateReason,
                                      boolean SecurityEnable)

MLME_DISASSOCIATE_indication

public void MLME_DISASSOCIATE_indication(int DeviceAddress,
                                         byte DisassociateReason,
                                         boolean SecurityUse,
                                         byte ACLEntry)

MLME_GET_request

public void MLME_GET_request(MPIBAenum PIBAttribute)

MLME_GTS_request

public void MLME_GTS_request(byte GTSCharacteristics,
                             boolean SecurityEnable)

MLME_GTS_confirm

public void MLME_GTS_confirm(byte GTSCharacteristics,
                             MACenum status)

MLME_GTS_indication

public void MLME_GTS_indication(int DevAddress,
                                byte GTSCharacteristics,
                                boolean SecurityUse,
                                byte ACLEntry)

MLME_ORPHAN_response

public void MLME_ORPHAN_response(int OrphanAddress,
                                 int ShortAddress,
                                 boolean AssociatedMember,
                                 boolean SecurityEnable)

MLME_RESET_request

public void MLME_RESET_request(boolean SetDefaultPIB)

MLME_RX_ENABLE_request

public void MLME_RX_ENABLE_request(boolean DeferPermit,
                                   int RxOnTime,
                                   int RxOnDuration)

MLME_SCAN_request

public void MLME_SCAN_request(byte ScanType,
                              int ScanChannels,
                              byte ScanDuration)

MLME_SET_request

public void MLME_SET_request(MPIBAenum PIBAttribute,
                             sidnet.stack.std.mac.ieee802_15_4.MAC_PIB PIBAttributeValue)

MLME_START_request

public void MLME_START_request(int PANId,
                               byte LogicalChannel,
                               byte BeaconOrder,
                               byte SuperframeOrder,
                               boolean PANCoordinator,
                               boolean BatteryLifeExtension,
                               boolean CoordRealignment,
                               boolean SecurityEnable)

MLME_SYNC_request

public void MLME_SYNC_request(byte LogicalChannel,
                              boolean TrackBeacon)

MLME_POLL_request

public void MLME_POLL_request(byte CoordAddrMode,
                              int CoordPANId,
                              int CoordAddress,
                              boolean SecurityEnable)

hdr_dst

public int hdr_dst(char[] hdr,
                   int dst)

hdr_src

public int hdr_src(char[] hdr,
                   int src)

hdr_type

public int hdr_type(char[] hdr,
                    int type)

setRadioMode

public void setRadioMode(byte mode)
Description copied from interface: MacInterface
Update mac regarding new mode of its radio.

Specified by:
setRadioMode in interface MacInterface
Parameters:
mode - new radio mode

send

public void send(Message msg,
                 MacAddress nextHop)
Description copied from interface: MacInterface
Network layer would like to send the following packet. Should be called only after Mac has notified that it is wants a packet.

Specified by:
send in interface MacInterface
Parameters:
msg - packet to send
nextHop - destination mac

peek

public void peek(Message msg)
Description copied from interface: MacInterface
Radio has locked onto a packet signal; mac may have a peek.

Specified by:
peek in interface MacInterface
Parameters:
msg - packet currently in flight

receive

public void receive(Message m)
Description copied from interface: MacInterface
Radio has received a packet for mac to process.

Specified by:
receive in interface MacInterface
Specified by:
receive in interface Mac802_15_4
Parameters:
m - packet received

recv

public void recv(MacMessage_802_15_4 p)

drop

public void drop(MacMessage_802_15_4 p,
                 java.lang.String reason)
Specified by:
drop in interface Mac802_15_4

recvBeacon

public void recvBeacon(MacMessage_802_15_4 p)

recvAck

public void recvAck(MacMessage_802_15_4 p)

recvCommand

public void recvCommand(MacMessage_802_15_4 p)

recvData

public void recvData(MacMessage_802_15_4 p)

toParent

public boolean toParent(MacMessage_802_15_4 p)

locateBoundary

public double locateBoundary(boolean parent,
                             double wtime)

txOverHandler

public void txOverHandler()
Specified by:
txOverHandler in interface Mac802_15_4

txHandler

public void txHandler()
Specified by:
txHandler in interface Mac802_15_4

extractHandler

public void extractHandler()
Specified by:
extractHandler in interface Mac802_15_4

assoRspWaitHandler

public void assoRspWaitHandler()
Specified by:
assoRspWaitHandler in interface Mac802_15_4

dataWaitHandler

public void dataWaitHandler()
Specified by:
dataWaitHandler in interface Mac802_15_4

rxEnableHandler

public void rxEnableHandler()
Specified by:
rxEnableHandler in interface Mac802_15_4

scanHandler

public void scanHandler()
Specified by:
scanHandler in interface Mac802_15_4

beaconTxHandler

public void beaconTxHandler(boolean forTX)
Specified by:
beaconTxHandler in interface Mac802_15_4

beaconRxHandler

public void beaconRxHandler()
Specified by:
beaconRxHandler in interface Mac802_15_4

beaconSearchHandler

public void beaconSearchHandler()
Specified by:
beaconSearchHandler in interface Mac802_15_4

isPanCoor

public void isPanCoor(boolean isPC)

csmacaCallBack

public void csmacaCallBack(PHYenum status)

getBattLifeExtSlotNum

public int getBattLifeExtSlotNum()

getCAP

public double getCAP(boolean small)

getCAPbyType

public double getCAPbyType(int type)

canProceedWOcsmaca

public boolean canProceedWOcsmaca(MacMessage_802_15_4 p)

hdr_dst

public int hdr_dst(hdr_mac hdr,
                   int dst)

p802_15_4hdr_dst

public int p802_15_4hdr_dst(hdr_mac hdr,
                            int dst)

hdr_src

public int hdr_src(hdr_mac hdr,
                   int src)

p802_15_4hdr_src

public int p802_15_4hdr_src(hdr_mac hdr,
                            int src)

hdr_type

public int hdr_type(hdr_mac hdr,
                    int type)

p802_15_4hdr_type

public int p802_15_4hdr_type(hdr_mac hdr,
                             int type)

txBcnCmdDataHandler

public void txBcnCmdDataHandler()
Specified by:
txBcnCmdDataHandler in interface Mac802_15_4

IFSHandler

public void IFSHandler()
Specified by:
IFSHandler in interface Mac802_15_4

backoffBoundHandler

public void backoffBoundHandler()
Specified by:
backoffBoundHandler in interface Mac802_15_4

plme_set_trx_state_request

public void plme_set_trx_state_request(PHYenum state)

resetTRX

public void resetTRX()