Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
491 changes: 10 additions & 481 deletions features/lorawan/LoRaWANBase.h

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion features/lorawan/LoRaWANInterface.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @file
*
* @brief Implementation of LoRaWANBase
* @brief A LoRaWAN network interface
*
* Copyright (c) 2017, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
Expand All @@ -21,7 +21,10 @@

#include "LoRaWANInterface.h"
#include "lorastack/phy/loraphy_target.h"
#include "mbed-trace/mbed_trace.h"
#define TRACE_GROUP "LSTK"

using namespace mbed;
using namespace events;

LoRaWANInterface::LoRaWANInterface(LoRaRadio &radio)
Expand Down
534 changes: 505 additions & 29 deletions features/lorawan/LoRaWANInterface.h

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions features/lorawan/LoRaWANStack.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@

class LoRaPHY;

/** LoRaWANStack Class
* A controller layer for LoRaWAN MAC and PHY
*/
class LoRaWANStack: private mbed::NonCopyable<LoRaWANStack> {

public:
Expand Down
3 changes: 3 additions & 0 deletions features/lorawan/lorastack/mac/LoRaMac.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@

#include "platform/ScopedLock.h"

/** LoRaMac Class
* Implementation of LoRaWAN MAC layer
*/
class LoRaMac {

public:
Expand Down
3 changes: 3 additions & 0 deletions features/lorawan/lorastack/mac/LoRaMacCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@

class LoRaMac;

/** LoRaMacCommand Class
* Helper class for LoRaMac layer to handle any MAC commands
*/
class LoRaMacCommand {

public:
Expand Down
3 changes: 3 additions & 0 deletions features/lorawan/lorastack/phy/LoRaPHY.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
#include "LoRaRadio.h"
#include "lora_phy_ds.h"

/** LoRaPHY Class
* Parent class for LoRa regional PHY implementations
*/
class LoRaPHY : private mbed::NonCopyable<LoRaPHY> {

public:
Expand Down
4 changes: 3 additions & 1 deletion features/lorawan/lorastack/phy/LoRaPHYAS923.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#ifndef MBED_OS_LORAPHY_AS923_H_
#define MBED_OS_LORAPHY_AS923_H_

#if !(DOXYGEN_ONLY)

#include "LoRaPHY.h"

/*!
Expand All @@ -46,7 +48,6 @@

#define AS923_CHANNEL_MASK_SIZE 1


class LoRaPHYAS923 : public LoRaPHY {

public:
Expand All @@ -68,4 +69,5 @@ class LoRaPHYAS923 : public LoRaPHY {
uint16_t default_channel_mask[AS923_CHANNEL_MASK_SIZE];
};

#endif /* DOXYGEN_ONLY*/
#endif /* MBED_OS_LORAPHY_AS923_H_ */
5 changes: 4 additions & 1 deletion features/lorawan/lorastack/phy/LoRaPHYAU915.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

#define MBED_OS_LORAPHY_AU915_H_

#if !(DOXYGEN_ONLY)

#include "LoRaPHY.h"

// Definitions
Expand All @@ -48,7 +50,6 @@

#define AU915_CHANNEL_MASK_SIZE 5


class LoRaPHYAU915 : public LoRaPHY {

public:
Expand Down Expand Up @@ -126,4 +127,6 @@ class LoRaPHYAU915 : public LoRaPHY {
uint16_t default_channel_mask[AU915_CHANNEL_MASK_SIZE];
};

#endif /* DOXYGEN_ONLY*/
#endif /* MBED_OS_LORAPHY_AU915_H_ */

3 changes: 3 additions & 0 deletions features/lorawan/lorastack/phy/LoRaPHYCN470.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#ifndef MBED_OS_LORAPHY_CN470_H_
#define MBED_OS_LORAPHY_CN470_H_

#if !(DOXYGEN_ONLY)

#include "LoRaPHY.h"

// Definitions
Expand Down Expand Up @@ -94,4 +96,5 @@ class LoRaPHYCN470 : public LoRaPHY {
uint16_t default_channel_mask[CN470_CHANNEL_MASK_SIZE];
};

#endif /* DOXYGEN_ONLY*/
#endif /* MBED_OS_LORAPHY_CN470_H_ */
3 changes: 3 additions & 0 deletions features/lorawan/lorastack/phy/LoRaPHYCN779.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#ifndef MBED_OS_LORAPHY_CN779_H_
#define MBED_OS_LORAPHY_CN779_H_

#if !(DOXYGEN_ONLY)

#include "LoRaPHY.h"

#define CN779_MAX_NB_CHANNELS 16
Expand Down Expand Up @@ -70,4 +72,5 @@ class LoRaPHYCN779 : public LoRaPHY {
uint16_t default_channel_mask[CN779_CHANNEL_MASK_SIZE];
};

#endif /* DOXYGEN_ONLY*/
#endif /* MBED_OS_LORAPHY_CN779_H_ */
4 changes: 3 additions & 1 deletion features/lorawan/lorastack/phy/LoRaPHYEU433.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#ifndef MBED_OS_LORAPHY_EU433_H_
#define MBED_OS_LORAPHY_EU433_H_

#if !(DOXYGEN_ONLY)

#include "LoRaPHY.h"

/*!
Expand Down Expand Up @@ -76,5 +78,5 @@ class LoRaPHYEU433 : public LoRaPHY {
uint16_t default_channel_mask[EU433_CHANNEL_MASK_SIZE];
};


#endif /* DOXYGEN_ONLY*/
#endif /* MBED_OS_LORAPHY_EU433_H_ */
3 changes: 3 additions & 0 deletions features/lorawan/lorastack/phy/LoRaPHYEU868.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#ifndef MBED_OS_LORAPHY_EU868_H_
#define MBED_OS_LORAPHY_EU868_H_

#if !(DOXYGEN_ONLY)

#include "LoRaPHY.h"

/*!
Expand Down Expand Up @@ -79,4 +81,5 @@ class LoRaPHYEU868 : public LoRaPHY {
uint16_t default_channel_mask[EU868_CHANNEL_MASK_SIZE];
};

#endif /* DOXYGEN_ONLY*/
#endif /* MBED_OS_LORAPHY_EU868_H_ */
4 changes: 3 additions & 1 deletion features/lorawan/lorastack/phy/LoRaPHYIN865.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
#ifndef MBED_OS_LORAPHY_IN865_H_
#define MBED_OS_LORAPHY_IN865_H_

#include "LoRaPHY.h"
#if !(DOXYGEN_ONLY)

#include "LoRaPHY.h"

/*!
* LoRaMac maximum number of channels
Expand Down Expand Up @@ -79,4 +80,5 @@ class LoRaPHYIN865 : public LoRaPHY {
uint16_t default_channel_mask[IN865_CHANNEL_MASK_SIZE];
};

#endif /* DOXYGEN_ONLY */
#endif /* MBED_OS_LORAPHY_IN865_H_ */
3 changes: 3 additions & 0 deletions features/lorawan/lorastack/phy/LoRaPHYKR920.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#ifndef MBED_OS_LORAPHY_KR920_H_
#define MBED_OS_LORAPHY_KR920_H_

#if !(DOXYGEN_ONLY)

#include "LoRaPHY.h"

/*!
Expand Down Expand Up @@ -92,5 +94,6 @@ class LoRaPHYKR920 : public LoRaPHY {
uint16_t default_channel_mask[KR920_CHANNEL_MASK_SIZE];
};

#endif /* DOXYGEN_ONLY */
#endif // MBED_OS_LORAPHY_KR920_H_

3 changes: 3 additions & 0 deletions features/lorawan/lorastack/phy/LoRaPHYUS915.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#ifndef MBED_OS_LORAPHYUS_915_H_
#define MBED_OS_LORAPHYUS_915_H_

#if !(DOXYGEN_ONLY)

#include "LoRaPHY.h"

/*!
Expand Down Expand Up @@ -129,4 +131,5 @@ class LoRaPHYUS915 : public LoRaPHY {
uint16_t default_channel_mask[US915_CHANNEL_MASK_SIZE];
};

#endif /* DOXYGEN_ONLY */
#endif /* MBED_OS_LORAPHY_US915_H_ */
12 changes: 10 additions & 2 deletions features/lorawan/lorastack/phy/lora_phy_ds.h
Original file line number Diff line number Diff line change
Expand Up @@ -480,21 +480,29 @@ typedef struct continuous_wave_mode_params_s {
uint16_t timeout;
} cw_mode_params_t;

/*!
* Template for a table
*/
typedef struct {
void *table;
uint8_t size;
} loraphy_table_t;

/*!
* Contains information regarding channel configuration of
* a given PHY
*/
typedef struct {

uint8_t channel_list_size;
uint8_t mask_size;

uint16_t *mask;
uint16_t *default_mask;
channel_params_t *channel_list;
} loraphy_channels_t;

/*!
* Global configuration parameters of a given PHY
*/
typedef struct {
bool duty_cycle_enabled;
bool accept_tx_param_setup_req;
Expand Down
9 changes: 9 additions & 0 deletions features/lorawan/system/lorawan_data_structures.h
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,9 @@ typedef struct {
int timer_id;
} timer_event_t;

/*!
* A composite structure containing device identifiers and security keys
*/
typedef struct {
/*!
* Device IEEE EUI
Expand Down Expand Up @@ -1070,6 +1073,9 @@ typedef struct {

} loramac_keys;

/*!
* A composite structure containing all the timers used in the LoRaWAN operation
*/
typedef struct {
/*!
* Aggregated duty cycle management
Expand Down Expand Up @@ -1107,6 +1113,9 @@ typedef struct {

} lorawan_timers;

/*!
* Global MAC layer configuration parameters
*/
typedef struct {

/*!
Expand Down