The Freescale MCR20A Simple Media Access Controller (MCR20A SMAC) is a simple ANSI C based codebase available as sample source code. The MCR20A SMAC is used for developing proprietary RF transceiver applications using Freescale’s MCR20A 2.4 GHz transceiver 

Fork of fsl_smac by Freescale

The MCR20A SMAC is a small codebase that provides simple communication and test applications based on drivers, (802.15.4 compliant) PHY, and framework utilities available as source code. This environment is useful for hardware and RF debug, hardware standards certification, and developing proprietary applications. The MCR20A SMAC is provided as part of the Example Application Demos available for MCR20A and also as a standalone set of files.

SMAC features include:

  • Compact footprint.
  • Very low power, proprietary, bidirectional RF communication link.
  • The MCR20A radio allows packet filtering by hardware by checking the preamble and the synchronization word, which reduces software overhead and memory footprint.
  • Broadcast communication.
  • Unicast communication — MCR20A SMAC includes a Node Address 16-bit field. This allows SMAC to perform unicast transmissions. To change the address of a node, modify this constant: gNodeAddress_c inside the SMAC_Config.h file, or call SMACSetShortSrcAddress(uint16_t nwShortAddress). The address is set to 0xBEAD by default. Some of the Demo Applications allow the user to change this address at runtime.
  • Change of current PAN. The SMAC packet uses a short 802.15.4 compliant header with a hard-coded configuration for frame control which allows the user to switch between PANs. The PAN address has also 16 bits (gDefaultPanID_c). This address can be modified by changing the default value from SMAC_Config.h file or by calling SMACSetPanID(uint16_t nwShortPanID.
  • There are no blocking functions within the MCR20A SMAC.
  • Easy-to-use sample applications included.
  • Light-weight, custom LBT algorithm.
  • Light-weight, custom, AA mechanism which is transparent to the user after enabling the feature.
  • Encryption using Advanced Encryption Standard in Cipher Block Chaining mode with configurable initial vector and key.
  • Configurable number of retries and backoff interval.
  • Inter-layer communication using SAPs.
  • The MCR20A SMAC also filters packets that have correct addressing information (pass address filtering) but are not in the expected format (short addressing, no security, data frame).

Documentation

SMAC Reference Manual

Revision:
0:401ba973869e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SMAC_Interface.h	Tue Aug 18 12:48:33 2015 +0000
@@ -0,0 +1,729 @@
+/**************************************************************************************************
+* SMAC Interface header file
+* 
+* Freescale Semiconductor Inc.
+* (c) Copyright 2004-2014 Freescale Semiconductor, Inc.
+* ALL RIGHTS RESERVED.
+*
+***************************************************************************************************
+*
+* THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESSED OR 
+* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
+* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  
+* IN NO EVENT SHALL FREESCALE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
+* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
+* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
+* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
+* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
+* THE POSSIBILITY OF SUCH DAMAGE.
+*
+***********************************************************************************************//*!
+**************************************************************************************************/
+
+#ifndef SMAC_INTERFACE_H_
+#define SMAC_INTERFACE_H_
+
+/************************************************************************************
+*************************************************************************************
+* Includes
+*************************************************************************************
+************************************************************************************/
+#include "EmbeddedTypes.h"   
+#include "PhyTypes.h"
+/************************************************************************************
+*************************************************************************************
+* Interface macro definitions 
+*************************************************************************************
+************************************************************************************/
+
+#define gSmacHeaderBytes_c         ( sizeof(smacHeader_t) )
+#define gMaxSmacSDULength_c        (gMaxPHYPacketSize_c -(sizeof(smacHeader_t) + 2) )
+#define gMinSmacSDULength_c        (0)
+
+#define gBroadcastAddress_c        (0xFFFF)
+#define gSmacDefaultFrameCtrl          (0x8841)
+#define gSmacDefaultSeqNo              (0xAB)
+/************************************************************************************
+*************************************************************************************
+* Public memory declarations
+*************************************************************************************
+************************************************************************************/
+// extern bool_t smacStandalone;          
+extern uint8_t gTotalChannels;
+
+/************************************************************************************
+*************************************************************************************
+* Interface Type definitions
+*************************************************************************************
+************************************************************************************/
+
+typedef enum smacMessageDefs_tag 
+{
+  gMcpsDataReq_c,
+  gMcpsDataCnf_c,
+  gMcpsDataInd_c,
+  
+  gMcpsIndQueueInsertReq_c,
+  gMcpsIndQueueInsertCnf_c,
+  gMcpsIndQueueRemoveReq_c,
+  
+  gMlmeCcaReq_c,
+  gMlmeCcaCnf_c,
+  
+  gMlmeEdReq_c,
+  gMlmeEdCnf_c,
+  
+  gMlmeSetTRxStateReq_c,
+  gMlmeSetTRxStateCnf_c,
+  
+  gMlmeSetReq_c,
+  gMlmeSetCnf_c,
+  
+  gMlmeGetReq_c,
+  gMlmeGetCnf_c,
+  
+  gMlmeTimeoutInd_c,
+  
+  gMlme_StartEventInd_c,
+  gMlme_SyncLossInd_c,
+  gMlme_RxSfdDetectInd_c,
+  gMlme_FilterFailInd_c,
+  gMlme_UnexpectedRadioResetInd_c,
+}smacMessageDefs_t;
+
+typedef uint64_t smacTime_t;
+
+typedef struct smacPdu_tag
+{
+  uint8_t smacPdu[1];
+}smacPdu_t;
+
+typedef PACKED_STRUCT smacHeader_tag
+{
+  uint16_t frameControl;
+  uint8_t seqNo;
+  uint16_t       panId;
+  uint16_t       destAddr;
+  uint16_t       srcAddr;
+}smacHeader_t;
+
+typedef struct txPacket_tag
+{
+  uint8_t u8DataLength;
+  smacHeader_t smacHeader;
+  smacPdu_t smacPdu;
+}txPacket_t;
+
+typedef struct txContextConfig_tag
+{
+  bool_t ccaBeforeTx;
+  bool_t autoAck;
+  uint8_t retryCountCCAFail;
+  uint8_t retryCountAckFail;
+}txContextConfig_t;
+
+typedef enum rxStatus_tag
+{
+  rxInitStatus,
+  rxProcessingReceptionStatus_c,
+  rxSuccessStatus_c, 
+  rxTimeOutStatus_c,
+  rxAbortedStatus_c,
+  rxMaxStatus_c
+} rxStatus_t;
+
+typedef struct rxPacket_tag
+{
+  uint8_t    u8MaxDataLength;
+  rxStatus_t rxStatus;
+  uint8_t    u8DataLength;
+  smacHeader_t smacHeader;
+  smacPdu_t  smacPdu;
+}rxPacket_t;
+
+typedef enum txStatus_tag
+{
+  txSuccessStatus_c, 
+  txFailureStatus_c,
+  txMaxStatus_c
+} txStatus_t;
+
+typedef enum smacErrors_tag
+{
+  gErrorNoError_c = 0,
+  gErrorBusy_c,
+  gErrorChannelBusy_c,
+  gErrorNoAck_c,
+  gErrorOutOfRange_c,
+  gErrorNoResourcesAvailable_c,
+  gErrorNoValidCondition_c,
+  gErrorCorrupted_c,
+  gErrorMaxError_c
+} smacErrors_t;
+
+#if defined (gPHY_802_15_4g_d)
+
+typedef enum smacRFModes_tag
+{
+  gRFMode1_c = gPhyMode1_c,
+  gRFMode2_c = gPhyMode2_c,
+  gRFMode3_c = gPhyMode3_c,
+  gRFMode4_c = gPhyMode4_c,
+  gRFMode5_c = gPhyMode1ARIB_c, /*ARIB mode 1*/
+  gRFMode6_c = gPhyMode2ARIB_c, /*ARIB mode 2*/
+  gRFMaxMode_c
+} smacRFModes_t;
+
+typedef enum smacFrequencyBands_tag
+{
+  gSMAC_863_870MHz_c = gFreq863__870MHz_c, /* 863-870   (Europe) */ 
+  gSMAC_902_928MHz_c = gFreq902__928MHz_c, /* 902-928   (US)     */ 
+  gSMAC_920_928MHz_c = gFreq920__928MHz_c, /* 920-928 (Japan)    */
+  gSMAC_169_400__169_475MHz_c = gFreq169_400__169_475MHz_c /* 169-475 */
+}smacFrequencyBands_t;
+
+#endif
+typedef struct smacPacket_tag
+{
+  uint8_t u8SyncWordSize;
+  uint8_t *u8SyncWordValue;
+  uint16_t u16PreambleLength;
+}smacPacket_t;
+
+typedef enum scanModes_tag 
+{ 
+  gScanModeCCA_c = 0, 
+  gScanModeED_c,
+  gMaxScanMode_c 
+} scanModes_t;
+
+#if defined (gPHY_802_15_4g_d)
+
+typedef struct packetConfig_tag
+{   
+  uint16_t u16PreambleSize;
+  uint8_t u8SyncWordSize;
+  uint8_t *pu8SyncWord;
+} packetConfig_t;
+
+#endif
+
+/*@CMA, Connectivity Test_Start*/
+typedef enum channels_tag
+{
+#include "SMAC_Channels.h"
+} channels_t;
+
+typedef enum smacTestMode_tag  
+{
+  gTestModeForceIdle_c = 0,
+  gTestModeContinuousTxModulated_c,
+  gTestModeContinuousTxUnmodulated_c,
+  gTestModePRBS9_c,
+  gTestModeContinuousRxBER_c,
+  gMaxTestMode_c
+} smacTestMode_t;
+
+typedef  struct smacDataCnf_tag
+{
+  smacErrors_t         status;
+} smacDataCnf_t;
+
+typedef  struct smacDataInd_tag
+{
+  //phyTimeTimestamp_t      timeStamp;
+  uint8_t                 ppduLinkQuality;
+  uint8_t                 u8LastRxRssi;
+  rxPacket_t *            pRxPacket;
+} smacDataInd_t;
+
+typedef  struct smacEdReq_tag
+{
+  channels_t               scanChannel;
+  smacTime_t               startTime;  // absolute
+} smacEdReq_t;
+
+typedef  struct smacCcaReq_tag
+{
+  scanModes_t             ccaType;
+} smacCcaReq_t;
+
+typedef  struct smacCcaCnf_tag
+{
+  smacErrors_t       status;
+} smacCcaCnf_t;
+
+typedef  struct smacEdCnf_tag
+{
+  smacErrors_t            status;
+  uint8_t                 energyLevel;
+  uint8_t                 energyLeveldB;
+  channels_t              scannedChannel;
+} smacEdCnf_t;
+
+typedef  struct smacToAppMlmeMessage_tag
+{
+  smacMessageDefs_t          msgType;
+  uint8_t                    appInstanceId;
+  union
+  {
+    smacCcaCnf_t       ccaCnf;
+    smacEdCnf_t             edCnf;
+  }msgData;
+} smacToAppMlmeMessage_t;
+
+typedef  struct smacToAppDataMessage_tag
+{
+  smacMessageDefs_t            msgType;
+  uint8_t                    appInstanceId;
+  union
+  {
+    smacDataCnf_t             dataCnf;
+    smacDataInd_t             dataInd;
+  }msgData;
+} smacToAppDataMessage_t;
+
+typedef smacErrors_t ( * SMAC_APP_MCPS_SapHandler_t)(smacToAppDataMessage_t * pMsg, instanceId_t instanceId);
+
+typedef smacErrors_t ( * SMAC_APP_MLME_SapHandler_t)(smacToAppMlmeMessage_t * pMsg, instanceId_t instanceId);
+
+/************************************************************************************
+*************************************************************************************
+* External Prototypes
+*************************************************************************************
+************************************************************************************/
+extern void InitSmac(void);
+
+/***********************************************************************************
+* Smac_RegisterSapHandlers
+* This function registers the data and management components callbacks to the application
+* After calling this function and providing two function pointers, SMAC will call 
+* one of these two, for each async request, based on request type (data or management)
+*
+* Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used. 
+*
+* Return value:  
+*   None
+************************************************************************************/
+extern void Smac_RegisterSapHandlers(SMAC_APP_MCPS_SapHandler_t pSMAC_APP_MCPS_SapHandler,
+                                     SMAC_APP_MLME_SapHandler_t pSMAC_APP_MLME_SapHandler,
+                                     instanceId_t smacInstanceId);
+
+/***********************************************************************************
+* App to Smac SAP HANDLERS
+************************************************************************************/
+//smacErrors_t AppToSmac_Data_SapHandler(AppToSmacDataMessage_t* pMsg, uint8_t MACInstance);
+//smacErrors_t AppToSmac_Mlme_SapHandler(AppToSmacMlmeMessage_t* pMsg, uint8_t MACInstance);
+/***********************************************************************************/
+
+/******************************** SMAC Data primitives *****************************/
+/***********************************************************************************/
+
+/************************************************************************************
+* MCPSDataRequest
+* 
+* This data primitive is used to send an over the air packet. This is an asyncronous 
+* function,  it means it ask SMAC to transmit one OTA packet,  but when the function 
+* returns it is not sent already.
+*
+* Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used. 
+*
+* Return value:  
+*   gErrorNoError_c: Everything is ok and the transmission will be performed.
+*   gErrorOutOfRange_c: One of the members in the pTxMessage structure is out of 
+*                      range (no valid bufer size or data buffer pointer is NULL)
+*   gErrorNoResourcesAvailable_c: the radio is performing another action.
+*   gErrorNoValidCondition_c: The SMAC has not been initialized 
+*
+************************************************************************************/
+extern smacErrors_t MCPSDataRequest(txPacket_t *psTxPacket);
+
+
+/************************************************************************************
+* MLMEConfigureTxContext
+* 
+* This management primitive sets up the transmission conditions used by MCPSDataRequest
+*
+* Interface assumptions:
+*   SMAC is initialized 
+*
+* Return value:  
+*   gErrorNoError_c: Everything is set accordingly.
+*   gErrorOutOfRange_c: More than gMaxRetriesAllowed_c are required
+*   gErrorNoValidCondition_c: Retries are required but neither Ack nor CCA are requested 
+*
+************************************************************************************/
+extern smacErrors_t MLMEConfigureTxContext(txContextConfig_t* pTxConfig);
+/************************************************************************************
+* MLMERXEnableRequest
+* 
+* Function used to place the radio into receive mode
+* 
+* Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used.
+*    
+* Arguments:
+* 
+*        rxPacket_t *gsRxPacket: Pointer to the structure where the reception results will be stored.
+*        smacTime_t stTimeout: 64-bit timeout value, absolute time in symbols
+*        
+*  Return Value:
+*       gErrorNoError_c: Everything is ok and the reception will be performed.
+*       gErrorOutOfRange_c: One of the members in the pRxMessage structure is out of range (no valid bufer size or data buffer pointer is NULL).
+*       gErrorBusy_c: the radio is performing another action.
+*       gErrorNoValidCondition_c: The SMAC has not been initialized.
+*************************************************************************************/
+extern smacErrors_t MLMERXEnableRequest(rxPacket_t *gsRxPacket, smacTime_t stTimeout);
+
+
+/************************************************************************************
+* MLMERXDisableRequest
+* 
+* Returns the radio to idle mode from receive mode.
+* 
+*   Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used.
+* 
+*   Arguments: 
+*   None 
+*   
+*   Return Value:
+*      gErrorNoValidCondition_c If the Radio is not in Rx state.
+*      gErrorNoError_c When the message was aborted or disabled.
+*************************************************************************************/
+extern smacErrors_t MLMERXDisableRequest(void);
+
+/************************************************************************************
+* MLMELinkQuality
+* 
+*  This function returns an integer value that is the link quality from the last received 
+*  packet of the form: dBm = (-Link Quality/2).
+* 
+*   Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used.
+* 
+*   Arguments: 
+*   None 
+*   
+*   Return Value:
+*   uint8_t: 8 bit value representing the link quality value in dBm.
+*   Returns the result in smacLastDataRxParams.linkQuality.
+*************************************************************************************/
+extern uint8_t  MLMELinkQuality(void);
+
+/************************************************************************************
+* MLMESetInterPacketRxDelay
+* 
+* This sets the inter packet delay for the packet handler 
+* 
+*  Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used.
+* 
+*  Arguments: 
+*   uint8_t u8InterPacketRxDelay: interpacket delay in ms
+*   
+*  Return Value:
+*      gErrorNoValidCondition_c If the Radio is not in Rx state.
+*      gErrorNoError_c When the message was aborted or disabled.
+*
+*************************************************************************************/
+#if defined(gPHY_802_15_4g_d)
+extern smacErrors_t MLMESetInterPacketRxDelay(uint8_t u8InterPacketRxDelay);
+#endif
+
+/***********************************************************************************/
+/******************************** SMAC Radio primitives ****************************/
+/***********************************************************************************/
+
+/************************************************************************************
+* MLMESetChannelRequest
+*
+* This sets the frequency on which the radio will transmit or receive on.
+* 
+*  Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used.
+* 
+*  Arguments: 
+*    channels_t newChannel: channel to be set
+*   
+*  Return Value:
+*   gErrorNoError_c: The channel set has been performed
+*   gErrorOutOfRange_c : channel requested is not valid
+*   gErrorBusy_c: when SMAC is busy in other radio activity as transmitting or receiving data. Or performing a channel scan.
+*************************************************************************************/
+extern smacErrors_t MLMESetChannelRequest (channels_t newChannel);
+
+#ifdef gIncludeCalibrationOption
+/************************************************************************************
+* MLMESetAdditionalRFOffset
+*
+* This sets the frequency offset in respect to the current channel. Used for calibration.
+* 
+*  Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used.
+* 
+*  Arguments: 
+*    uint32_t additionalRFOffset: offset used in frequency Calculation
+*   
+*  Return Value:
+*   gErrorNoError_c: The PIB is set
+*   gErrorNoValidCondition_c: SMAC is not initialized
+*************************************************************************************/
+extern smacErrors_t MLMESetAdditionalRFOffset (uint32_t additionalRFOffset);
+
+/************************************************************************************
+* MLMEGetAdditionalRFOffset
+*
+* This gets the frequency offset in respect to the current channel. Used for calibration.
+* 
+*  Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used.
+* 
+*  Arguments: 
+*    None
+*   
+*  Return Value:
+*   calibration offset
+*************************************************************************************/
+extern uint32_t MLMEGetAdditionalRFOffset( void );
+
+#endif
+/************************************************************************************
+* MLMEGetChannelRequest
+* 
+* This function returns the current channel, if an error is detected it returns gChannelOutOfRange_c.
+* 
+*  Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used.
+* 
+*  Arguments: 
+*   None 
+*   
+*  Return Value:
+*  channels_t (uint8_t): The current RF channel.
+*  gChannelOutOfRange_c: If current channel could not be detected
+*************************************************************************************/
+extern channels_t MLMEGetChannelRequest(void);
+
+
+/************************************************************************************
+* MLMERssi
+*
+* This call starts an energy detect (ED) cycle and returns the energy value (-power/2) 
+* via the returned argument. For example, if the Energy Detect returns 80 then the 
+* interpreted value is -80/2 or -40 dBm
+* 
+*  Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used.
+* 
+*  Arguments: 
+*   None 
+*   
+*  Return Value:
+*  uint8_t: An unsigned 8-bit value representing the energy on the current channel.
+*************************************************************************************/
+#if defined(gPHY_802_15_4g_d)
+extern uint8_t MLMERssi(void);
+#endif
+
+/************************************************************************************
+* MLMESetCCADuration
+*
+* This call sets the amount of time necessary to perform CCA or ED
+*  Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used.
+* 
+*  Arguments: 
+*   uint64_t usCCADuration: duration in microseconds
+*   
+*  Return Value:
+*  gErrorNoError_c in case of success, error code otherwise.
+*************************************************************************************/
+#if defined(gPHY_802_15_4g_d)
+extern smacErrors_t MLMESetCCADuration(uint64_t usCCADuration );
+#endif
+/************************************************************************************
+* MLMEPacketConfig
+*
+* This function sets the following parameters for OTA packets in radio�s registers:
+* Preamble size, synchronization word size, and synchronization word value.
+* 
+*  Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used.
+* 
+*  Arguments: 
+*   packetConfig_t *pPacketCfg
+*   
+*  Return Value:
+*  gErrorBusy_c: when SMAC is busy in other radio activity as transmitting or receiving data. 
+*  Or performing a channel scan.
+*  gErrorNoError_c: the packet has been configured 
+*************************************************************************************/
+#if defined(gPHY_802_15_4g_d)
+extern smacErrors_t MLMEPacketConfig(packetConfig_t *pPacketCfg);
+#endif
+/************************************************************************************
+* MLMERadioInit
+* 
+* This function initializes the Radio parameters.
+* 
+*  Interface assumptions:
+*   None
+* 
+*  Arguments: 
+*   None 
+*   
+*  Return Value:
+*  gErrorNoError_c: the Radio initialization has been done successfully
+*************************************************************************************/
+#if defined(gPHY_802_15_4g_d)
+extern smacErrors_t MLMERadioInit(void);
+#endif
+/************************************************************************************
+* MLMEPhySoftReset
+*
+* This function performs a software reset on the radio, PHY and SMAC state machines.
+* 
+*  Interface assumptions:
+*   None
+* 
+*  Arguments: 
+*   None 
+*   
+*  Return Value:
+*  gErrorNoError_c: If the action is performed.
+*************************************************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+smacErrors_t MLMEPhySoftReset(void);
+
+#ifdef __cplusplus
+} //extern "C" 
+#endif
+
+/************************************************************************************
+* MLMEPAOutputAdjust
+*
+*
+*************************************************************************************/
+extern smacErrors_t MLMEPAOutputAdjust(uint8_t u8PaValue);
+
+/************************************************************************************
+* MLMESetPreambleLength
+*
+*
+*************************************************************************************/
+#if defined(gPHY_802_15_4g_d)
+extern smacErrors_t MLMESetPreambleLength(uint16_t u16preambleLength);
+#endif
+/************************************************************************************
+* MLMESetSyncWordValue
+*
+*
+*************************************************************************************/
+#if defined(gPHY_802_15_4g_d)
+extern smacErrors_t MLMESetSyncWordValue(uint8_t *u8syncWordValue);
+#endif
+/************************************************************************************
+* MLMESetSyncWordSize
+*
+*
+*************************************************************************************/
+#if defined(gPHY_802_15_4g_d)
+extern smacErrors_t MLMESetSyncWordSize(uint8_t u8syncWordSize);
+#endif
+/************************************************************************************
+* MLMESetFreqBand
+* 
+*  
+*
+************************************************************************************/
+#if defined(gPHY_802_15_4g_d)
+extern smacErrors_t MLMESetFreqBand(smacFrequencyBands_t freqBand, smacRFModes_t phyMode);
+#endif
+/************************************************************************************
+* MLMESetPhyMode
+* 
+*  
+*
+************************************************************************************/
+#if defined(gPHY_802_15_4g_d)
+extern smacErrors_t MLMESetPhyMode(smacRFModes_t phyMode);
+#endif
+/***********************************************************************************/
+/***************************** SMAC Management primitives **************************/
+/***********************************************************************************/
+
+/************************************************************************************
+* MLMEScanRequest
+*
+*  This function scans the channel passed as parameter using CCA or ED mode
+*  returns the RSSI in that channel.
+* 
+*  Interface assumptions:
+*   The SMAC and radio driver have been initialized and are ready to be used.
+* 
+*  Arguments: 
+*   channels_t u8ChannelToScan: channel to scan 
+*  uint8_t *u8ChannelScanResult: to return the RSSI value 
+*   
+*  Return Value:
+*   gErrorNoError_c:  If the action was performed correctly.
+*   gErrorBusy_c:     If SMAC is busy. 
+*************************************************************************************/
+extern smacErrors_t MLMEScanRequest(channels_t u8ChannelToScan);
+
+/*@CMA, Conn Test Added*/
+/************************************************************************************
+* MLMECcaRequest
+* 
+* This  function  performs Clear Channel Assessment on the active channel  
+* 
+* Return value:
+* gErrorNoError_c: SMAC will perform Cca 
+* gErrorBusy_c:    SMAC is busy
+************************************************************************************/
+extern smacErrors_t MLMECcaRequest(void);
+
+/************************************************************************************
+* MLMETXDisableRequest
+* 
+* Returns the radio to idle mode from Tx mode.
+*
+************************************************************************************/
+extern void MLMETXDisableRequest(void);
+
+/***********************************************************************************
+******************************** SMAC MCU primitives *******************************
+***********************************************************************************/
+
+/************************************************************************************
+*SMAC auxiliary functions
+*************************************************************************************/
+
+/************************************************************************************
+*SMACFillHeader
+*This is a replacement for the u8DestAddress in the txPacket_t structure
+*To set the destination address simply call this function with a pointer to 
+*txPacket->smacHeader and a uint16_t variable resembling the address.
+*Also, to change the default source address and panID, modify gDefaultPanID_c and
+*gNodeAddress_c from SMAC_Config.h or call SMACSetShortSrcAddress and SMACSetPanID.
+*************************************************************************************/
+extern void SMACFillHeader(smacHeader_t* pSmacHeader, uint16_t destAddr);
+
+/***********************************************************************************/
+extern smacErrors_t SMACSetShortSrcAddress(uint16_t nwShortAddress);
+
+/***********************************************************************************/
+extern smacErrors_t SMACSetPanID(uint16_t nwShortPanID);
+
+/***********************************************************************************/
+
+
+
+#endif /* SMAC_INTERFACE_H_ */