Skip to content

Commit

Permalink
Merge pull request #15471 from hallard/LoRaWAN_set_antenna_gain
Browse files Browse the repository at this point in the history
LoRaWAN allow to adapt antenna gain
  • Loading branch information
0xc0170 authored Dec 20, 2023
2 parents 61ab4f7 + deb09a3 commit baf6a30
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 1 deletion.
4 changes: 4 additions & 0 deletions connectivity/lorawan/lorastack/phy/LoRaPHYAS923.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define AS923_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define AS923_DEFAULT_ANTENNA_GAIN 2.15f
#endif

/*!
* ADR Ack limit
Expand Down
4 changes: 4 additions & 0 deletions connectivity/lorawan/lorastack/phy/LoRaPHYAU915.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define AU915_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define AU915_DEFAULT_ANTENNA_GAIN 2.15f
#endif

/*!
* ADR Ack limit
Expand Down
4 changes: 4 additions & 0 deletions connectivity/lorawan/lorastack/phy/LoRaPHYCN470.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define CN470_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define CN470_DEFAULT_ANTENNA_GAIN 2.15f
#endif

/*!
* ADR Ack limit
Expand Down
4 changes: 4 additions & 0 deletions connectivity/lorawan/lorastack/phy/LoRaPHYCN779.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define CN779_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define CN779_DEFAULT_ANTENNA_GAIN 2.15f
#endif

/*!
* ADR Ack limit
Expand Down
4 changes: 4 additions & 0 deletions connectivity/lorawan/lorastack/phy/LoRaPHYEU433.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define EU433_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define EU433_DEFAULT_ANTENNA_GAIN 2.15f
#endif

/*!
* ADR Ack limit
Expand Down
4 changes: 4 additions & 0 deletions connectivity/lorawan/lorastack/phy/LoRaPHYEU868.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define EU868_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define EU868_DEFAULT_ANTENNA_GAIN 2.15f
#endif

/*!
* ADR Ack limit
Expand Down
4 changes: 4 additions & 0 deletions connectivity/lorawan/lorastack/phy/LoRaPHYIN865.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define IN865_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define IN865_DEFAULT_ANTENNA_GAIN 2.15f
#endif

/*!
* ADR Ack limit
Expand Down
4 changes: 4 additions & 0 deletions connectivity/lorawan/lorastack/phy/LoRaPHYKR920.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@
/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define KR920_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define KR920_DEFAULT_ANTENNA_GAIN 2.15f
#endif

/*!
* ADR Ack limit
Expand Down
11 changes: 10 additions & 1 deletion connectivity/lorawan/lorastack/phy/LoRaPHYUS915.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@
*/
#define US915_DEFAULT_MAX_ERP 30.0f

/*!
* Default antenna gain
*/
#ifdef LORAPHY_ANTENNA_GAIN
#define US915_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
#else
#define US915_DEFAULT_ANTENNA_GAIN 0.00f
#endif

/*!
* ADR Ack limit
*/
Expand Down Expand Up @@ -299,7 +308,7 @@ LoRaPHYUS915::LoRaPHYUS915()
phy_params.max_tx_power = US915_MAX_TX_POWER;
phy_params.default_tx_power = US915_DEFAULT_TX_POWER;
phy_params.default_max_eirp = 0;
phy_params.default_antenna_gain = 0;
phy_params.default_antenna_gain = US915_DEFAULT_ANTENNA_GAIN;
phy_params.adr_ack_limit = US915_ADR_ACK_LIMIT;
phy_params.adr_ack_delay = US915_ADR_ACK_DELAY;
phy_params.max_rx_window = US915_MAX_RX_WINDOW;
Expand Down

0 comments on commit baf6a30

Please sign in to comment.