Denislam Valeev / Mbed OS Nucleo_rtos_basic
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LoRaMacMib.h Source File

LoRaMacMib.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_MIB_H_
00027 #define MBED_OS_LORAWAN_MAC_MIB_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 LoRaMacMib {
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     LoRaMacMib();
00045 
00046     /** Destructor
00047      *
00048      * Does nothing
00049      */
00050     ~LoRaMacMib();
00051 
00052     /** Activating MLME subsystem
00053      *
00054      * Stores pointers to MAC and PHY layer handles
00055      *
00056      * @param mac    pointer to MAC layer
00057      * @param phy    pointer to PHY layer
00058      */
00059     void activate_mib_subsystem(LoRaMac *mac, LoRaPHY *phy);
00060 
00061     /** Sets up a MIB Request
00062      *
00063      * Used to configure MAC protocol parameters using appropriate
00064      * key/value pair in the MIB request structure. Use this API to set
00065      * any system wide configurable parameter exposed by MIB service.
00066      *
00067      * @param mibSet [in]    pointer to MIB request structure
00068      * @param params         pointer to MAC protocol parameters which will be modified
00069      *
00070      * @return               LORAWAN_STATUS_OK if everything goes well otherwise
00071      *                       a negative error code is returned.
00072      */
00073     lorawan_status_t set_request(loramac_mib_req_confirm_t  *mibSet,
00074                                  loramac_protocol_params *params);
00075 
00076     /** Provides access to the given MIB parameter
00077      *
00078      * Used to extract information about system wide MAC protocol parameters
00079      * which are exposed by MIB service.
00080      *
00081      * @param mibGet [out]   pointer to MIB request structure which will be filled in
00082      * @param params         pointer to MAC protocol parameters
00083      *
00084      * @return               LORAWAN_STATUS_OK if everything goes well otherwise
00085      *                       a negative error code is returned.
00086      */
00087     lorawan_status_t get_request(loramac_mib_req_confirm_t  *mibGet,
00088                                  loramac_protocol_params *params);
00089 
00090 private:
00091 
00092     /**
00093      * Pointers to MAC and PHY handles
00094      */
00095     LoRaMac *_lora_mac;
00096     LoRaPHY *_lora_phy;
00097 };
00098 
00099 
00100 
00101 
00102 #endif /* MBED_OS_LORAWAN_MAC_MIB_H_ */