
Primitives
Simple Media Access Controller (SMAC) for the HCS08 Reference Manual, Rev. 2.0
Freescale Semiconductor
3-17
Prototype
smacErrors_t MLMEScanRequest(uint16_t u16ChannelsToScan, scanModes_t, uint8_t
*pu8ChannelScan);
Arguments
u16ChannelsToScan
Bitmap of the Channels to be scanned. Any bit set to “1” corresponds to selected channel from Channel
11 to Channel 26.
scanModes_t
Determines scan mode to be used; gScanModeCCA_c or gScanModeED_c.
uint8_t *pu8ChannelScan
Pointer to 16-byte buffer where the scan results will be returned.
Returns
gErrorNoError_c
No errors.
gErrorOutOfRange_c If there are no channels to scan in the bitmap, no valid technique passed or null
pointer passed.
gErrorBusy_c
When SMAC is busy in other radio activity like transmitting/receiving data or
performing a channel scan, among others.
gErrorNoValidCondition_c If SMAC was not initialized.
Usage
Call this function to initiate an energy scan with the selected technique and a buffer of 16 elements.
•
When gScanModeCCA_c is used, a CCA 802.15.4 scan is performed. CCA Mode 1 is
implemented by default, which means that it only checks for energy above a threshold. The default
CCA Threshold is 0x80. This threshold is initialized at PHY level. CCA returns FALSE if the
channel was found idle and TRUE if the channel was busy.
•
For gScanModeED_c the individual channel energy is observed. In ED Scan Mode, the output
results are the same format as the MLMEEnergyDetect function and are stored in each byte of the
output buffer from channel 11 to 26.
Channels that are not scanned have no returned entry in the buffer.
3.1.23
MLMESetPromiscuousMode
SMAC appends 0xFF7E as the first two bytes of the packet to identify its own non-standard packets from
other IEE802.15.4 Standard MAC packets in the same PHY layer. When promiscuous mode is off, SMAC
filters the received packets and just allows/reports those beginning with 0xFF7E; when promiscuous mode
is on SMAC lets all messages pass, whether beginning with 0xFF7E or not. MLMESetPromiscuousMode
function allows enabling or clearing the promiscuous mode.