BA / Mbed OS BaBoRo1
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LoRaMacMlme.h Source File

LoRaMacMlme.h

00001 /**
00002  / _____)             _              | |
00003 ( (____  _____ ____ _| |_ _____  ____| |__
00004  \____ \| ___ |    (_   _) ___ |/ ___)  _ \
00005  _____) ) ____| | | || |_| ____( (___| | | |
00006 (______/|_____)_|_|_| \__)_____)\____)_| |_|
00007     (C)2013 Semtech
00008  ___ _____ _   ___ _  _____ ___  ___  ___ ___
00009 / __|_   _/_\ / __| |/ / __/ _ \| _ \/ __| __|
00010 \__ \ | |/ _ \ (__| ' <| _| (_) |   / (__| _|
00011 |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___|
00012 embedded.connectivity.solutions===============
00013 
00014 Description: LoRaWAN stack layer that controls both MAC and PHY underneath
00015 
00016 License: Revised BSD License, see LICENSE.TXT file include in the project
00017 
00018 Maintainer: Miguel Luis ( Semtech ), Gregory Cristian ( Semtech ) and Daniel Jaeckle ( STACKFORCE )
00019 
00020 
00021 Copyright (c) 2017, Arm Limited and affiliates.
00022 
00023 SPDX-License-Identifier: BSD-3-Clause
00024 */
00025 
00026 #ifndef MBED_OS_LORAWAN_MAC_MLME_H_
00027 #define MBED_OS_LORAWAN_MAC_MLME_H_
00028 
00029 #include "lorawan/system/lorawan_data_structures.h"
00030 #include "lorastack/phy/LoRaPHY.h"
00031 
00032 // forward declaration
00033 class LoRaMac;
00034 
00035 class LoRaMacMlme {
00036 
00037 public:
00038 
00039     /** Constructor
00040      *
00041      * Sets local handles to NULL. These handles will be set when the subsystem
00042      * is activated by the MAC layer.
00043      */
00044     LoRaMacMlme();
00045 
00046     /** Destructor
00047      *
00048      * Does nothing
00049      */
00050     ~LoRaMacMlme();
00051 
00052     /**
00053      * @brief reset_confirmation Resets the confirmation struct
00054      */
00055     void reset_confirmation();
00056 
00057     /** Activating MLME subsystem
00058      *
00059      * Stores pointers to MAC and PHY layer handles
00060      *
00061      * @param phy    pointer to PHY layer
00062      */
00063     void activate_mlme_subsystem(LoRaPHY *phy);
00064 
00065     /** Grants access to MLME confirmation data
00066      *
00067      * @return               a reference to MLME confirm data structure
00068      */
00069     loramac_mlme_confirm_t & get_confirmation();
00070 
00071     /** Grants access to MLME indication data
00072      *
00073      * @return               a reference to MLME indication data structure
00074      */
00075     loramac_mlme_indication_t & get_indication();
00076 
00077     /**
00078      * @brief set_tx_continuous_wave Puts the system in continuous transmission mode
00079      * @param [in] channel A Channel to use
00080      * @param [in] datarate A datarate to use
00081      * @param [in] tx_power A RF output power to use
00082      * @param [in] max_eirp A maximum possible EIRP to use
00083      * @param [in] antenna_gain Antenna gain to use
00084      * @param [in] timeout Time in seconds while the radio is kept in continuous wave mode
00085      */
00086     void set_tx_continuous_wave(uint8_t channel, int8_t datarate, int8_t tx_power,
00087                                 float max_eirp, float antenna_gain, uint16_t timeout);
00088 
00089 private:
00090 
00091     /**
00092      * Pointer to PHY handle
00093      */
00094     LoRaPHY *_lora_phy;
00095 
00096     /**
00097      * Structure to hold MLME indication data.
00098      */
00099     loramac_mlme_indication_t  indication;
00100 
00101     /**
00102      * Structure to hold MLME confirm data.
00103      */
00104     loramac_mlme_confirm_t  confirmation;
00105 };
00106 
00107 #endif /* MBED_OS_LORAWAN_MAC_MLME_H_ */