NXP / Mbed 2 deprecated mcr20_wireless_uart

Dependencies:   fsl_phy_mcr20a fsl_smac mbed-rtos mbed

Fork of mcr20_wireless_uart by Freescale

By default, the application uses broadcast addresses for OTA communication. This way, the application can be directly downloaded and run without any user intervention. The following use case assumes no changes have been done to the project.

  • Two (or more) MCR20A platforms (plugged into the FRDM-K64F Freescale Freedom Development platform) have to be connected to the PC using the mini/micro-USB cables.
  • The code must be downloaded on the platforms via CMSIS-DAP (or other means).
  • After that, two or more TERM applications must be opened, and the serial ports must be configured with the same baud rate as the one in the project (default baud rate is 115200). Other necessary serial configurations are 8 bit, no parity, and 1 stop bit.
  • To start the setup, each platform must be reset, and one of the (user) push buttons found on the MCR20A platform must be pressed. The user can press any of the non-reset buttons on the FRDM-K64F Freescale Freedom Development platform as well. *This initiates the state machine of the application so user can start.

Documentation

SMAC Demo Applications User Guide

Committer:
andreikovacs
Date:
Mon Jun 29 05:50:47 2015 +0000
Revision:
27:1eb29717bfd9
Parent:
19:71b793021c78
Changed app to behave like the initial Wireless UART demo

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cotigac 19:71b793021c78 1 /**************************************************************************************************
cotigac 19:71b793021c78 2 * SMAC Interface header file
cotigac 19:71b793021c78 3 *
cotigac 19:71b793021c78 4 * Freescale Semiconductor Inc.
cotigac 19:71b793021c78 5 * (c) Copyright 2004-2014 Freescale Semiconductor, Inc.
cotigac 19:71b793021c78 6 * ALL RIGHTS RESERVED.
cotigac 19:71b793021c78 7 *
cotigac 19:71b793021c78 8 ***************************************************************************************************
cotigac 19:71b793021c78 9 *
cotigac 19:71b793021c78 10 * THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESSED OR
cotigac 19:71b793021c78 11 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
cotigac 19:71b793021c78 12 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
cotigac 19:71b793021c78 13 * IN NO EVENT SHALL FREESCALE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
cotigac 19:71b793021c78 14 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
cotigac 19:71b793021c78 15 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
cotigac 19:71b793021c78 16 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
cotigac 19:71b793021c78 17 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
cotigac 19:71b793021c78 18 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
cotigac 19:71b793021c78 19 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
cotigac 19:71b793021c78 20 * THE POSSIBILITY OF SUCH DAMAGE.
cotigac 19:71b793021c78 21 *
cotigac 19:71b793021c78 22 ***********************************************************************************************//*!
cotigac 19:71b793021c78 23 **************************************************************************************************/
cotigac 19:71b793021c78 24
cotigac 19:71b793021c78 25 #ifndef SMAC_INTERFACE_H_
cotigac 19:71b793021c78 26 #define SMAC_INTERFACE_H_
cotigac 19:71b793021c78 27
cotigac 19:71b793021c78 28 /************************************************************************************
cotigac 19:71b793021c78 29 *************************************************************************************
cotigac 19:71b793021c78 30 * Includes
cotigac 19:71b793021c78 31 *************************************************************************************
cotigac 19:71b793021c78 32 ************************************************************************************/
cotigac 19:71b793021c78 33 #include "EmbeddedTypes.h"
cotigac 19:71b793021c78 34 #include "PhyTypes.h"
cotigac 19:71b793021c78 35 /************************************************************************************
cotigac 19:71b793021c78 36 *************************************************************************************
cotigac 19:71b793021c78 37 * Interface macro definitions
cotigac 19:71b793021c78 38 *************************************************************************************
cotigac 19:71b793021c78 39 ************************************************************************************/
cotigac 19:71b793021c78 40
cotigac 19:71b793021c78 41 #define gSmacHeaderBytes_c ( sizeof(smacHeader_t) )
cotigac 19:71b793021c78 42 #define gMaxSmacSDULength_c (gMaxPHYPacketSize_c -(sizeof(smacHeader_t) + 2) )
cotigac 19:71b793021c78 43 #define gMinSmacSDULength_c (0)
cotigac 19:71b793021c78 44
cotigac 19:71b793021c78 45 #define gBroadcastAddress_c (0xFFFF)
cotigac 19:71b793021c78 46 #define gSmacDefaultFrameCtrl (0x8841)
cotigac 19:71b793021c78 47 #define gSmacDefaultSeqNo (0xAB)
cotigac 19:71b793021c78 48 /************************************************************************************
cotigac 19:71b793021c78 49 *************************************************************************************
cotigac 19:71b793021c78 50 * Public memory declarations
cotigac 19:71b793021c78 51 *************************************************************************************
cotigac 19:71b793021c78 52 ************************************************************************************/
cotigac 19:71b793021c78 53 // extern bool_t smacStandalone;
cotigac 19:71b793021c78 54 extern uint8_t gTotalChannels;
cotigac 19:71b793021c78 55
cotigac 19:71b793021c78 56 /************************************************************************************
cotigac 19:71b793021c78 57 *************************************************************************************
cotigac 19:71b793021c78 58 * Interface Type definitions
cotigac 19:71b793021c78 59 *************************************************************************************
cotigac 19:71b793021c78 60 ************************************************************************************/
cotigac 19:71b793021c78 61
cotigac 19:71b793021c78 62 typedef enum smacMessageDefs_tag
cotigac 19:71b793021c78 63 {
cotigac 19:71b793021c78 64 gMcpsDataReq_c,
cotigac 19:71b793021c78 65 gMcpsDataCnf_c,
cotigac 19:71b793021c78 66 gMcpsDataInd_c,
cotigac 19:71b793021c78 67
cotigac 19:71b793021c78 68 gMcpsIndQueueInsertReq_c,
cotigac 19:71b793021c78 69 gMcpsIndQueueInsertCnf_c,
cotigac 19:71b793021c78 70 gMcpsIndQueueRemoveReq_c,
cotigac 19:71b793021c78 71
cotigac 19:71b793021c78 72 gMlmeCcaReq_c,
cotigac 19:71b793021c78 73 gMlmeCcaCnf_c,
cotigac 19:71b793021c78 74
cotigac 19:71b793021c78 75 gMlmeEdReq_c,
cotigac 19:71b793021c78 76 gMlmeEdCnf_c,
cotigac 19:71b793021c78 77
cotigac 19:71b793021c78 78 gMlmeSetTRxStateReq_c,
cotigac 19:71b793021c78 79 gMlmeSetTRxStateCnf_c,
cotigac 19:71b793021c78 80
cotigac 19:71b793021c78 81 gMlmeSetReq_c,
cotigac 19:71b793021c78 82 gMlmeSetCnf_c,
cotigac 19:71b793021c78 83
cotigac 19:71b793021c78 84 gMlmeGetReq_c,
cotigac 19:71b793021c78 85 gMlmeGetCnf_c,
cotigac 19:71b793021c78 86
cotigac 19:71b793021c78 87 gMlmeTimeoutInd_c,
cotigac 19:71b793021c78 88
cotigac 19:71b793021c78 89 gMlme_StartEventInd_c,
cotigac 19:71b793021c78 90 gMlme_SyncLossInd_c,
cotigac 19:71b793021c78 91 gMlme_RxSfdDetectInd_c,
cotigac 19:71b793021c78 92 gMlme_FilterFailInd_c,
cotigac 19:71b793021c78 93 gMlme_UnexpectedRadioResetInd_c,
cotigac 19:71b793021c78 94 }smacMessageDefs_t;
cotigac 19:71b793021c78 95
cotigac 19:71b793021c78 96 typedef uint64_t smacTime_t;
cotigac 19:71b793021c78 97
cotigac 19:71b793021c78 98 typedef struct smacPdu_tag
cotigac 19:71b793021c78 99 {
cotigac 19:71b793021c78 100 uint8_t smacPdu[1];
cotigac 19:71b793021c78 101 }smacPdu_t;
cotigac 19:71b793021c78 102
cotigac 19:71b793021c78 103 typedef PACKED_STRUCT smacHeader_tag
cotigac 19:71b793021c78 104 {
cotigac 19:71b793021c78 105 uint16_t frameControl;
cotigac 19:71b793021c78 106 uint8_t seqNo;
cotigac 19:71b793021c78 107 uint16_t panId;
cotigac 19:71b793021c78 108 uint16_t destAddr;
cotigac 19:71b793021c78 109 uint16_t srcAddr;
cotigac 19:71b793021c78 110 }smacHeader_t;
cotigac 19:71b793021c78 111
cotigac 19:71b793021c78 112 typedef struct txPacket_tag
cotigac 19:71b793021c78 113 {
cotigac 19:71b793021c78 114 uint8_t u8DataLength;
cotigac 19:71b793021c78 115 smacHeader_t smacHeader;
cotigac 19:71b793021c78 116 smacPdu_t smacPdu;
cotigac 19:71b793021c78 117 }txPacket_t;
cotigac 19:71b793021c78 118
cotigac 19:71b793021c78 119 typedef struct txContextConfig_tag
cotigac 19:71b793021c78 120 {
cotigac 19:71b793021c78 121 bool_t ccaBeforeTx;
cotigac 19:71b793021c78 122 bool_t autoAck;
cotigac 19:71b793021c78 123 uint8_t retryCountCCAFail;
cotigac 19:71b793021c78 124 uint8_t retryCountAckFail;
cotigac 19:71b793021c78 125 }txContextConfig_t;
cotigac 19:71b793021c78 126
cotigac 19:71b793021c78 127 typedef enum rxStatus_tag
cotigac 19:71b793021c78 128 {
cotigac 19:71b793021c78 129 rxInitStatus,
cotigac 19:71b793021c78 130 rxProcessingReceptionStatus_c,
cotigac 19:71b793021c78 131 rxSuccessStatus_c,
cotigac 19:71b793021c78 132 rxTimeOutStatus_c,
cotigac 19:71b793021c78 133 rxAbortedStatus_c,
cotigac 19:71b793021c78 134 rxMaxStatus_c
cotigac 19:71b793021c78 135 } rxStatus_t;
cotigac 19:71b793021c78 136
cotigac 19:71b793021c78 137 typedef struct rxPacket_tag
cotigac 19:71b793021c78 138 {
cotigac 19:71b793021c78 139 uint8_t u8MaxDataLength;
cotigac 19:71b793021c78 140 rxStatus_t rxStatus;
cotigac 19:71b793021c78 141 uint8_t u8DataLength;
cotigac 19:71b793021c78 142 smacHeader_t smacHeader;
cotigac 19:71b793021c78 143 smacPdu_t smacPdu;
cotigac 19:71b793021c78 144 }rxPacket_t;
cotigac 19:71b793021c78 145
cotigac 19:71b793021c78 146 typedef enum txStatus_tag
cotigac 19:71b793021c78 147 {
cotigac 19:71b793021c78 148 txSuccessStatus_c,
cotigac 19:71b793021c78 149 txFailureStatus_c,
cotigac 19:71b793021c78 150 txMaxStatus_c
cotigac 19:71b793021c78 151 } txStatus_t;
cotigac 19:71b793021c78 152
cotigac 19:71b793021c78 153 typedef enum smacErrors_tag
cotigac 19:71b793021c78 154 {
cotigac 19:71b793021c78 155 gErrorNoError_c = 0,
cotigac 19:71b793021c78 156 gErrorBusy_c,
cotigac 19:71b793021c78 157 gErrorChannelBusy_c,
cotigac 19:71b793021c78 158 gErrorNoAck_c,
cotigac 19:71b793021c78 159 gErrorOutOfRange_c,
cotigac 19:71b793021c78 160 gErrorNoResourcesAvailable_c,
cotigac 19:71b793021c78 161 gErrorNoValidCondition_c,
cotigac 19:71b793021c78 162 gErrorCorrupted_c,
cotigac 19:71b793021c78 163 gErrorMaxError_c
cotigac 19:71b793021c78 164 } smacErrors_t;
cotigac 19:71b793021c78 165
cotigac 19:71b793021c78 166 #if defined (gPHY_802_15_4g_d)
cotigac 19:71b793021c78 167
cotigac 19:71b793021c78 168 typedef enum smacRFModes_tag
cotigac 19:71b793021c78 169 {
cotigac 19:71b793021c78 170 gRFMode1_c = gPhyMode1_c,
cotigac 19:71b793021c78 171 gRFMode2_c = gPhyMode2_c,
cotigac 19:71b793021c78 172 gRFMode3_c = gPhyMode3_c,
cotigac 19:71b793021c78 173 gRFMode4_c = gPhyMode4_c,
cotigac 19:71b793021c78 174 gRFMode5_c = gPhyMode1ARIB_c, /*ARIB mode 1*/
cotigac 19:71b793021c78 175 gRFMode6_c = gPhyMode2ARIB_c, /*ARIB mode 2*/
cotigac 19:71b793021c78 176 gRFMaxMode_c
cotigac 19:71b793021c78 177 } smacRFModes_t;
cotigac 19:71b793021c78 178
cotigac 19:71b793021c78 179 typedef enum smacFrequencyBands_tag
cotigac 19:71b793021c78 180 {
cotigac 19:71b793021c78 181 gSMAC_863_870MHz_c = gFreq863__870MHz_c, /* 863-870 (Europe) */
cotigac 19:71b793021c78 182 gSMAC_902_928MHz_c = gFreq902__928MHz_c, /* 902-928 (US) */
cotigac 19:71b793021c78 183 gSMAC_920_928MHz_c = gFreq920__928MHz_c, /* 920-928 (Japan) */
cotigac 19:71b793021c78 184 gSMAC_169_400__169_475MHz_c = gFreq169_400__169_475MHz_c /* 169-475 */
cotigac 19:71b793021c78 185 }smacFrequencyBands_t;
cotigac 19:71b793021c78 186
cotigac 19:71b793021c78 187 #endif
cotigac 19:71b793021c78 188 typedef struct smacPacket_tag
cotigac 19:71b793021c78 189 {
cotigac 19:71b793021c78 190 uint8_t u8SyncWordSize;
cotigac 19:71b793021c78 191 uint8_t *u8SyncWordValue;
cotigac 19:71b793021c78 192 uint16_t u16PreambleLength;
cotigac 19:71b793021c78 193 }smacPacket_t;
cotigac 19:71b793021c78 194
cotigac 19:71b793021c78 195 typedef enum scanModes_tag
cotigac 19:71b793021c78 196 {
cotigac 19:71b793021c78 197 gScanModeCCA_c = 0,
cotigac 19:71b793021c78 198 gScanModeED_c,
cotigac 19:71b793021c78 199 gMaxScanMode_c
cotigac 19:71b793021c78 200 } scanModes_t;
cotigac 19:71b793021c78 201
cotigac 19:71b793021c78 202 #if defined (gPHY_802_15_4g_d)
cotigac 19:71b793021c78 203
cotigac 19:71b793021c78 204 typedef struct packetConfig_tag
cotigac 19:71b793021c78 205 {
cotigac 19:71b793021c78 206 uint16_t u16PreambleSize;
cotigac 19:71b793021c78 207 uint8_t u8SyncWordSize;
cotigac 19:71b793021c78 208 uint8_t *pu8SyncWord;
cotigac 19:71b793021c78 209 } packetConfig_t;
cotigac 19:71b793021c78 210
cotigac 19:71b793021c78 211 #endif
cotigac 19:71b793021c78 212
cotigac 19:71b793021c78 213 /*@CMA, Connectivity Test_Start*/
cotigac 19:71b793021c78 214 typedef enum channels_tag
cotigac 19:71b793021c78 215 {
cotigac 19:71b793021c78 216 #include "SMAC_Channels.h"
cotigac 19:71b793021c78 217 } channels_t;
cotigac 19:71b793021c78 218
cotigac 19:71b793021c78 219 typedef enum smacTestMode_tag
cotigac 19:71b793021c78 220 {
cotigac 19:71b793021c78 221 gTestModeForceIdle_c = 0,
cotigac 19:71b793021c78 222 gTestModeContinuousTxModulated_c,
cotigac 19:71b793021c78 223 gTestModeContinuousTxUnmodulated_c,
cotigac 19:71b793021c78 224 gTestModePRBS9_c,
cotigac 19:71b793021c78 225 gTestModeContinuousRxBER_c,
cotigac 19:71b793021c78 226 gMaxTestMode_c
cotigac 19:71b793021c78 227 } smacTestMode_t;
cotigac 19:71b793021c78 228
cotigac 19:71b793021c78 229 typedef struct smacDataCnf_tag
cotigac 19:71b793021c78 230 {
cotigac 19:71b793021c78 231 smacErrors_t status;
cotigac 19:71b793021c78 232 } smacDataCnf_t;
cotigac 19:71b793021c78 233
cotigac 19:71b793021c78 234 typedef struct smacDataInd_tag
cotigac 19:71b793021c78 235 {
cotigac 19:71b793021c78 236 //phyTimeTimestamp_t timeStamp;
cotigac 19:71b793021c78 237 uint8_t ppduLinkQuality;
cotigac 19:71b793021c78 238 uint8_t u8LastRxRssi;
cotigac 19:71b793021c78 239 rxPacket_t * pRxPacket;
cotigac 19:71b793021c78 240 } smacDataInd_t;
cotigac 19:71b793021c78 241
cotigac 19:71b793021c78 242 typedef struct smacEdReq_tag
cotigac 19:71b793021c78 243 {
cotigac 19:71b793021c78 244 channels_t scanChannel;
cotigac 19:71b793021c78 245 smacTime_t startTime; // absolute
cotigac 19:71b793021c78 246 } smacEdReq_t;
cotigac 19:71b793021c78 247
cotigac 19:71b793021c78 248 typedef struct smacCcaReq_tag
cotigac 19:71b793021c78 249 {
cotigac 19:71b793021c78 250 scanModes_t ccaType;
cotigac 19:71b793021c78 251 } smacCcaReq_t;
cotigac 19:71b793021c78 252
cotigac 19:71b793021c78 253 typedef struct smacCcaCnf_tag
cotigac 19:71b793021c78 254 {
cotigac 19:71b793021c78 255 smacErrors_t status;
cotigac 19:71b793021c78 256 } smacCcaCnf_t;
cotigac 19:71b793021c78 257
cotigac 19:71b793021c78 258 typedef struct smacEdCnf_tag
cotigac 19:71b793021c78 259 {
cotigac 19:71b793021c78 260 smacErrors_t status;
cotigac 19:71b793021c78 261 uint8_t energyLevel;
cotigac 19:71b793021c78 262 uint8_t energyLeveldB;
cotigac 19:71b793021c78 263 channels_t scannedChannel;
cotigac 19:71b793021c78 264 } smacEdCnf_t;
cotigac 19:71b793021c78 265
cotigac 19:71b793021c78 266 typedef struct smacToAppMlmeMessage_tag
cotigac 19:71b793021c78 267 {
cotigac 19:71b793021c78 268 smacMessageDefs_t msgType;
cotigac 19:71b793021c78 269 uint8_t appInstanceId;
cotigac 19:71b793021c78 270 union
cotigac 19:71b793021c78 271 {
cotigac 19:71b793021c78 272 smacCcaCnf_t ccaCnf;
cotigac 19:71b793021c78 273 smacEdCnf_t edCnf;
cotigac 19:71b793021c78 274 }msgData;
cotigac 19:71b793021c78 275 } smacToAppMlmeMessage_t;
cotigac 19:71b793021c78 276
cotigac 19:71b793021c78 277 typedef struct smacToAppDataMessage_tag
cotigac 19:71b793021c78 278 {
cotigac 19:71b793021c78 279 smacMessageDefs_t msgType;
cotigac 19:71b793021c78 280 uint8_t appInstanceId;
cotigac 19:71b793021c78 281 union
cotigac 19:71b793021c78 282 {
cotigac 19:71b793021c78 283 smacDataCnf_t dataCnf;
cotigac 19:71b793021c78 284 smacDataInd_t dataInd;
cotigac 19:71b793021c78 285 }msgData;
cotigac 19:71b793021c78 286 } smacToAppDataMessage_t;
cotigac 19:71b793021c78 287
cotigac 19:71b793021c78 288 typedef smacErrors_t ( * SMAC_APP_MCPS_SapHandler_t)(smacToAppDataMessage_t * pMsg, instanceId_t instanceId);
cotigac 19:71b793021c78 289
cotigac 19:71b793021c78 290 typedef smacErrors_t ( * SMAC_APP_MLME_SapHandler_t)(smacToAppMlmeMessage_t * pMsg, instanceId_t instanceId);
cotigac 19:71b793021c78 291
cotigac 19:71b793021c78 292 /************************************************************************************
cotigac 19:71b793021c78 293 *************************************************************************************
cotigac 19:71b793021c78 294 * External Prototypes
cotigac 19:71b793021c78 295 *************************************************************************************
cotigac 19:71b793021c78 296 ************************************************************************************/
cotigac 19:71b793021c78 297 extern void InitSmac(void);
cotigac 19:71b793021c78 298
cotigac 19:71b793021c78 299 /***********************************************************************************
cotigac 19:71b793021c78 300 * Smac_RegisterSapHandlers
cotigac 19:71b793021c78 301 * This function registers the data and management components callbacks to the application
cotigac 19:71b793021c78 302 * After calling this function and providing two function pointers, SMAC will call
cotigac 19:71b793021c78 303 * one of these two, for each async request, based on request type (data or management)
cotigac 19:71b793021c78 304 *
cotigac 19:71b793021c78 305 * Interface assumptions:
cotigac 19:71b793021c78 306 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 307 *
cotigac 19:71b793021c78 308 * Return value:
cotigac 19:71b793021c78 309 * None
cotigac 19:71b793021c78 310 ************************************************************************************/
cotigac 19:71b793021c78 311 extern void Smac_RegisterSapHandlers(SMAC_APP_MCPS_SapHandler_t pSMAC_APP_MCPS_SapHandler,
cotigac 19:71b793021c78 312 SMAC_APP_MLME_SapHandler_t pSMAC_APP_MLME_SapHandler,
cotigac 19:71b793021c78 313 instanceId_t smacInstanceId);
cotigac 19:71b793021c78 314
cotigac 19:71b793021c78 315 /***********************************************************************************
cotigac 19:71b793021c78 316 * App to Smac SAP HANDLERS
cotigac 19:71b793021c78 317 ************************************************************************************/
cotigac 19:71b793021c78 318 //smacErrors_t AppToSmac_Data_SapHandler(AppToSmacDataMessage_t* pMsg, uint8_t MACInstance);
cotigac 19:71b793021c78 319 //smacErrors_t AppToSmac_Mlme_SapHandler(AppToSmacMlmeMessage_t* pMsg, uint8_t MACInstance);
cotigac 19:71b793021c78 320 /***********************************************************************************/
cotigac 19:71b793021c78 321
cotigac 19:71b793021c78 322 /******************************** SMAC Data primitives *****************************/
cotigac 19:71b793021c78 323 /***********************************************************************************/
cotigac 19:71b793021c78 324
cotigac 19:71b793021c78 325 /************************************************************************************
cotigac 19:71b793021c78 326 * MCPSDataRequest
cotigac 19:71b793021c78 327 *
cotigac 19:71b793021c78 328 * This data primitive is used to send an over the air packet. This is an asyncronous
cotigac 19:71b793021c78 329 * function, it means it ask SMAC to transmit one OTA packet, but when the function
cotigac 19:71b793021c78 330 * returns it is not sent already.
cotigac 19:71b793021c78 331 *
cotigac 19:71b793021c78 332 * Interface assumptions:
cotigac 19:71b793021c78 333 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 334 *
cotigac 19:71b793021c78 335 * Return value:
cotigac 19:71b793021c78 336 * gErrorNoError_c: Everything is ok and the transmission will be performed.
cotigac 19:71b793021c78 337 * gErrorOutOfRange_c: One of the members in the pTxMessage structure is out of
cotigac 19:71b793021c78 338 * range (no valid bufer size or data buffer pointer is NULL)
cotigac 19:71b793021c78 339 * gErrorNoResourcesAvailable_c: the radio is performing another action.
cotigac 19:71b793021c78 340 * gErrorNoValidCondition_c: The SMAC has not been initialized
cotigac 19:71b793021c78 341 *
cotigac 19:71b793021c78 342 ************************************************************************************/
cotigac 19:71b793021c78 343 extern smacErrors_t MCPSDataRequest(txPacket_t *psTxPacket);
cotigac 19:71b793021c78 344
cotigac 19:71b793021c78 345
cotigac 19:71b793021c78 346 /************************************************************************************
cotigac 19:71b793021c78 347 * MLMEConfigureTxContext
cotigac 19:71b793021c78 348 *
cotigac 19:71b793021c78 349 * This management primitive sets up the transmission conditions used by MCPSDataRequest
cotigac 19:71b793021c78 350 *
cotigac 19:71b793021c78 351 * Interface assumptions:
cotigac 19:71b793021c78 352 * SMAC is initialized
cotigac 19:71b793021c78 353 *
cotigac 19:71b793021c78 354 * Return value:
cotigac 19:71b793021c78 355 * gErrorNoError_c: Everything is set accordingly.
cotigac 19:71b793021c78 356 * gErrorOutOfRange_c: More than gMaxRetriesAllowed_c are required
cotigac 19:71b793021c78 357 * gErrorNoValidCondition_c: Retries are required but neither Ack nor CCA are requested
cotigac 19:71b793021c78 358 *
cotigac 19:71b793021c78 359 ************************************************************************************/
cotigac 19:71b793021c78 360 extern smacErrors_t MLMEConfigureTxContext(txContextConfig_t* pTxConfig);
cotigac 19:71b793021c78 361 /************************************************************************************
cotigac 19:71b793021c78 362 * MLMERXEnableRequest
cotigac 19:71b793021c78 363 *
cotigac 19:71b793021c78 364 * Function used to place the radio into receive mode
cotigac 19:71b793021c78 365 *
cotigac 19:71b793021c78 366 * Interface assumptions:
cotigac 19:71b793021c78 367 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 368 *
cotigac 19:71b793021c78 369 * Arguments:
cotigac 19:71b793021c78 370 *
cotigac 19:71b793021c78 371 * rxPacket_t *gsRxPacket: Pointer to the structure where the reception results will be stored.
cotigac 19:71b793021c78 372 * smacTime_t stTimeout: 64-bit timeout value, absolute time in symbols
cotigac 19:71b793021c78 373 *
cotigac 19:71b793021c78 374 * Return Value:
cotigac 19:71b793021c78 375 * gErrorNoError_c: Everything is ok and the reception will be performed.
cotigac 19:71b793021c78 376 * gErrorOutOfRange_c: One of the members in the pRxMessage structure is out of range (no valid bufer size or data buffer pointer is NULL).
cotigac 19:71b793021c78 377 * gErrorBusy_c: the radio is performing another action.
cotigac 19:71b793021c78 378 * gErrorNoValidCondition_c: The SMAC has not been initialized.
cotigac 19:71b793021c78 379 *************************************************************************************/
cotigac 19:71b793021c78 380 extern smacErrors_t MLMERXEnableRequest(rxPacket_t *gsRxPacket, smacTime_t stTimeout);
cotigac 19:71b793021c78 381
cotigac 19:71b793021c78 382
cotigac 19:71b793021c78 383 /************************************************************************************
cotigac 19:71b793021c78 384 * MLMERXDisableRequest
cotigac 19:71b793021c78 385 *
cotigac 19:71b793021c78 386 * Returns the radio to idle mode from receive mode.
cotigac 19:71b793021c78 387 *
cotigac 19:71b793021c78 388 * Interface assumptions:
cotigac 19:71b793021c78 389 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 390 *
cotigac 19:71b793021c78 391 * Arguments:
cotigac 19:71b793021c78 392 * None
cotigac 19:71b793021c78 393 *
cotigac 19:71b793021c78 394 * Return Value:
cotigac 19:71b793021c78 395 * gErrorNoValidCondition_c If the Radio is not in Rx state.
cotigac 19:71b793021c78 396 * gErrorNoError_c When the message was aborted or disabled.
cotigac 19:71b793021c78 397 *************************************************************************************/
cotigac 19:71b793021c78 398 extern smacErrors_t MLMERXDisableRequest(void);
cotigac 19:71b793021c78 399
cotigac 19:71b793021c78 400 /************************************************************************************
cotigac 19:71b793021c78 401 * MLMELinkQuality
cotigac 19:71b793021c78 402 *
cotigac 19:71b793021c78 403 * This function returns an integer value that is the link quality from the last received
cotigac 19:71b793021c78 404 * packet of the form: dBm = (-Link Quality/2).
cotigac 19:71b793021c78 405 *
cotigac 19:71b793021c78 406 * Interface assumptions:
cotigac 19:71b793021c78 407 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 408 *
cotigac 19:71b793021c78 409 * Arguments:
cotigac 19:71b793021c78 410 * None
cotigac 19:71b793021c78 411 *
cotigac 19:71b793021c78 412 * Return Value:
cotigac 19:71b793021c78 413 * uint8_t: 8 bit value representing the link quality value in dBm.
cotigac 19:71b793021c78 414 * Returns the result in smacLastDataRxParams.linkQuality.
cotigac 19:71b793021c78 415 *************************************************************************************/
cotigac 19:71b793021c78 416 extern uint8_t MLMELinkQuality(void);
cotigac 19:71b793021c78 417
cotigac 19:71b793021c78 418 /************************************************************************************
cotigac 19:71b793021c78 419 * MLMESetInterPacketRxDelay
cotigac 19:71b793021c78 420 *
cotigac 19:71b793021c78 421 * This sets the inter packet delay for the packet handler
cotigac 19:71b793021c78 422 *
cotigac 19:71b793021c78 423 * Interface assumptions:
cotigac 19:71b793021c78 424 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 425 *
cotigac 19:71b793021c78 426 * Arguments:
cotigac 19:71b793021c78 427 * uint8_t u8InterPacketRxDelay: interpacket delay in ms
cotigac 19:71b793021c78 428 *
cotigac 19:71b793021c78 429 * Return Value:
cotigac 19:71b793021c78 430 * gErrorNoValidCondition_c If the Radio is not in Rx state.
cotigac 19:71b793021c78 431 * gErrorNoError_c When the message was aborted or disabled.
cotigac 19:71b793021c78 432 *
cotigac 19:71b793021c78 433 *************************************************************************************/
cotigac 19:71b793021c78 434 #if defined(gPHY_802_15_4g_d)
cotigac 19:71b793021c78 435 extern smacErrors_t MLMESetInterPacketRxDelay(uint8_t u8InterPacketRxDelay);
cotigac 19:71b793021c78 436 #endif
cotigac 19:71b793021c78 437
cotigac 19:71b793021c78 438 /***********************************************************************************/
cotigac 19:71b793021c78 439 /******************************** SMAC Radio primitives ****************************/
cotigac 19:71b793021c78 440 /***********************************************************************************/
cotigac 19:71b793021c78 441
cotigac 19:71b793021c78 442 /************************************************************************************
cotigac 19:71b793021c78 443 * MLMESetChannelRequest
cotigac 19:71b793021c78 444 *
cotigac 19:71b793021c78 445 * This sets the frequency on which the radio will transmit or receive on.
cotigac 19:71b793021c78 446 *
cotigac 19:71b793021c78 447 * Interface assumptions:
cotigac 19:71b793021c78 448 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 449 *
cotigac 19:71b793021c78 450 * Arguments:
cotigac 19:71b793021c78 451 * channels_t newChannel: channel to be set
cotigac 19:71b793021c78 452 *
cotigac 19:71b793021c78 453 * Return Value:
cotigac 19:71b793021c78 454 * gErrorNoError_c: The channel set has been performed
cotigac 19:71b793021c78 455 * gErrorOutOfRange_c : channel requested is not valid
cotigac 19:71b793021c78 456 * gErrorBusy_c: when SMAC is busy in other radio activity as transmitting or receiving data. Or performing a channel scan.
cotigac 19:71b793021c78 457 *************************************************************************************/
cotigac 19:71b793021c78 458 extern smacErrors_t MLMESetChannelRequest (channels_t newChannel);
cotigac 19:71b793021c78 459
cotigac 19:71b793021c78 460 #ifdef gIncludeCalibrationOption
cotigac 19:71b793021c78 461 /************************************************************************************
cotigac 19:71b793021c78 462 * MLMESetAdditionalRFOffset
cotigac 19:71b793021c78 463 *
cotigac 19:71b793021c78 464 * This sets the frequency offset in respect to the current channel. Used for calibration.
cotigac 19:71b793021c78 465 *
cotigac 19:71b793021c78 466 * Interface assumptions:
cotigac 19:71b793021c78 467 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 468 *
cotigac 19:71b793021c78 469 * Arguments:
cotigac 19:71b793021c78 470 * uint32_t additionalRFOffset: offset used in frequency Calculation
cotigac 19:71b793021c78 471 *
cotigac 19:71b793021c78 472 * Return Value:
cotigac 19:71b793021c78 473 * gErrorNoError_c: The PIB is set
cotigac 19:71b793021c78 474 * gErrorNoValidCondition_c: SMAC is not initialized
cotigac 19:71b793021c78 475 *************************************************************************************/
cotigac 19:71b793021c78 476 extern smacErrors_t MLMESetAdditionalRFOffset (uint32_t additionalRFOffset);
cotigac 19:71b793021c78 477
cotigac 19:71b793021c78 478 /************************************************************************************
cotigac 19:71b793021c78 479 * MLMEGetAdditionalRFOffset
cotigac 19:71b793021c78 480 *
cotigac 19:71b793021c78 481 * This gets the frequency offset in respect to the current channel. Used for calibration.
cotigac 19:71b793021c78 482 *
cotigac 19:71b793021c78 483 * Interface assumptions:
cotigac 19:71b793021c78 484 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 485 *
cotigac 19:71b793021c78 486 * Arguments:
cotigac 19:71b793021c78 487 * None
cotigac 19:71b793021c78 488 *
cotigac 19:71b793021c78 489 * Return Value:
cotigac 19:71b793021c78 490 * calibration offset
cotigac 19:71b793021c78 491 *************************************************************************************/
cotigac 19:71b793021c78 492 extern uint32_t MLMEGetAdditionalRFOffset( void );
cotigac 19:71b793021c78 493
cotigac 19:71b793021c78 494 #endif
cotigac 19:71b793021c78 495 /************************************************************************************
cotigac 19:71b793021c78 496 * MLMEGetChannelRequest
cotigac 19:71b793021c78 497 *
cotigac 19:71b793021c78 498 * This function returns the current channel, if an error is detected it returns gChannelOutOfRange_c.
cotigac 19:71b793021c78 499 *
cotigac 19:71b793021c78 500 * Interface assumptions:
cotigac 19:71b793021c78 501 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 502 *
cotigac 19:71b793021c78 503 * Arguments:
cotigac 19:71b793021c78 504 * None
cotigac 19:71b793021c78 505 *
cotigac 19:71b793021c78 506 * Return Value:
cotigac 19:71b793021c78 507 * channels_t (uint8_t): The current RF channel.
cotigac 19:71b793021c78 508 * gChannelOutOfRange_c: If current channel could not be detected
cotigac 19:71b793021c78 509 *************************************************************************************/
cotigac 19:71b793021c78 510 extern channels_t MLMEGetChannelRequest(void);
cotigac 19:71b793021c78 511
cotigac 19:71b793021c78 512
cotigac 19:71b793021c78 513 /************************************************************************************
cotigac 19:71b793021c78 514 * MLMERssi
cotigac 19:71b793021c78 515 *
cotigac 19:71b793021c78 516 * This call starts an energy detect (ED) cycle and returns the energy value (-power/2)
cotigac 19:71b793021c78 517 * via the returned argument. For example, if the Energy Detect returns 80 then the
cotigac 19:71b793021c78 518 * interpreted value is -80/2 or -40 dBm
cotigac 19:71b793021c78 519 *
cotigac 19:71b793021c78 520 * Interface assumptions:
cotigac 19:71b793021c78 521 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 522 *
cotigac 19:71b793021c78 523 * Arguments:
cotigac 19:71b793021c78 524 * None
cotigac 19:71b793021c78 525 *
cotigac 19:71b793021c78 526 * Return Value:
cotigac 19:71b793021c78 527 * uint8_t: An unsigned 8-bit value representing the energy on the current channel.
cotigac 19:71b793021c78 528 *************************************************************************************/
cotigac 19:71b793021c78 529 #if defined(gPHY_802_15_4g_d)
cotigac 19:71b793021c78 530 extern uint8_t MLMERssi(void);
cotigac 19:71b793021c78 531 #endif
cotigac 19:71b793021c78 532
cotigac 19:71b793021c78 533 /************************************************************************************
cotigac 19:71b793021c78 534 * MLMESetCCADuration
cotigac 19:71b793021c78 535 *
cotigac 19:71b793021c78 536 * This call sets the amount of time necessary to perform CCA or ED
cotigac 19:71b793021c78 537 * Interface assumptions:
cotigac 19:71b793021c78 538 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 539 *
cotigac 19:71b793021c78 540 * Arguments:
cotigac 19:71b793021c78 541 * uint64_t usCCADuration: duration in microseconds
cotigac 19:71b793021c78 542 *
cotigac 19:71b793021c78 543 * Return Value:
cotigac 19:71b793021c78 544 * gErrorNoError_c in case of success, error code otherwise.
cotigac 19:71b793021c78 545 *************************************************************************************/
cotigac 19:71b793021c78 546 #if defined(gPHY_802_15_4g_d)
cotigac 19:71b793021c78 547 extern smacErrors_t MLMESetCCADuration(uint64_t usCCADuration );
cotigac 19:71b793021c78 548 #endif
cotigac 19:71b793021c78 549 /************************************************************************************
cotigac 19:71b793021c78 550 * MLMEPacketConfig
cotigac 19:71b793021c78 551 *
cotigac 19:71b793021c78 552 * This function sets the following parameters for OTA packets in radio�s registers:
cotigac 19:71b793021c78 553 * Preamble size, synchronization word size, and synchronization word value.
cotigac 19:71b793021c78 554 *
cotigac 19:71b793021c78 555 * Interface assumptions:
cotigac 19:71b793021c78 556 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 557 *
cotigac 19:71b793021c78 558 * Arguments:
cotigac 19:71b793021c78 559 * packetConfig_t *pPacketCfg
cotigac 19:71b793021c78 560 *
cotigac 19:71b793021c78 561 * Return Value:
cotigac 19:71b793021c78 562 * gErrorBusy_c: when SMAC is busy in other radio activity as transmitting or receiving data.
cotigac 19:71b793021c78 563 * Or performing a channel scan.
cotigac 19:71b793021c78 564 * gErrorNoError_c: the packet has been configured
cotigac 19:71b793021c78 565 *************************************************************************************/
cotigac 19:71b793021c78 566 #if defined(gPHY_802_15_4g_d)
cotigac 19:71b793021c78 567 extern smacErrors_t MLMEPacketConfig(packetConfig_t *pPacketCfg);
cotigac 19:71b793021c78 568 #endif
cotigac 19:71b793021c78 569 /************************************************************************************
cotigac 19:71b793021c78 570 * MLMERadioInit
cotigac 19:71b793021c78 571 *
cotigac 19:71b793021c78 572 * This function initializes the Radio parameters.
cotigac 19:71b793021c78 573 *
cotigac 19:71b793021c78 574 * Interface assumptions:
cotigac 19:71b793021c78 575 * None
cotigac 19:71b793021c78 576 *
cotigac 19:71b793021c78 577 * Arguments:
cotigac 19:71b793021c78 578 * None
cotigac 19:71b793021c78 579 *
cotigac 19:71b793021c78 580 * Return Value:
cotigac 19:71b793021c78 581 * gErrorNoError_c: the Radio initialization has been done successfully
cotigac 19:71b793021c78 582 *************************************************************************************/
cotigac 19:71b793021c78 583 #if defined(gPHY_802_15_4g_d)
cotigac 19:71b793021c78 584 extern smacErrors_t MLMERadioInit(void);
cotigac 19:71b793021c78 585 #endif
cotigac 19:71b793021c78 586 /************************************************************************************
cotigac 19:71b793021c78 587 * MLMEPhySoftReset
cotigac 19:71b793021c78 588 *
cotigac 19:71b793021c78 589 * This function performs a software reset on the radio, PHY and SMAC state machines.
cotigac 19:71b793021c78 590 *
cotigac 19:71b793021c78 591 * Interface assumptions:
cotigac 19:71b793021c78 592 * None
cotigac 19:71b793021c78 593 *
cotigac 19:71b793021c78 594 * Arguments:
cotigac 19:71b793021c78 595 * None
cotigac 19:71b793021c78 596 *
cotigac 19:71b793021c78 597 * Return Value:
cotigac 19:71b793021c78 598 * gErrorNoError_c: If the action is performed.
cotigac 19:71b793021c78 599 *************************************************************************************/
cotigac 19:71b793021c78 600 extern smacErrors_t MLMEPhySoftReset(void);
cotigac 19:71b793021c78 601
cotigac 19:71b793021c78 602 /************************************************************************************
cotigac 19:71b793021c78 603 * MLMEPAOutputAdjust
cotigac 19:71b793021c78 604 *
cotigac 19:71b793021c78 605 *
cotigac 19:71b793021c78 606 *************************************************************************************/
cotigac 19:71b793021c78 607 extern smacErrors_t MLMEPAOutputAdjust(uint8_t u8PaValue);
cotigac 19:71b793021c78 608
cotigac 19:71b793021c78 609 /************************************************************************************
cotigac 19:71b793021c78 610 * MLMESetPreambleLength
cotigac 19:71b793021c78 611 *
cotigac 19:71b793021c78 612 *
cotigac 19:71b793021c78 613 *************************************************************************************/
cotigac 19:71b793021c78 614 #if defined(gPHY_802_15_4g_d)
cotigac 19:71b793021c78 615 extern smacErrors_t MLMESetPreambleLength(uint16_t u16preambleLength);
cotigac 19:71b793021c78 616 #endif
cotigac 19:71b793021c78 617 /************************************************************************************
cotigac 19:71b793021c78 618 * MLMESetSyncWordValue
cotigac 19:71b793021c78 619 *
cotigac 19:71b793021c78 620 *
cotigac 19:71b793021c78 621 *************************************************************************************/
cotigac 19:71b793021c78 622 #if defined(gPHY_802_15_4g_d)
cotigac 19:71b793021c78 623 extern smacErrors_t MLMESetSyncWordValue(uint8_t *u8syncWordValue);
cotigac 19:71b793021c78 624 #endif
cotigac 19:71b793021c78 625 /************************************************************************************
cotigac 19:71b793021c78 626 * MLMESetSyncWordSize
cotigac 19:71b793021c78 627 *
cotigac 19:71b793021c78 628 *
cotigac 19:71b793021c78 629 *************************************************************************************/
cotigac 19:71b793021c78 630 #if defined(gPHY_802_15_4g_d)
cotigac 19:71b793021c78 631 extern smacErrors_t MLMESetSyncWordSize(uint8_t u8syncWordSize);
cotigac 19:71b793021c78 632 #endif
cotigac 19:71b793021c78 633 /************************************************************************************
cotigac 19:71b793021c78 634 * MLMESetFreqBand
cotigac 19:71b793021c78 635 *
cotigac 19:71b793021c78 636 *
cotigac 19:71b793021c78 637 *
cotigac 19:71b793021c78 638 ************************************************************************************/
cotigac 19:71b793021c78 639 #if defined(gPHY_802_15_4g_d)
cotigac 19:71b793021c78 640 extern smacErrors_t MLMESetFreqBand(smacFrequencyBands_t freqBand, smacRFModes_t phyMode);
cotigac 19:71b793021c78 641 #endif
cotigac 19:71b793021c78 642 /************************************************************************************
cotigac 19:71b793021c78 643 * MLMESetPhyMode
cotigac 19:71b793021c78 644 *
cotigac 19:71b793021c78 645 *
cotigac 19:71b793021c78 646 *
cotigac 19:71b793021c78 647 ************************************************************************************/
cotigac 19:71b793021c78 648 #if defined(gPHY_802_15_4g_d)
cotigac 19:71b793021c78 649 extern smacErrors_t MLMESetPhyMode(smacRFModes_t phyMode);
cotigac 19:71b793021c78 650 #endif
cotigac 19:71b793021c78 651 /***********************************************************************************/
cotigac 19:71b793021c78 652 /***************************** SMAC Management primitives **************************/
cotigac 19:71b793021c78 653 /***********************************************************************************/
cotigac 19:71b793021c78 654
cotigac 19:71b793021c78 655 /************************************************************************************
cotigac 19:71b793021c78 656 * MLMEScanRequest
cotigac 19:71b793021c78 657 *
cotigac 19:71b793021c78 658 * This function scans the channel passed as parameter using CCA or ED mode
cotigac 19:71b793021c78 659 * returns the RSSI in that channel.
cotigac 19:71b793021c78 660 *
cotigac 19:71b793021c78 661 * Interface assumptions:
cotigac 19:71b793021c78 662 * The SMAC and radio driver have been initialized and are ready to be used.
cotigac 19:71b793021c78 663 *
cotigac 19:71b793021c78 664 * Arguments:
cotigac 19:71b793021c78 665 * channels_t u8ChannelToScan: channel to scan
cotigac 19:71b793021c78 666 * uint8_t *u8ChannelScanResult: to return the RSSI value
cotigac 19:71b793021c78 667 *
cotigac 19:71b793021c78 668 * Return Value:
cotigac 19:71b793021c78 669 * gErrorNoError_c: If the action was performed correctly.
cotigac 19:71b793021c78 670 * gErrorBusy_c: If SMAC is busy.
cotigac 19:71b793021c78 671 *************************************************************************************/
cotigac 19:71b793021c78 672 extern smacErrors_t MLMEScanRequest(channels_t u8ChannelToScan);
cotigac 19:71b793021c78 673
cotigac 19:71b793021c78 674 /*@CMA, Conn Test Added*/
cotigac 19:71b793021c78 675 /************************************************************************************
cotigac 19:71b793021c78 676 * MLMECcaRequest
cotigac 19:71b793021c78 677 *
cotigac 19:71b793021c78 678 * This function performs Clear Channel Assessment on the active channel
cotigac 19:71b793021c78 679 *
cotigac 19:71b793021c78 680 * Return value:
cotigac 19:71b793021c78 681 * gErrorNoError_c: SMAC will perform Cca
cotigac 19:71b793021c78 682 * gErrorBusy_c: SMAC is busy
cotigac 19:71b793021c78 683 ************************************************************************************/
cotigac 19:71b793021c78 684 extern smacErrors_t MLMECcaRequest(void);
cotigac 19:71b793021c78 685
cotigac 19:71b793021c78 686 /************************************************************************************
cotigac 19:71b793021c78 687 * MLMETXDisableRequest
cotigac 19:71b793021c78 688 *
cotigac 19:71b793021c78 689 * Returns the radio to idle mode from Tx mode.
cotigac 19:71b793021c78 690 *
cotigac 19:71b793021c78 691 ************************************************************************************/
cotigac 19:71b793021c78 692 extern void MLMETXDisableRequest(void);
cotigac 19:71b793021c78 693
cotigac 19:71b793021c78 694 /***********************************************************************************
cotigac 19:71b793021c78 695 ******************************** SMAC MCU primitives *******************************
cotigac 19:71b793021c78 696 ***********************************************************************************/
cotigac 19:71b793021c78 697
cotigac 19:71b793021c78 698 /************************************************************************************
cotigac 19:71b793021c78 699 *SMAC auxiliary functions
cotigac 19:71b793021c78 700 *************************************************************************************/
cotigac 19:71b793021c78 701
cotigac 19:71b793021c78 702 /************************************************************************************
cotigac 19:71b793021c78 703 *SMACFillHeader
cotigac 19:71b793021c78 704 *This is a replacement for the u8DestAddress in the txPacket_t structure
cotigac 19:71b793021c78 705 *To set the destination address simply call this function with a pointer to
cotigac 19:71b793021c78 706 *txPacket->smacHeader and a uint16_t variable resembling the address.
cotigac 19:71b793021c78 707 *Also, to change the default source address and panID, modify gDefaultPanID_c and
cotigac 19:71b793021c78 708 *gNodeAddress_c from SMAC_Config.h or call SMACSetShortSrcAddress and SMACSetPanID.
cotigac 19:71b793021c78 709 *************************************************************************************/
cotigac 19:71b793021c78 710 extern void SMACFillHeader(smacHeader_t* pSmacHeader, uint16_t destAddr);
cotigac 19:71b793021c78 711
cotigac 19:71b793021c78 712 /***********************************************************************************/
cotigac 19:71b793021c78 713 extern smacErrors_t SMACSetShortSrcAddress(uint16_t nwShortAddress);
cotigac 19:71b793021c78 714
cotigac 19:71b793021c78 715 /***********************************************************************************/
cotigac 19:71b793021c78 716 extern smacErrors_t SMACSetPanID(uint16_t nwShortPanID);
cotigac 19:71b793021c78 717
cotigac 19:71b793021c78 718 /***********************************************************************************/
cotigac 19:71b793021c78 719
cotigac 19:71b793021c78 720
cotigac 19:71b793021c78 721
cotigac 19:71b793021c78 722 #endif /* SMAC_INTERFACE_H_ */
cotigac 19:71b793021c78 723