mirror of https://github.com/ARMmbed/mbed-os.git
Remaining style fixes
parent
27290bb12f
commit
d335f82440
|
@ -1362,8 +1362,10 @@ void LoRaWANStack::compliance_test_handler(loramac_mcps_indication_t *mcps_indic
|
|||
} else if (mcps_indication->buffer_size == 7) {
|
||||
loramac_mlme_req_t mlme_req;
|
||||
mlme_req.type = MLME_TXCW_1;
|
||||
mlme_req.cw_tx_mode.timeout = (uint16_t)((mcps_indication->buffer[1] << 8) | mcps_indication->buffer[2]);
|
||||
mlme_req.cw_tx_mode.frequency = (uint32_t)((mcps_indication->buffer[3] << 16) | (mcps_indication->buffer[4] << 8)
|
||||
mlme_req.cw_tx_mode.timeout = (uint16_t)((mcps_indication->buffer[1] << 8)
|
||||
| mcps_indication->buffer[2]);
|
||||
mlme_req.cw_tx_mode.frequency = (uint32_t)((mcps_indication->buffer[3] << 16)
|
||||
| (mcps_indication->buffer[4] << 8)
|
||||
| mcps_indication->buffer[5]) * 100;
|
||||
mlme_req.cw_tx_mode.power = mcps_indication->buffer[6];
|
||||
_loramac.mlme_request(&mlme_req);
|
||||
|
|
|
@ -800,8 +800,8 @@ lorawan_status_t LoRaMac::send_join_request()
|
|||
loramac_mhdr_t mac_hdr;
|
||||
loramac_frame_ctrl_t fctrl;
|
||||
|
||||
_params.sys_params.channel_data_rate = _lora_phy.get_alternate_DR(
|
||||
_params.join_request_trial_counter + 1);
|
||||
_params.sys_params.channel_data_rate =
|
||||
_lora_phy.get_alternate_DR(_params.join_request_trial_counter + 1);
|
||||
|
||||
mac_hdr.value = 0;
|
||||
mac_hdr.bits.mtype = FRAME_TYPE_JOIN_REQ;
|
||||
|
@ -1551,8 +1551,7 @@ lorawan_status_t LoRaMac::prepare_frame(loramac_mhdr_t *machdr,
|
|||
// Update FCtrl field with new value of OptionsLength
|
||||
_params.tx_buffer[0x05] = fctrl->value;
|
||||
|
||||
const uint8_t *buffer =
|
||||
_mac_commands.get_mac_commands_buffer();
|
||||
const uint8_t *buffer = _mac_commands.get_mac_commands_buffer();
|
||||
for (i = 0; i < mac_commands_len; i++) {
|
||||
_params.tx_buffer[pkt_header_len++] = buffer[i];
|
||||
}
|
||||
|
@ -2030,8 +2029,7 @@ void LoRaMac::LoRaMacTestSetMic( uint16_t txPacketCounter )
|
|||
|
||||
void LoRaMac::LoRaMacTestSetDutyCycleOn(bool enable)
|
||||
{
|
||||
if(_lora_phy.verify_duty_cycle(enable) == true)
|
||||
{
|
||||
if (_lora_phy.verify_duty_cycle(enable) == true) {
|
||||
_params.is_dutycycle_on = enable;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,15 +47,18 @@ LoRaPHY::~LoRaPHY()
|
|||
_radio = NULL;
|
||||
}
|
||||
|
||||
bool LoRaPHY::mask_bit_test(const uint16_t *mask, unsigned bit) {
|
||||
bool LoRaPHY::mask_bit_test(const uint16_t *mask, unsigned bit)
|
||||
{
|
||||
return mask[bit / 16] & (1U << (bit % 16));
|
||||
}
|
||||
|
||||
void LoRaPHY::mask_bit_set(uint16_t *mask, unsigned bit) {
|
||||
void LoRaPHY::mask_bit_set(uint16_t *mask, unsigned bit)
|
||||
{
|
||||
mask[bit / 16] |= (1U << (bit % 16));
|
||||
}
|
||||
|
||||
void LoRaPHY::mask_bit_clear(uint16_t *mask, unsigned bit) {
|
||||
void LoRaPHY::mask_bit_clear(uint16_t *mask, unsigned bit)
|
||||
{
|
||||
mask[bit / 16] &= ~(1U << (bit % 16));
|
||||
}
|
||||
|
||||
|
@ -64,13 +67,15 @@ void LoRaPHY::set_radio_instance(LoRaRadio& radio)
|
|||
_radio = &radio;
|
||||
}
|
||||
|
||||
void LoRaPHY::put_radio_to_sleep() {
|
||||
void LoRaPHY::put_radio_to_sleep()
|
||||
{
|
||||
_radio->lock();
|
||||
_radio->sleep();
|
||||
_radio->unlock();
|
||||
}
|
||||
|
||||
void LoRaPHY::put_radio_to_standby() {
|
||||
void LoRaPHY::put_radio_to_standby()
|
||||
{
|
||||
_radio->lock();
|
||||
_radio->standby();
|
||||
_radio->unlock();
|
||||
|
@ -129,27 +134,22 @@ uint8_t LoRaPHY::request_new_channel(int8_t channel_id, channel_params_t* new_ch
|
|||
} else {
|
||||
new_channel->band = lookup_band_for_frequency(new_channel->frequency);
|
||||
switch (add_channel(new_channel, channel_id)) {
|
||||
case LORAWAN_STATUS_OK:
|
||||
{
|
||||
case LORAWAN_STATUS_OK: {
|
||||
break;
|
||||
}
|
||||
case LORAWAN_STATUS_FREQUENCY_INVALID:
|
||||
{
|
||||
case LORAWAN_STATUS_FREQUENCY_INVALID: {
|
||||
status &= 0xFE;
|
||||
break;
|
||||
}
|
||||
case LORAWAN_STATUS_DATARATE_INVALID:
|
||||
{
|
||||
case LORAWAN_STATUS_DATARATE_INVALID: {
|
||||
status &= 0xFD;
|
||||
break;
|
||||
}
|
||||
case LORAWAN_STATUS_FREQ_AND_DR_INVALID:
|
||||
{
|
||||
case LORAWAN_STATUS_FREQ_AND_DR_INVALID: {
|
||||
status &= 0xFC;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
default: {
|
||||
status &= 0xFC;
|
||||
break;
|
||||
}
|
||||
|
@ -307,7 +307,8 @@ lorawan_time_t LoRaPHY::update_band_timeoff(bool joined, bool duty_cycle,
|
|||
return next_tx_delay;
|
||||
}
|
||||
|
||||
uint8_t LoRaPHY::parse_link_ADR_req(const uint8_t* payload, link_adr_params_t* params)
|
||||
uint8_t LoRaPHY::parse_link_ADR_req(const uint8_t *payload,
|
||||
link_adr_params_t *params)
|
||||
{
|
||||
uint8_t ret_index = 0;
|
||||
|
||||
|
@ -700,8 +701,8 @@ void LoRaPHY::apply_cf_list(const uint8_t* payload, uint8_t size)
|
|||
channel_params_t new_channel;
|
||||
|
||||
// Setup default datarate range
|
||||
new_channel.dr_range.value = (phy_params.default_max_datarate << 4)
|
||||
| phy_params.default_datarate;
|
||||
new_channel.dr_range.value = (phy_params.default_max_datarate << 4) |
|
||||
phy_params.default_datarate;
|
||||
|
||||
// Size of the optional CF list
|
||||
if (size != 16) {
|
||||
|
@ -960,8 +961,7 @@ uint8_t LoRaPHY::link_ADR_request(adr_req_params_t* link_adr_req,
|
|||
}
|
||||
|
||||
// channel mask applies to first 16 channels
|
||||
if (adr_settings.ch_mask_ctrl == 0 ||
|
||||
adr_settings.ch_mask_ctrl == 6) {
|
||||
if (adr_settings.ch_mask_ctrl == 0 || adr_settings.ch_mask_ctrl == 6) {
|
||||
|
||||
for (uint8_t i = 0; i < phy_params.max_channel_cnt; i++) {
|
||||
|
||||
|
@ -1198,8 +1198,7 @@ void LoRaPHY::calculate_backoff(bool joined, bool last_tx_was_join_req, bool dc_
|
|||
|
||||
// No back-off if the last frame was not a join request and when the
|
||||
// duty cycle is not enabled
|
||||
if (dc_enabled == false &&
|
||||
last_tx_was_join_req == false) {
|
||||
if (dc_enabled == false && last_tx_was_join_req == false) {
|
||||
band_table[band_idx].off_time = 0;
|
||||
} else {
|
||||
// Apply band time-off.
|
||||
|
@ -1251,8 +1250,8 @@ lorawan_status_t LoRaPHY::set_next_channel(channel_selection_params_t* params,
|
|||
enabled_channels, &delay_tx);
|
||||
} else {
|
||||
delay_tx++;
|
||||
next_tx_delay = params->aggregate_timeoff
|
||||
- _lora_time.get_elapsed_time(params->last_aggregate_tx_time);
|
||||
next_tx_delay = params->aggregate_timeoff -
|
||||
_lora_time.get_elapsed_time(params->last_aggregate_tx_time);
|
||||
}
|
||||
|
||||
if (channel_count > 0) {
|
||||
|
@ -1276,7 +1275,8 @@ lorawan_status_t LoRaPHY::set_next_channel(channel_selection_params_t* params,
|
|||
return LORAWAN_STATUS_NO_CHANNEL_FOUND;
|
||||
}
|
||||
|
||||
lorawan_status_t LoRaPHY::add_channel(const channel_params_t* new_channel, uint8_t id)
|
||||
lorawan_status_t LoRaPHY::add_channel(const channel_params_t *new_channel,
|
||||
uint8_t id)
|
||||
{
|
||||
bool dr_invalid = false;
|
||||
bool freq_invalid = false;
|
||||
|
|
Loading…
Reference in New Issue