Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: fsl_phy_mcr20a fsl_smac mbed-rtos mbed
Fork of mcr20_connectivity_test by
Modes of Operation
The MCR20A Connectivity Test application has five main features:
Continuous Tests
This menu option displays several test suites
- IDLE: This option sets the transceiver and all the state machines to idle.
- Burst PRBS Transmission using packet mode: This option continuously sends packets which contain a pseudo-random payload of fixed length.
- Continuous Modulated Transmission: This option allows the user to select between modulating 1’s, 0’s, or a pseudo-random sequence (PN) and sending them OTA continuously (in continuous mode).
- Continuous Unmodulated Transmission: This option allows the user to send an unmodulated signal OTA having the frequency equal to the central frequency of the currently selected channel.
- Continuous Reception: This test places the transceiver in reception and dumps the payload bytes of the received packets to the TERM in ASCII-converted hexadecimal characters.
- Continuous Energy Detect: This option launches consecutive energy detect requests at fixed hard-coded intervals for the current channel, and prints their values to the TERM.
- Continuous Scan: This option is similar to the previous one, except that at each iteration it obtains the energy values on all channels.
- Continuous CCA: This option launches consecutive CCA requests for the currently selected channel at a fixed. hard-coded interval, and prints “Idle” or “Busy” depending on the CCA result.
Packet Error Rate
This menu option displays a configuration menu for testing the packet error rate. The menu displayed also depends on the ‘r’ or ‘t’ shortcut key. If ‘r’ is pressed, the following menu is for PER RX, otherwise it is for PER TX. For example, if two MCR20A platforms have Connectivity Test loaded, one of the boards can be set in RX and the other in TX as in the following figures.
Range Test
This test displays a configuration menu that performs a ‘ping-pong’ test to aid the user in determining the range (as distance between two platforms) in which the MCR20A platform can function properly. The sub-menu also depends on the ‘r’ and ‘t’ shortcuts so that one of the platforms can be the initializer (first to start a TX) and the other can respond to requests. The test is started and stopped only by user intervention and during its execution it will display the signal strength for each received packet. At the end of the test, the platform configured as the initializer (TX) displays a summary of how many packets were lost and what was the average RSSI.
Radio Registers Edit
This menu allows the user to read-write transceiver registers and to dump all address-value pairs from the transceiver registers to the TERM. The described features are accessible through the entries of this menu. For each access request (read or write) to a certain register, the register address is validated partially, and it is the responsibility of the user to access an existing register. For example, if the last accessible register is at 0xFD, the application only validates that the address is in the unsigned char range, but the user has the possibility to request register 0xFF. To ensure that a proper range is used, the user should first use the dump register feature to see the valid address ranges.
Carrier Sense and Transmission Control
This menu allows the user to choose between two tests. The former is the Carrier Sense test, which performs ED continuously until the ED value is above the CCA threshold (configured using ‘k’ and ‘l’ shortcuts) and then transmits a packet which contains pseudo-random data with the payload size configured using ‘n’ and ‘m’ shortcuts. The latter is the Transmission Control test, which displays a selection menu for number of packets identical with the one in PER TX test, then prompts the user to enter a decimal value resembling the inter-packet delay in milliseconds. After that, the application starts sending the selected number of packets with the selected inter-packet delay, using pseudo-random data for the payload with the size configured with ‘n’ and ‘m’ shortcuts.
Keys Usage
The following keys have the effect described below:
- ‘t’ : Brings up the configuration menu for the transmitter in both PER and Range tests.
- ‘r’ : Brings up the configuration menu for the receiver in both PER and Range tests.
- ‘q’ : Increments channel number. If pressed when the current channel is 26, the channel number changes to 11.
- ‘w’ : Decrements channel number. If pressed when the current channel is 11, the channel number will change to 26.
- ‘a’ : Increments output power value. If output power is at maximum and this key is pressed, the output power goes to the minimum (in this case 0x03).
- ‘s’ : Decrements output power value. If output power is at minimum and this key is pressed, the output power goes to the maximum (in this case 0x1F). These are not directly mapped to dBm values. Instead the output power value is written to the appropriate register. The user should consult the reference manual to determine the relationship between selected value and power in dBm.
- ‘n’ : Increments the length of the payload. This value is used in both PER TX test to build-up the payload and in Transmission Control test for the same reason.
- ‘m’ : Decrements the length of the payload. Incrementation and decrementation are performed in the [17, 116] interval. All overflows at one end lead to setting the other end’s value.
- ‘k’ : Increments the CCA threshold for the Carrier Sense test. In this test the CCA before TX algorithm is implemented at application level, and the channel idle threshold is established using this parameter.
- ‘l’ : Decrements the CCA threshold for the Carrier Sense test.
Documentation
SMAC Demo Applications User Guide
FSL_IEEE_802_15_4/SMAC/SMAC_Interface.h
- Committer:
- andreikovacs
- Date:
- 2015-07-16
- Revision:
- 0:4eb2240dbd22
- Child:
- 2:aaffc5d91884
File content as of revision 0:4eb2240dbd22:
/**************************************************************************************************
* 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.
*************************************************************************************/
extern smacErrors_t MLMEPhySoftReset(void);
/************************************************************************************
* 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_ */
