#include <plc-csmaca.h>
Public Member Functions | |
void | setSlottedCsmaCa (void) |
void | setUnSlottedCsmaCa (void) |
bool | isSlottedCsmaCa (void) const |
bool | isUnSlottedCsmaCa (void) const |
void | setMacMinBE (uint8_t macMinBE) |
uint8_t | getMacMinBE (void) const |
void | setMacMaxBE (uint8_t macMaxBE) |
uint8_t | getMacMaxBE (void) const |
void | setmacMaxCSMABackoffs (uint8_t macMaxCSMABackoffs) |
uint8_t | getmacMaxCSMABackoffs (void) const |
void | setUnitBackoffPeriod (uint64_t unitBackoffPeriod) |
uint64_t | getUnitBackoffPeriod (void) const |
uint64_t | getTimeToNextSlot (void) const |
void | Start (void) |
void | Cancel () |
void | RandomBackoffDelay () |
void | CanProceed () |
void | RequestCCA () |
void | CcaConfirm (PLC_PhyCcaResult status) |
void | SetCcaRequestCallback (PLC_CsmaCaCcaRequestCallback c) |
void | SetCcaCancelCallback (PLC_CsmaCaCcaCancelCallback c) |
void | SetCsmaCaMacCallback (PLC_CsmaCaMacCallback c) |
bool | IsActive (void) |
Static Public Member Functions | |
static TypeId | GetTypeId () |
This class is a helper for the PLC_Mac to manage the Csma/CA state machine.
void ns3::PLC_CsmaCa::CcaConfirm | ( | PLC_PhyCcaResult | status | ) |
IEEE 802.15.4-2006 section 6.2.2.2 PLME-CCA.confirm status
status | TRX_OFF, BUSY or IDLE |
When Phy has completed CCA, it calls back here which in turn execute the final steps of the CSMA-CA algorithm. It checks to see if the Channel is idle, if so check the Contention window before permitting transmission (step 5). If channel is busy, either backoff and perform CCA again or treat as channel access failure (step 4).
void ns3::PLC_CsmaCa::SetCsmaCaMacCallback | ( | PLC_CsmaCaMacCallback | c | ) |
set the callback function. Used at the end of a Channel Assessment, as part of the interconnections between the CSMA-CA and the MAC. The callback lets MAc know a channel is either idle or busy