mirror of https://github.com/ARMmbed/mbed-os.git
LoRa: Removed unneeded function and cleaned up some code
parent
d1bbd21e01
commit
1310392d1b
|
|
@ -150,8 +150,8 @@ lorawan_status_t LoRaWANStack::connect()
|
||||||
const static uint32_t nwk_id = (MBED_CONF_LORA_DEVICE_ADDRESS & LORAWAN_NETWORK_ID_MASK);
|
const static uint32_t nwk_id = (MBED_CONF_LORA_DEVICE_ADDRESS & LORAWAN_NETWORK_ID_MASK);
|
||||||
|
|
||||||
connection_params.connect_type = LORAWAN_CONNECTION_ABP;
|
connection_params.connect_type = LORAWAN_CONNECTION_ABP;
|
||||||
connection_params.connection_u.abp.nwk_id = const_cast<uint8_t *>(nwk_id);
|
connection_params.connection_u.abp.nwk_id = nwk_id;
|
||||||
connection_params.connection_u.abp.dev_addr = const_cast<uint8_t *>(dev_addr);
|
connection_params.connection_u.abp.dev_addr = dev_addr;
|
||||||
connection_params.connection_u.abp.nwk_skey = const_cast<uint8_t *>(nwk_skey);
|
connection_params.connection_u.abp.nwk_skey = const_cast<uint8_t *>(nwk_skey);
|
||||||
connection_params.connection_u.abp.app_skey = const_cast<uint8_t *>(app_skey);
|
connection_params.connection_u.abp.app_skey = const_cast<uint8_t *>(app_skey);
|
||||||
|
|
||||||
|
|
@ -640,7 +640,10 @@ void LoRaWANStack::mcps_indication_handler(loramac_mcps_indication_t *mcps_indic
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (mcps_indication->is_data_recvd == true) {
|
if (!mcps_indication->is_data_recvd) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (mcps_indication->port) {
|
switch (mcps_indication->port) {
|
||||||
case 224: {
|
case 224: {
|
||||||
#if defined(LORAWAN_COMPLIANCE_TEST)
|
#if defined(LORAWAN_COMPLIANCE_TEST)
|
||||||
|
|
@ -697,7 +700,6 @@ void LoRaWANStack::mcps_indication_handler(loramac_mcps_indication_t *mcps_indic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
lorawan_status_t LoRaWANStack::set_link_check_request()
|
lorawan_status_t LoRaWANStack::set_link_check_request()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -964,7 +964,7 @@ void LoRaMac::on_rx_window1_timer_event(void)
|
||||||
_lora_phy.rx_config(&_params.rx_window1_config,
|
_lora_phy.rx_config(&_params.rx_window1_config,
|
||||||
(int8_t*) &_mcps_indication.rx_datarate);
|
(int8_t*) &_mcps_indication.rx_datarate);
|
||||||
|
|
||||||
rx_window_setup(_params.rx_window1_config.is_rx_continuous,
|
_lora_phy.setup_rx_window(_params.rx_window1_config.is_rx_continuous,
|
||||||
_params.sys_params.max_rx_win_time);
|
_params.sys_params.max_rx_win_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -978,17 +978,16 @@ void LoRaMac::on_rx_window2_timer_event(void)
|
||||||
_params.rx_window2_config.is_repeater_supported = _params.is_repeater_supported;
|
_params.rx_window2_config.is_repeater_supported = _params.is_repeater_supported;
|
||||||
_params.rx_window2_config.rx_slot = RX_SLOT_WIN_2;
|
_params.rx_window2_config.rx_slot = RX_SLOT_WIN_2;
|
||||||
|
|
||||||
|
_params.rx_window2_config.is_rx_continuous = true;
|
||||||
|
|
||||||
if (_device_class != CLASS_C) {
|
if (_device_class != CLASS_C) {
|
||||||
_params.rx_window2_config.is_rx_continuous = false;
|
_params.rx_window2_config.is_rx_continuous = false;
|
||||||
} else {
|
|
||||||
// Setup continuous listening for class c
|
|
||||||
_params.rx_window2_config.is_rx_continuous = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_lora_phy.rx_config(&_params.rx_window2_config,
|
if (_lora_phy.rx_config(&_params.rx_window2_config,
|
||||||
(int8_t*) &_mcps_indication.rx_datarate) == true) {
|
(int8_t*) &_mcps_indication.rx_datarate) == true) {
|
||||||
|
|
||||||
rx_window_setup(_params.rx_window2_config.is_rx_continuous,
|
_lora_phy.setup_rx_window(_params.rx_window2_config.is_rx_continuous,
|
||||||
_params.sys_params.max_rx_win_time);
|
_params.sys_params.max_rx_win_time);
|
||||||
|
|
||||||
_params.rx_slot = RX_SLOT_WIN_2;
|
_params.rx_slot = RX_SLOT_WIN_2;
|
||||||
|
|
@ -1037,11 +1036,6 @@ void LoRaMac::on_ack_timeout_timer_event(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoRaMac::rx_window_setup(bool rx_continuous, uint32_t max_rx_window_time)
|
|
||||||
{
|
|
||||||
_lora_phy.setup_rx_window(rx_continuous, max_rx_window_time);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LoRaMac::validate_payload_length(uint8_t length, int8_t datarate,
|
bool LoRaMac::validate_payload_length(uint8_t length, int8_t datarate,
|
||||||
uint8_t fopts_len)
|
uint8_t fopts_len)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -452,11 +452,6 @@ private:
|
||||||
*/
|
*/
|
||||||
void on_ack_timeout_timer_event(void);
|
void on_ack_timeout_timer_event(void);
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes and opens the reception window
|
|
||||||
*/
|
|
||||||
void rx_window_setup(bool rx_continuous, uint32_t max_rx_window_time);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates if the payload fits into the frame, taking the datarate
|
* Validates if the payload fits into the frame, taking the datarate
|
||||||
* into account.
|
* into account.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue