mirror of https://github.com/ARMmbed/mbed-os.git
set_tx_continuous_wave removed
parent
1fbeb58b85
commit
cba835bbad
|
@ -124,10 +124,6 @@ public:
|
||||||
return bool_value;
|
return bool_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual void lock(void)
|
virtual void lock(void)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
@ -754,30 +750,6 @@ TEST_F(Test_LoRaPHY, remove_channel)
|
||||||
EXPECT_TRUE(true == object->remove_channel(0));
|
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)
|
TEST_F(Test_LoRaPHY, apply_DR_offset)
|
||||||
{
|
{
|
||||||
EXPECT_TRUE(0 == object->apply_DR_offset(0, 0));
|
EXPECT_TRUE(0 == object->apply_DR_offset(0, 0));
|
||||||
|
|
|
@ -107,10 +107,6 @@ public:
|
||||||
return bool_value;
|
return bool_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual void lock(void)
|
virtual void lock(void)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
|
@ -107,10 +107,6 @@ public:
|
||||||
return bool_value;
|
return bool_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual void lock(void)
|
virtual void lock(void)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
|
@ -107,10 +107,6 @@ public:
|
||||||
return bool_value;
|
return bool_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual void lock(void)
|
virtual void lock(void)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
|
@ -106,10 +106,6 @@ public:
|
||||||
return bool_value;
|
return bool_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual void lock(void)
|
virtual void lock(void)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
@ -189,12 +185,3 @@ TEST_F(Test_LoRaPHYKR920, set_next_channel)
|
||||||
radio.bool_value = true;
|
radio.bool_value = true;
|
||||||
EXPECT_TRUE(LORAWAN_STATUS_OK == object->set_next_channel(&next_channel, &ch, &backoff_time, &time));
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -107,10 +107,6 @@ public:
|
||||||
return bool_value;
|
return bool_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual void lock(void)
|
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);
|
|
||||||
}
|
|
||||||
|
|
|
@ -103,10 +103,6 @@ public:
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual void lock(void)
|
virtual void lock(void)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
|
@ -133,10 +133,6 @@ public:
|
||||||
return bool_value;
|
return bool_value;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual void lock(void)
|
virtual void lock(void)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
|
@ -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,
|
lorawan_status_t LoRaMac::initialize(EventQueue *queue,
|
||||||
mbed::Callback<void(void)>scheduling_failure_handler)
|
mbed::Callback<void(void)>scheduling_failure_handler)
|
||||||
{
|
{
|
||||||
|
|
|
@ -407,10 +407,6 @@ bool LoRaPHY::remove_channel(uint8_t channel_id)
|
||||||
return LoRaPHY_stub::bool_table[LoRaPHY_stub::bool_counter++];
|
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)
|
uint8_t LoRaPHY::apply_DR_offset(int8_t dr, int8_t dr_offset)
|
||||||
{
|
{
|
||||||
return LoRaPHY_stub::uint8_value;
|
return LoRaPHY_stub::uint8_value;
|
||||||
|
|
|
@ -644,14 +644,6 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual bool check_rf_frequency(uint32_t frequency) = 0;
|
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.
|
* Acquires exclusive access to this radio.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -638,18 +638,6 @@ private:
|
||||||
void reset_mcps_confirmation(void);
|
void reset_mcps_confirmation(void);
|
||||||
void reset_mcps_indication(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
|
* Calculate MIC for user data messages
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1474,37 +1474,6 @@ bool LoRaPHY::remove_channel(uint8_t channel_id)
|
||||||
phy_params.max_channel_cnt);
|
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)
|
uint8_t LoRaPHY::apply_DR_offset(int8_t dr, int8_t dr_offset)
|
||||||
{
|
{
|
||||||
int8_t datarate = dr - dr_offset;
|
int8_t datarate = dr - dr_offset;
|
||||||
|
|
|
@ -397,15 +397,6 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual bool remove_channel(uint8_t channel_id);
|
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
|
/** Computes new data rate according to the given offset
|
||||||
*
|
*
|
||||||
* @param [in] dr The current datarate.
|
* @param [in] dr The current datarate.
|
||||||
|
|
|
@ -479,29 +479,3 @@ lorawan_status_t LoRaPHYKR920::set_next_channel(channel_selection_params_t *para
|
||||||
return LORAWAN_STATUS_NO_CHANNEL_FOUND;
|
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -65,10 +65,6 @@ public:
|
||||||
lorawan_time_t *time,
|
lorawan_time_t *time,
|
||||||
lorawan_time_t *aggregate_timeOff);
|
lorawan_time_t *aggregate_timeOff);
|
||||||
|
|
||||||
virtual void set_tx_cont_mode(cw_mode_params_t *continuousWave,
|
|
||||||
uint32_t frequency = 0);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int8_t get_max_eirp(uint32_t freq);
|
int8_t get_max_eirp(uint32_t freq);
|
||||||
|
|
|
@ -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)
|
uint8_t LoRaPHYUS915::apply_DR_offset(int8_t dr, int8_t dr_offset)
|
||||||
{
|
{
|
||||||
return datarate_offsets_US915[dr][dr_offset];
|
return datarate_offsets_US915[dr][dr_offset];
|
||||||
|
|
|
@ -75,9 +75,6 @@ public:
|
||||||
virtual lorawan_status_t set_next_channel(channel_selection_params_t *params, uint8_t *channel,
|
virtual lorawan_status_t set_next_channel(channel_selection_params_t *params, uint8_t *channel,
|
||||||
lorawan_time_t *time, lorawan_time_t *aggregate_timeOff);
|
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);
|
virtual uint8_t apply_DR_offset(int8_t dr, int8_t dr_offset);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue