Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LoRaMacChannelPlan.h Source File

LoRaMacChannelPlan.h

00001 /**
00002  \code
00003  / _____)             _              | |
00004 ( (____  _____ ____ _| |_ _____  ____| |__
00005  \____ \| ___ |    (_   _) ___ |/ ___)  _ \
00006  _____) ) ____| | | || |_| ____( (___| | | |
00007 (______/|_____)_|_|_| \__)_____)\____)_| |_|
00008     (C)2013 Semtech
00009  ___ _____ _   ___ _  _____ ___  ___  ___ ___
00010 / __|_   _/_\ / __| |/ / __/ _ \| _ \/ __| __|
00011 \__ \ | |/ _ \ (__| ' <| _| (_) |   / (__| _|
00012 |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___|
00013 embedded.connectivity.solutions===============
00014 \endcode
00015 
00016 Description: LoRaWAN stack layer that controls both MAC and PHY underneath
00017 
00018 License: Revised BSD License, see LICENSE.TXT file include in the project
00019 
00020 Maintainer: Miguel Luis ( Semtech ), Gregory Cristian ( Semtech ) and Daniel Jaeckle ( STACKFORCE )
00021 
00022 
00023 Copyright (c) 2017, Arm Limited and affiliates.
00024 
00025 SPDX-License-Identifier: BSD-3-Clause
00026 */
00027 
00028 #ifndef MBED_LORAWAN_LORAMACCHANNELPLAN_H_
00029 #define MBED_LORAWAN_LORAMACCHANNELPLAN_H_
00030 
00031 #include "system/lorawan_data_structures.h"
00032 #include "lorastack/phy/LoRaPHY.h"
00033 
00034 class LoRaMacChannelPlan {
00035 
00036 public:
00037 
00038     /** Constructor
00039      *
00040      * Sets local handles to NULL. These handles will be set when the subsystem
00041      * is activated by the MAC layer.
00042      */
00043     LoRaMacChannelPlan();
00044 
00045     /** Destructor
00046      *
00047      * Does nothing
00048      */
00049     ~LoRaMacChannelPlan();
00050 
00051     /** Activates Channel Planning subsystem
00052      *
00053      * Stores pointers to PHY layer MIB subsystem
00054      *
00055      * @param phy    pointer to PHY layer
00056      */
00057     void activate_channelplan_subsystem(LoRaPHY *phy);
00058 
00059     /** Set a given channel plan
00060      *
00061      * Used to set application provided channel plan. This API can be used to
00062      * set a single channel as well to the existing channel plan.
00063      *
00064      * @param plan    a reference to application channel plan. PHY layer takes a
00065      *                copy of the channel parameters provided within.
00066      *
00067      * @return        LORAWAN_STATUS_OK if everything goes well otherwise
00068      *                a negative error code is returned.
00069      */
00070     lorawan_status_t set_plan(const lorawan_channelplan_t &plan);
00071 
00072     /** Access the active channel plan
00073      *
00074      * Used to get active channel plan.
00075      *
00076      * @param plan          a reference to application provided channel plan structure
00077      *                      which gets filled in with active channel plan data.
00078      *
00079      * @param channel_list  pointer to structure containing channel information
00080      *
00081      * @return              LORAWAN_STATUS_OK if everything goes well otherwise
00082      *                      a negative error code is returned.
00083      */
00084     lorawan_status_t get_plan(lorawan_channelplan_t &plan, const channel_params_t *channel_list);
00085 
00086     /** Remove the active channel plan
00087      *
00088      * Drops the whole channel list except the 'Default Channels' ofcourse.
00089      *
00090      * @return        LORAWAN_STATUS_OK if everything goes well otherwise
00091      *                a negative error code is returned.
00092      */
00093     lorawan_status_t remove_plan();
00094 
00095     /** Remove a single channel from the plan
00096      *
00097      * @param id    the channel id which needs to be removed
00098      *
00099      * @return      LORAWAN_STATUS_OK if everything goes well otherwise
00100      *              a negative error code is returned.
00101      */
00102     lorawan_status_t remove_single_channel(uint8_t id);
00103 
00104 private:
00105 
00106     /**
00107      * Local handles
00108      */
00109     LoRaPHY *_lora_phy;
00110 };
00111 
00112 
00113 
00114 #endif /* MBED_LORAWAN_LORAMACCHANNELPLAN_H_ */