diff --git a/UNITTESTS/features/lorawan/loraphy/Test_LoRaPHY.cpp b/UNITTESTS/features/lorawan/loraphy/Test_LoRaPHY.cpp index 6220649ec5..ebb66257af 100644 --- a/UNITTESTS/features/lorawan/loraphy/Test_LoRaPHY.cpp +++ b/UNITTESTS/features/lorawan/loraphy/Test_LoRaPHY.cpp @@ -124,10 +124,6 @@ public: return bool_value; }; - virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) - { - }; - virtual void lock(void) { }; @@ -754,30 +750,6 @@ TEST_F(Test_LoRaPHY, remove_channel) EXPECT_TRUE(true == object->remove_channel(0)); } -TEST_F(Test_LoRaPHY, set_tx_cont_mode) -{ - channel_params_t pp; - pp.band = 0; - object->get_phy_params().channels.channel_list = &pp; - band_t b; - b.max_tx_pwr = 10; - object->get_phy_params().bands.table = &b; - my_radio radio; - object->set_radio_instance(radio); - - cw_mode_params_t p; - p.max_eirp = 0; - p.channel = 0; - p.tx_power = -1; - p.datarate = 0; - p.antenna_gain = 1; - object->set_tx_cont_mode(&p); - - p.max_eirp = 1; - p.antenna_gain = 1; - object->set_tx_cont_mode(&p, 1); -} - TEST_F(Test_LoRaPHY, apply_DR_offset) { EXPECT_TRUE(0 == object->apply_DR_offset(0, 0)); diff --git a/UNITTESTS/features/lorawan/loraphyas923/Test_LoRaPHYAS923.cpp b/UNITTESTS/features/lorawan/loraphyas923/Test_LoRaPHYAS923.cpp index 47e9b76212..5f96e9132b 100644 --- a/UNITTESTS/features/lorawan/loraphyas923/Test_LoRaPHYAS923.cpp +++ b/UNITTESTS/features/lorawan/loraphyas923/Test_LoRaPHYAS923.cpp @@ -107,10 +107,6 @@ public: return bool_value; }; - virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) - { - }; - virtual void lock(void) { }; diff --git a/UNITTESTS/features/lorawan/loraphyau915/Test_LoRaPHYAU915.cpp b/UNITTESTS/features/lorawan/loraphyau915/Test_LoRaPHYAU915.cpp index 93ff3d29e0..3a8d9753e1 100644 --- a/UNITTESTS/features/lorawan/loraphyau915/Test_LoRaPHYAU915.cpp +++ b/UNITTESTS/features/lorawan/loraphyau915/Test_LoRaPHYAU915.cpp @@ -107,10 +107,6 @@ public: return bool_value; }; - virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) - { - }; - virtual void lock(void) { }; diff --git a/UNITTESTS/features/lorawan/loraphycn470/Test_LoRaPHYCN470.cpp b/UNITTESTS/features/lorawan/loraphycn470/Test_LoRaPHYCN470.cpp index 20e8fc3be2..cd67158b57 100644 --- a/UNITTESTS/features/lorawan/loraphycn470/Test_LoRaPHYCN470.cpp +++ b/UNITTESTS/features/lorawan/loraphycn470/Test_LoRaPHYCN470.cpp @@ -107,10 +107,6 @@ public: return bool_value; }; - virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) - { - }; - virtual void lock(void) { }; diff --git a/UNITTESTS/features/lorawan/loraphykr920/Test_LoRaPHYKR920.cpp b/UNITTESTS/features/lorawan/loraphykr920/Test_LoRaPHYKR920.cpp index 5a170a1f29..4f6af2ac49 100644 --- a/UNITTESTS/features/lorawan/loraphykr920/Test_LoRaPHYKR920.cpp +++ b/UNITTESTS/features/lorawan/loraphykr920/Test_LoRaPHYKR920.cpp @@ -106,10 +106,6 @@ public: return bool_value; }; - virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) - { - }; - virtual void lock(void) { }; @@ -189,12 +185,3 @@ TEST_F(Test_LoRaPHYKR920, set_next_channel) radio.bool_value = true; EXPECT_TRUE(LORAWAN_STATUS_OK == object->set_next_channel(&next_channel, &ch, &backoff_time, &time)); } - -TEST_F(Test_LoRaPHYKR920, set_tx_cont_mode) -{ - cw_mode_params_t params; - memset(¶ms, 0, sizeof(params)); - params.tx_power = 9; - object->set_tx_cont_mode(¶ms, 0); -} - diff --git a/UNITTESTS/features/lorawan/loraphyus915/Test_LoRaPHYUS915.cpp b/UNITTESTS/features/lorawan/loraphyus915/Test_LoRaPHYUS915.cpp index 82d9e7b685..d88827f5db 100644 --- a/UNITTESTS/features/lorawan/loraphyus915/Test_LoRaPHYUS915.cpp +++ b/UNITTESTS/features/lorawan/loraphyus915/Test_LoRaPHYUS915.cpp @@ -107,10 +107,6 @@ public: return bool_value; }; - virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) - { - }; - virtual void lock(void) { }; @@ -284,13 +280,3 @@ TEST_F(Test_LoRaPHYUS915, apply_DR_offset) } } } - -TEST_F(Test_LoRaPHYUS915, set_tx_cont_mode) -{ - cw_mode_params_t p; - memset(&p, 0, sizeof(p)); - object->set_tx_cont_mode(&p, 0); - - p.datarate = 4; - object->set_tx_cont_mode(&p, 0); -} diff --git a/UNITTESTS/features/lorawan/lorawaninterface/Test_LoRaWANInterface.cpp b/UNITTESTS/features/lorawan/lorawaninterface/Test_LoRaWANInterface.cpp index f4506a815c..8a6602ab34 100644 --- a/UNITTESTS/features/lorawan/lorawaninterface/Test_LoRaWANInterface.cpp +++ b/UNITTESTS/features/lorawan/lorawaninterface/Test_LoRaWANInterface.cpp @@ -103,10 +103,6 @@ public: { }; - virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) - { - }; - virtual void lock(void) { }; diff --git a/UNITTESTS/features/lorawan/lorawanstack/Test_LoRaWANStack.cpp b/UNITTESTS/features/lorawan/lorawanstack/Test_LoRaWANStack.cpp index 9fc72b1077..9e1ffc0729 100644 --- a/UNITTESTS/features/lorawan/lorawanstack/Test_LoRaWANStack.cpp +++ b/UNITTESTS/features/lorawan/lorawanstack/Test_LoRaWANStack.cpp @@ -133,10 +133,6 @@ public: return bool_value; }; - virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) - { - }; - virtual void lock(void) { }; diff --git a/UNITTESTS/stubs/LoRaMac_stub.cpp b/UNITTESTS/stubs/LoRaMac_stub.cpp index 083115d38a..6072caee05 100644 --- a/UNITTESTS/stubs/LoRaMac_stub.cpp +++ b/UNITTESTS/stubs/LoRaMac_stub.cpp @@ -383,11 +383,6 @@ void LoRaMac::reset_mcps_indication() { } -void LoRaMac::set_tx_continuous_wave(uint8_t channel, int8_t datarate, int8_t tx_power, - float max_eirp, float antenna_gain, uint16_t timeout) -{ -} - lorawan_status_t LoRaMac::initialize(EventQueue *queue, mbed::Callbackscheduling_failure_handler) { diff --git a/UNITTESTS/stubs/LoRaPHY_stub.cpp b/UNITTESTS/stubs/LoRaPHY_stub.cpp index 1cb6542042..c1e033fd4c 100644 --- a/UNITTESTS/stubs/LoRaPHY_stub.cpp +++ b/UNITTESTS/stubs/LoRaPHY_stub.cpp @@ -407,10 +407,6 @@ bool LoRaPHY::remove_channel(uint8_t channel_id) return LoRaPHY_stub::bool_table[LoRaPHY_stub::bool_counter++]; } -void LoRaPHY::set_tx_cont_mode(cw_mode_params_t *params, uint32_t given_frequency) -{ -} - uint8_t LoRaPHY::apply_DR_offset(int8_t dr, int8_t dr_offset) { return LoRaPHY_stub::uint8_value; diff --git a/features/lorawan/LoRaRadio.h b/features/lorawan/LoRaRadio.h index 601c6b9e52..7a3e8266cf 100644 --- a/features/lorawan/LoRaRadio.h +++ b/features/lorawan/LoRaRadio.h @@ -644,14 +644,6 @@ public: */ virtual bool check_rf_frequency(uint32_t frequency) = 0; - /** Sets the radio to continuous wave transmission mode. - * - * @param freq The RF frequency of the channel. - * @param power The output power [dBm]. - * @param time The transmission mode timeout [s]. - */ - virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time) = 0; - /** * Acquires exclusive access to this radio. */ diff --git a/features/lorawan/lorastack/mac/LoRaMac.h b/features/lorawan/lorastack/mac/LoRaMac.h index e6696e87a9..7b36bfb560 100644 --- a/features/lorawan/lorastack/mac/LoRaMac.h +++ b/features/lorawan/lorastack/mac/LoRaMac.h @@ -638,18 +638,6 @@ private: void reset_mcps_confirmation(void); void reset_mcps_indication(void); - /** - * @brief set_tx_continuous_wave Puts the system in continuous transmission mode - * @param [in] channel A Channel to use - * @param [in] datarate A datarate to use - * @param [in] tx_power A RF output power to use - * @param [in] max_eirp A maximum possible EIRP to use - * @param [in] antenna_gain Antenna gain to use - * @param [in] timeout Time in seconds while the radio is kept in continuous wave mode - */ - void set_tx_continuous_wave(uint8_t channel, int8_t datarate, int8_t tx_power, - float max_eirp, float antenna_gain, uint16_t timeout); - /** * Calculate MIC for user data messages */ diff --git a/features/lorawan/lorastack/phy/LoRaPHY.cpp b/features/lorawan/lorastack/phy/LoRaPHY.cpp index ffb6586e10..20fd84a299 100644 --- a/features/lorawan/lorastack/phy/LoRaPHY.cpp +++ b/features/lorawan/lorastack/phy/LoRaPHY.cpp @@ -1474,37 +1474,6 @@ bool LoRaPHY::remove_channel(uint8_t channel_id) phy_params.max_channel_cnt); } -void LoRaPHY::set_tx_cont_mode(cw_mode_params_t *params, uint32_t given_frequency) -{ - band_t *bands_table = (band_t *) phy_params.bands.table; - channel_params_t *channels = phy_params.channels.channel_list; - - if (params->tx_power > bands_table[channels[params->channel].band].max_tx_pwr) { - params->tx_power = bands_table[channels[params->channel].band].max_tx_pwr; - } - - int8_t phy_tx_power = 0; - uint32_t frequency = 0; - - if (given_frequency == 0) { - frequency = channels[params->channel].frequency; - } else { - frequency = given_frequency; - } - - // Calculate physical TX power - if (params->max_eirp > 0 && params->antenna_gain > 0) { - phy_tx_power = compute_tx_power(params->tx_power, params->max_eirp, - params->antenna_gain); - } else { - phy_tx_power = params->tx_power; - } - - _radio->lock(); - _radio->set_tx_continuous_wave(frequency, phy_tx_power, params->timeout); - _radio->unlock(); -} - uint8_t LoRaPHY::apply_DR_offset(int8_t dr, int8_t dr_offset) { int8_t datarate = dr - dr_offset; diff --git a/features/lorawan/lorastack/phy/LoRaPHY.h b/features/lorawan/lorastack/phy/LoRaPHY.h index dfaaa9650f..a9f7558308 100644 --- a/features/lorawan/lorastack/phy/LoRaPHY.h +++ b/features/lorawan/lorastack/phy/LoRaPHY.h @@ -397,15 +397,6 @@ public: */ virtual bool remove_channel(uint8_t channel_id); - /** Puts the radio into continuous wave mode. - * - * @param [in] continuous_wave A pointer to the function parameters. - * - * @param [in] frequency Frequency to transmit at - */ - virtual void set_tx_cont_mode(cw_mode_params_t *continuous_wave, - uint32_t frequency = 0); - /** Computes new data rate according to the given offset * * @param [in] dr The current datarate. diff --git a/features/lorawan/lorastack/phy/LoRaPHYKR920.cpp b/features/lorawan/lorastack/phy/LoRaPHYKR920.cpp index e5df591e61..ba9cf74cd6 100644 --- a/features/lorawan/lorastack/phy/LoRaPHYKR920.cpp +++ b/features/lorawan/lorastack/phy/LoRaPHYKR920.cpp @@ -479,29 +479,3 @@ lorawan_status_t LoRaPHYKR920::set_next_channel(channel_selection_params_t *para return LORAWAN_STATUS_NO_CHANNEL_FOUND; } } - -void LoRaPHYKR920::set_tx_cont_mode(cw_mode_params_t *params, uint32_t given_frequency) -{ - (void)given_frequency; - - if (params->tx_power > bands[channels[params->channel].band].max_tx_pwr) { - params->tx_power = bands[channels[params->channel].band].max_tx_pwr; - } - - float max_eirp = get_max_eirp(channels[params->channel].frequency); - int8_t phy_tx_power = 0; - uint32_t frequency = channels[params->channel].frequency; - - // Take the minimum between the max_eirp and params->max_eirp. - // The value of params->max_eirp could have changed during runtime, - // e.g. due to a MAC command. - max_eirp = MIN(params->max_eirp, max_eirp); - - // Calculate physical TX power - phy_tx_power = compute_tx_power(params->tx_power, max_eirp, params->antenna_gain); - - _radio->lock(); - _radio->set_tx_continuous_wave(frequency, phy_tx_power, params->timeout); - _radio->unlock(); -} - diff --git a/features/lorawan/lorastack/phy/LoRaPHYKR920.h b/features/lorawan/lorastack/phy/LoRaPHYKR920.h index ae7af4624c..1b998191ec 100644 --- a/features/lorawan/lorastack/phy/LoRaPHYKR920.h +++ b/features/lorawan/lorastack/phy/LoRaPHYKR920.h @@ -65,10 +65,6 @@ public: lorawan_time_t *time, lorawan_time_t *aggregate_timeOff); - virtual void set_tx_cont_mode(cw_mode_params_t *continuousWave, - uint32_t frequency = 0); - - private: int8_t get_max_eirp(uint32_t freq); diff --git a/features/lorawan/lorastack/phy/LoRaPHYUS915.cpp b/features/lorawan/lorastack/phy/LoRaPHYUS915.cpp index 9882b5ea6c..1b46ddec98 100644 --- a/features/lorawan/lorastack/phy/LoRaPHYUS915.cpp +++ b/features/lorawan/lorastack/phy/LoRaPHYUS915.cpp @@ -664,26 +664,6 @@ lorawan_status_t LoRaPHYUS915::set_next_channel(channel_selection_params_t *para } } -void LoRaPHYUS915::set_tx_cont_mode(cw_mode_params_t *params, uint32_t given_frequency) -{ - (void)given_frequency; - - int8_t tx_power_limited = limit_tx_power(params->tx_power, - bands[channels[params->channel].band].max_tx_pwr, - params->datarate); - int8_t phyTxPower = 0; - uint32_t frequency = channels[params->channel].frequency; - - // Calculate physical TX power - phyTxPower = compute_tx_power(tx_power_limited, US915_DEFAULT_MAX_ERP, 0); - - _radio->lock(); - - _radio->set_tx_continuous_wave(frequency, phyTxPower, params->timeout); - - _radio->unlock(); -} - uint8_t LoRaPHYUS915::apply_DR_offset(int8_t dr, int8_t dr_offset) { return datarate_offsets_US915[dr][dr_offset]; diff --git a/features/lorawan/lorastack/phy/LoRaPHYUS915.h b/features/lorawan/lorastack/phy/LoRaPHYUS915.h index 1896c4a96a..00c50f2fbe 100644 --- a/features/lorawan/lorastack/phy/LoRaPHYUS915.h +++ b/features/lorawan/lorastack/phy/LoRaPHYUS915.h @@ -75,9 +75,6 @@ public: virtual lorawan_status_t set_next_channel(channel_selection_params_t *params, uint8_t *channel, lorawan_time_t *time, lorawan_time_t *aggregate_timeOff); - virtual void set_tx_cont_mode(cw_mode_params_t *continuousWave, - uint32_t frequency = 0); - virtual uint8_t apply_DR_offset(int8_t dr, int8_t dr_offset); private: