mirror of https://github.com/ARMmbed/mbed-os.git
Style changes only
Travis astyle check pointed out some of the style mismatches in the code. Not all of them are worth changing as they make the code unreadable and some of them are semantically wrong. So in this commit, we have attempted to pick the most important style mismatches and rectify.pull/7228/head
parent
c705f94e49
commit
1a074acbb5
|
@ -217,7 +217,7 @@ public:
|
|||
* LORAWAN_STATUS_WOULD_BLOCK if another TX is
|
||||
* ongoing, or a negative error code on failure.
|
||||
*/
|
||||
virtual int16_t send(uint8_t port, const uint8_t* data,
|
||||
virtual int16_t send(uint8_t port, const uint8_t *data,
|
||||
uint16_t length, int flags) = 0;
|
||||
|
||||
/** Receives a message from the Network Server on a specific port.
|
||||
|
@ -259,7 +259,7 @@ public:
|
|||
* nothing available to read at the moment.
|
||||
* iv) A negative error code on failure.
|
||||
*/
|
||||
virtual int16_t receive(uint8_t port, uint8_t* data, uint16_t length, int flags) = 0;
|
||||
virtual int16_t receive(uint8_t port, uint8_t *data, uint16_t length, int flags) = 0;
|
||||
|
||||
/** Receives a message from the Network Server from any port.
|
||||
*
|
||||
|
@ -283,7 +283,7 @@ public:
|
|||
* nothing available to read at the moment.
|
||||
* iv) A negative error code on failure.
|
||||
*/
|
||||
virtual int16_t receive(uint8_t* data, uint16_t length, uint8_t& port, int& flags) = 0;
|
||||
virtual int16_t receive(uint8_t *data, uint16_t length, uint8_t &port, int &flags) = 0;
|
||||
|
||||
/** Add application callbacks to the stack.
|
||||
*
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
using namespace events;
|
||||
|
||||
LoRaWANInterface::LoRaWANInterface(LoRaRadio& radio)
|
||||
LoRaWANInterface::LoRaWANInterface(LoRaRadio &radio)
|
||||
{
|
||||
_lw_stack.bind_radio_driver(radio);
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ lorawan_status_t LoRaWANInterface::remove_channel_plan()
|
|||
return _lw_stack.drop_channel_list();
|
||||
}
|
||||
|
||||
int16_t LoRaWANInterface::send(uint8_t port, const uint8_t* data, uint16_t length, int flags)
|
||||
int16_t LoRaWANInterface::send(uint8_t port, const uint8_t *data, uint16_t length, int flags)
|
||||
{
|
||||
Lock lock(*this);
|
||||
return _lw_stack.handle_tx(port, data, length, flags);
|
||||
|
@ -146,13 +146,13 @@ lorawan_status_t LoRaWANInterface::get_backoff_metadata(int &backoff)
|
|||
return _lw_stack.acquire_backoff_metadata(backoff);
|
||||
}
|
||||
|
||||
int16_t LoRaWANInterface::receive(uint8_t port, uint8_t* data, uint16_t length, int flags)
|
||||
int16_t LoRaWANInterface::receive(uint8_t port, uint8_t *data, uint16_t length, int flags)
|
||||
{
|
||||
Lock lock(*this);
|
||||
return _lw_stack.handle_rx(data, length, port, flags, true);
|
||||
}
|
||||
|
||||
int16_t LoRaWANInterface::receive(uint8_t* data, uint16_t length, uint8_t& port, int& flags)
|
||||
int16_t LoRaWANInterface::receive(uint8_t *data, uint16_t length, uint8_t &port, int &flags)
|
||||
{
|
||||
Lock lock(*this);
|
||||
return _lw_stack.handle_rx(data, length, port, flags, false);
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
* construct a single instance of LoRaWANInterface.
|
||||
*
|
||||
*/
|
||||
LoRaWANInterface(LoRaRadio& radio);
|
||||
LoRaWANInterface(LoRaRadio &radio);
|
||||
|
||||
virtual ~LoRaWANInterface();
|
||||
|
||||
|
@ -315,7 +315,7 @@ public:
|
|||
* LORAWAN_STATUS_WOULD_BLOCK if another TX is
|
||||
* ongoing, or a negative error code on failure.
|
||||
*/
|
||||
virtual int16_t send(uint8_t port, const uint8_t* data, uint16_t length,
|
||||
virtual int16_t send(uint8_t port, const uint8_t *data, uint16_t length,
|
||||
int flags);
|
||||
|
||||
/** Receives a message from the Network Server on a specific port.
|
||||
|
@ -357,7 +357,7 @@ public:
|
|||
* nothing available to read at the moment.
|
||||
* iv) A negative error code on failure.
|
||||
*/
|
||||
virtual int16_t receive(uint8_t port, uint8_t* data, uint16_t length, int flags);
|
||||
virtual int16_t receive(uint8_t port, uint8_t *data, uint16_t length, int flags);
|
||||
|
||||
/** Receives a message from the Network Server on any port.
|
||||
*
|
||||
|
@ -381,7 +381,7 @@ public:
|
|||
* nothing available to read at the moment.
|
||||
* iv) A negative error code on failure.
|
||||
*/
|
||||
virtual int16_t receive(uint8_t* data, uint16_t length, uint8_t& port, int& flags);
|
||||
virtual int16_t receive(uint8_t *data, uint16_t length, uint8_t &port, int &flags);
|
||||
|
||||
/** Add application callbacks to the stack.
|
||||
*
|
||||
|
@ -502,8 +502,14 @@ public:
|
|||
*/
|
||||
virtual lorawan_status_t cancel_sending(void);
|
||||
|
||||
void lock(void) { _lw_stack.lock(); }
|
||||
void unlock(void) { _lw_stack.unlock(); }
|
||||
void lock(void)
|
||||
{
|
||||
_lw_stack.lock();
|
||||
}
|
||||
void unlock(void)
|
||||
{
|
||||
_lw_stack.unlock();
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
|
|
|
@ -49,14 +49,14 @@ using namespace mbed;
|
|||
using namespace events;
|
||||
|
||||
#if defined(LORAWAN_COMPLIANCE_TEST)
|
||||
#if (MBED_CONF_LORA_PHY == 0 || MBED_CONF_LORA_PHY == 4 || MBED_CONF_LORA_PHY == 6 || MBED_CONF_LORA_PHY == 7)
|
||||
#define LORAWAN_COMPLIANCE_TEST_DATA_SIZE 16
|
||||
#elif (MBED_CONF_LORA_PHY == 1 || MBED_CONF_LORA_PHY == 2 || MBED_CONF_LORA_PHY == 8 || MBED_CONF_LORA_PHY == 9)
|
||||
#define LORAWAN_COMPLIANCE_TEST_DATA_SIZE 11
|
||||
#else
|
||||
#error "Must set LoRa PHY layer parameters."
|
||||
#endif
|
||||
#if (MBED_CONF_LORA_PHY == 0 || MBED_CONF_LORA_PHY == 4 || MBED_CONF_LORA_PHY == 6 || MBED_CONF_LORA_PHY == 7)
|
||||
#define LORAWAN_COMPLIANCE_TEST_DATA_SIZE 16
|
||||
#elif (MBED_CONF_LORA_PHY == 1 || MBED_CONF_LORA_PHY == 2 || MBED_CONF_LORA_PHY == 8 || MBED_CONF_LORA_PHY == 9)
|
||||
#define LORAWAN_COMPLIANCE_TEST_DATA_SIZE 11
|
||||
#else
|
||||
#error "Must set LoRa PHY layer parameters."
|
||||
#endif
|
||||
#endif //defined(LORAWAN_COMPLIANCE_TEST)
|
||||
|
||||
/**
|
||||
* Bit mask for message flags
|
||||
|
@ -98,7 +98,7 @@ LoRaWANStack::LoRaWANStack()
|
|||
/*****************************************************************************
|
||||
* Public Methods *
|
||||
****************************************************************************/
|
||||
void LoRaWANStack::bind_radio_driver(LoRaRadio& radio)
|
||||
void LoRaWANStack::bind_radio_driver(LoRaRadio &radio)
|
||||
{
|
||||
radio_events.tx_done = mbed::callback(this, &LoRaWANStack::tx_interrupt_handler);
|
||||
radio_events.rx_done = mbed::callback(this, &LoRaWANStack::rx_interrupt_handler);
|
||||
|
@ -115,7 +115,7 @@ void LoRaWANStack::bind_radio_driver(LoRaRadio& radio)
|
|||
|
||||
lorawan_status_t LoRaWANStack::initialize_mac_layer(EventQueue *queue)
|
||||
{
|
||||
if(!queue) {
|
||||
if (!queue) {
|
||||
return LORAWAN_STATUS_PARAMETER_INVALID;
|
||||
}
|
||||
|
||||
|
@ -170,10 +170,11 @@ lorawan_status_t LoRaWANStack::connect(const lorawan_connect_t &connect)
|
|||
return LORAWAN_STATUS_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!(connect.connect_type == LORAWAN_CONNECTION_OTAA) &&
|
||||
!(connect.connect_type == LORAWAN_CONNECTION_ABP)) {
|
||||
if (!(connect.connect_type == LORAWAN_CONNECTION_OTAA)
|
||||
&& !(connect.connect_type == LORAWAN_CONNECTION_ABP)) {
|
||||
return LORAWAN_STATUS_PARAMETER_INVALID;
|
||||
}
|
||||
|
||||
bool is_otaa = (connect.connect_type == LORAWAN_CONNECTION_OTAA);
|
||||
|
||||
lorawan_status_t status = _loramac.prepare_join(&connect, is_otaa);
|
||||
|
@ -212,7 +213,7 @@ lorawan_status_t LoRaWANStack::drop_channel_list()
|
|||
return _loramac.remove_channel_plan();
|
||||
}
|
||||
|
||||
lorawan_status_t LoRaWANStack::get_enabled_channels(lorawan_channelplan_t& channel_plan)
|
||||
lorawan_status_t LoRaWANStack::get_enabled_channels(lorawan_channelplan_t &channel_plan)
|
||||
{
|
||||
if (_device_current_state == DEVICE_STATE_NOT_INITIALIZED) {
|
||||
return LORAWAN_STATUS_NOT_INITIALIZED;
|
||||
|
@ -271,7 +272,7 @@ lorawan_status_t LoRaWANStack::stop_sending(void)
|
|||
return LORAWAN_STATUS_BUSY;
|
||||
}
|
||||
|
||||
int16_t LoRaWANStack::handle_tx(const uint8_t port, const uint8_t* data,
|
||||
int16_t LoRaWANStack::handle_tx(const uint8_t port, const uint8_t *data,
|
||||
uint16_t length, uint8_t flags,
|
||||
bool null_allowed, bool allow_port_0)
|
||||
{
|
||||
|
@ -288,7 +289,7 @@ int16_t LoRaWANStack::handle_tx(const uint8_t port, const uint8_t* data,
|
|||
return LORAWAN_STATUS_NO_ACTIVE_SESSIONS;
|
||||
}
|
||||
|
||||
if(_loramac.tx_ongoing()) {
|
||||
if (_loramac.tx_ongoing()) {
|
||||
return LORAWAN_STATUS_WOULD_BLOCK;
|
||||
}
|
||||
|
||||
|
@ -333,7 +334,7 @@ int16_t LoRaWANStack::handle_tx(const uint8_t port, const uint8_t* data,
|
|||
return (status == LORAWAN_STATUS_OK) ? len : (int16_t) status;
|
||||
}
|
||||
|
||||
int16_t LoRaWANStack::handle_rx(uint8_t* data, uint16_t length, uint8_t& port, int& flags, bool validate_params)
|
||||
int16_t LoRaWANStack::handle_rx(uint8_t *data, uint16_t length, uint8_t &port, int &flags, bool validate_params)
|
||||
{
|
||||
if (!_lw_session.active) {
|
||||
return LORAWAN_STATUS_NO_ACTIVE_SESSIONS;
|
||||
|
@ -374,8 +375,8 @@ int16_t LoRaWANStack::handle_rx(uint8_t* data, uint16_t length, uint8_t& port, i
|
|||
|
||||
// check the length of received message whether we can fit into user
|
||||
// buffer completely or not
|
||||
if (_rx_msg.msg.mcps_indication.buffer_size > length &&
|
||||
_rx_msg.prev_read_size == 0) {
|
||||
if (_rx_msg.msg.mcps_indication.buffer_size > length
|
||||
&& _rx_msg.prev_read_size == 0) {
|
||||
// we can't fit into user buffer. Invoke counter measures
|
||||
_rx_msg.pending_size = _rx_msg.msg.mcps_indication.buffer_size - length;
|
||||
base_size = length;
|
||||
|
@ -392,7 +393,7 @@ int16_t LoRaWANStack::handle_rx(uint8_t* data, uint16_t length, uint8_t& port, i
|
|||
// the buffer. Due to checks above, in case of a pending read, this block
|
||||
// will be the only one to get invoked
|
||||
if (_rx_msg.pending_size > 0 && _rx_msg.prev_read_size > 0) {
|
||||
memcpy(data, base_ptr+_rx_msg.prev_read_size, base_size);
|
||||
memcpy(data, base_ptr + _rx_msg.prev_read_size, base_size);
|
||||
}
|
||||
|
||||
// we are done handing over received buffer to user. check if there is
|
||||
|
@ -437,7 +438,7 @@ lorawan_status_t LoRaWANStack::shutdown()
|
|||
return state_controller(DEVICE_STATE_SHUTDOWN);
|
||||
}
|
||||
|
||||
lorawan_status_t LoRaWANStack::set_device_class(const device_class_t& device_class)
|
||||
lorawan_status_t LoRaWANStack::set_device_class(const device_class_t &device_class)
|
||||
{
|
||||
if (DEVICE_STATE_NOT_INITIALIZED == _device_current_state) {
|
||||
return LORAWAN_STATUS_NOT_INITIALIZED;
|
||||
|
@ -604,7 +605,7 @@ void LoRaWANStack::handle_ack_expiry_for_class_c(void)
|
|||
state_controller(DEVICE_STATE_STATUS_CHECK);
|
||||
}
|
||||
|
||||
void LoRaWANStack::process_reception(const uint8_t* const payload, uint16_t size,
|
||||
void LoRaWANStack::process_reception(const uint8_t *const payload, uint16_t size,
|
||||
int16_t rssi, int8_t snr)
|
||||
{
|
||||
_device_current_state = DEVICE_STATE_RECEIVING;
|
||||
|
@ -1023,7 +1024,7 @@ lorawan_status_t LoRaWANStack::state_controller(device_states_t new_state)
|
|||
return status;
|
||||
}
|
||||
|
||||
void LoRaWANStack::process_shutdown_state(lorawan_status_t& op_status)
|
||||
void LoRaWANStack::process_shutdown_state(lorawan_status_t &op_status)
|
||||
{
|
||||
/**
|
||||
* Remove channels
|
||||
|
@ -1081,7 +1082,7 @@ void LoRaWANStack::process_status_check_state()
|
|||
}
|
||||
}
|
||||
|
||||
void LoRaWANStack::process_scheduling_state(lorawan_status_t& op_status)
|
||||
void LoRaWANStack::process_scheduling_state(lorawan_status_t &op_status)
|
||||
{
|
||||
if (_device_current_state != DEVICE_STATE_IDLE) {
|
||||
if (_device_current_state != DEVICE_STATE_RECEIVING
|
||||
|
@ -1100,7 +1101,7 @@ void LoRaWANStack::process_scheduling_state(lorawan_status_t& op_status)
|
|||
}
|
||||
}
|
||||
|
||||
void LoRaWANStack::process_joining_state(lorawan_status_t& op_status)
|
||||
void LoRaWANStack::process_joining_state(lorawan_status_t &op_status)
|
||||
{
|
||||
if (_device_current_state == DEVICE_STATE_CONNECTING) {
|
||||
_device_current_state = DEVICE_STATE_JOINING;
|
||||
|
@ -1135,11 +1136,10 @@ void LoRaWANStack::process_connected_state()
|
|||
_device_current_state = DEVICE_STATE_IDLE;
|
||||
}
|
||||
|
||||
void LoRaWANStack::process_connecting_state(lorawan_status_t& op_status)
|
||||
void LoRaWANStack::process_connecting_state(lorawan_status_t &op_status)
|
||||
{
|
||||
if (_device_current_state != DEVICE_STATE_IDLE
|
||||
&&
|
||||
_device_current_state != DEVICE_STATE_SHUTDOWN) {
|
||||
&& _device_current_state != DEVICE_STATE_SHUTDOWN) {
|
||||
op_status = LORAWAN_STATUS_BUSY;
|
||||
return;
|
||||
}
|
||||
|
@ -1162,7 +1162,7 @@ void LoRaWANStack::process_connecting_state(lorawan_status_t& op_status)
|
|||
process_connected_state();
|
||||
}
|
||||
|
||||
void LoRaWANStack::process_idle_state(lorawan_status_t& op_status)
|
||||
void LoRaWANStack::process_idle_state(lorawan_status_t &op_status)
|
||||
{
|
||||
if (_device_current_state == DEVICE_STATE_NOT_INITIALIZED) {
|
||||
_device_current_state = DEVICE_STATE_IDLE;
|
||||
|
@ -1174,7 +1174,7 @@ void LoRaWANStack::process_idle_state(lorawan_status_t& op_status)
|
|||
op_status = LORAWAN_STATUS_OK;
|
||||
}
|
||||
|
||||
void LoRaWANStack::process_uninitialized_state(lorawan_status_t& op_status)
|
||||
void LoRaWANStack::process_uninitialized_state(lorawan_status_t &op_status)
|
||||
{
|
||||
op_status = _loramac.initialize(_queue);
|
||||
|
||||
|
@ -1207,7 +1207,7 @@ lorawan_status_t LoRaWANStack::send_compliance_test_frame_to_mac()
|
|||
_compliance_test.state = 1;
|
||||
test_req.f_buffer_size = _compliance_test.app_data_size;
|
||||
test_req.f_buffer[0] = _compliance_test.app_data_buffer[0];
|
||||
for(uint8_t i = 1; i < MIN(_compliance_test.app_data_size, MBED_CONF_LORA_TX_MAX_SIZE); ++i) {
|
||||
for (uint8_t i = 1; i < MIN(_compliance_test.app_data_size, MBED_CONF_LORA_TX_MAX_SIZE); ++i) {
|
||||
test_req.f_buffer[i] = _compliance_test.app_data_buffer[i];
|
||||
}
|
||||
break;
|
||||
|
@ -1231,7 +1231,7 @@ lorawan_status_t LoRaWANStack::send_compliance_test_frame_to_mac()
|
|||
tr_info("Transmit unconfirmed compliance test frame %d bytes.", test_req.f_buffer_size);
|
||||
|
||||
for (uint8_t i = 0; i < test_req.f_buffer_size; ++i) {
|
||||
tr_info("Byte %d, data is 0x%x", i+1, ((uint8_t*)test_req.f_buffer)[i]);
|
||||
tr_info("Byte %d, data is 0x%x", i + 1, ((uint8_t *)test_req.f_buffer)[i]);
|
||||
}
|
||||
} else if (_compliance_test.is_tx_confirmed) {
|
||||
test_req.type = MCPS_CONFIRMED;
|
||||
|
@ -1242,7 +1242,7 @@ lorawan_status_t LoRaWANStack::send_compliance_test_frame_to_mac()
|
|||
tr_info("Transmit confirmed compliance test frame %d bytes.", test_req.f_buffer_size);
|
||||
|
||||
for (uint8_t i = 0; i < test_req.f_buffer_size; ++i) {
|
||||
tr_info("Byte %d, data is 0x%x", i+1, ((uint8_t*)test_req.f_buffer)[i]);
|
||||
tr_info("Byte %d, data is 0x%x", i + 1, ((uint8_t *)test_req.f_buffer)[i]);
|
||||
}
|
||||
} else {
|
||||
return LORAWAN_STATUS_SERVICE_UNKNOWN;
|
||||
|
@ -1321,7 +1321,7 @@ void LoRaWANStack::compliance_test_handler(loramac_mcps_indication_t *mcps_indic
|
|||
_compliance_test.app_data_size = mcps_indication->buffer_size;
|
||||
|
||||
_compliance_test.app_data_buffer[0] = 4;
|
||||
for(uint8_t i = 1; i < MIN(_compliance_test.app_data_size, LORAMAC_PHY_MAXPAYLOAD); ++i) {
|
||||
for (uint8_t i = 1; i < MIN(_compliance_test.app_data_size, LORAMAC_PHY_MAXPAYLOAD); ++i) {
|
||||
_compliance_test.app_data_buffer[i] = mcps_indication->buffer[i] + 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
* @param radio LoRaRadio object, i.e., the radio driver
|
||||
*
|
||||
*/
|
||||
void bind_radio_driver(LoRaRadio& radio);
|
||||
void bind_radio_driver(LoRaRadio &radio);
|
||||
|
||||
/** End device initialization.
|
||||
* @param queue A pointer to an EventQueue passed from the application.
|
||||
|
@ -281,7 +281,7 @@ public:
|
|||
* LORAWAN_STATUS_WOULD_BLOCK if another TX is
|
||||
* ongoing, or a negative error code on failure.
|
||||
*/
|
||||
int16_t handle_tx(uint8_t port, const uint8_t* data,
|
||||
int16_t handle_tx(uint8_t port, const uint8_t *data,
|
||||
uint16_t length, uint8_t flags,
|
||||
bool null_allowed = false, bool allow_port_0 = false);
|
||||
|
||||
|
@ -334,7 +334,7 @@ public:
|
|||
* nothing available to read at the moment.
|
||||
* iv) A negative error code on failure.
|
||||
*/
|
||||
int16_t handle_rx(uint8_t* data, uint16_t length, uint8_t& port, int& flags, bool validate_params);
|
||||
int16_t handle_rx(uint8_t *data, uint16_t length, uint8_t &port, int &flags, bool validate_params);
|
||||
|
||||
/** Send Link Check Request MAC command.
|
||||
*
|
||||
|
@ -377,7 +377,7 @@ public:
|
|||
* LORAWAN_STATUS_UNSUPPORTED is requested class is not supported,
|
||||
* or other negative error code if request failed.
|
||||
*/
|
||||
lorawan_status_t set_device_class(const device_class_t& device_class);
|
||||
lorawan_status_t set_device_class(const device_class_t &device_class);
|
||||
|
||||
/** Acquire TX meta-data
|
||||
*
|
||||
|
@ -425,8 +425,14 @@ public:
|
|||
*/
|
||||
lorawan_status_t stop_sending(void);
|
||||
|
||||
void lock(void) { _loramac.lock(); }
|
||||
void unlock(void) { _loramac.unlock(); }
|
||||
void lock(void)
|
||||
{
|
||||
_loramac.lock();
|
||||
}
|
||||
void unlock(void)
|
||||
{
|
||||
_loramac.unlock();
|
||||
}
|
||||
|
||||
private:
|
||||
typedef mbed::ScopedLock<LoRaWANStack> Lock;
|
||||
|
@ -443,14 +449,14 @@ private:
|
|||
/**
|
||||
* Helpers for state controller
|
||||
*/
|
||||
void process_uninitialized_state(lorawan_status_t& op_status);
|
||||
void process_idle_state(lorawan_status_t& op_status);
|
||||
void process_uninitialized_state(lorawan_status_t &op_status);
|
||||
void process_idle_state(lorawan_status_t &op_status);
|
||||
void process_connected_state();
|
||||
void process_connecting_state(lorawan_status_t& op_status);
|
||||
void process_joining_state(lorawan_status_t& op_status);
|
||||
void process_scheduling_state(lorawan_status_t& op_status);
|
||||
void process_connecting_state(lorawan_status_t &op_status);
|
||||
void process_joining_state(lorawan_status_t &op_status);
|
||||
void process_scheduling_state(lorawan_status_t &op_status);
|
||||
void process_status_check_state();
|
||||
void process_shutdown_state(lorawan_status_t& op_status);
|
||||
void process_shutdown_state(lorawan_status_t &op_status);
|
||||
void state_machine_run_to_completion(void);
|
||||
|
||||
/**
|
||||
|
|
|
@ -202,7 +202,7 @@ void LoRaMac::on_radio_tx_done(void)
|
|||
}
|
||||
}
|
||||
|
||||
if(_params.is_rx_window_enabled == true) {
|
||||
if (_params.is_rx_window_enabled == true) {
|
||||
// start timer after which rx1_window will get opened
|
||||
_lora_time.start(_params.timers.rx_window1_timer, _params.rx_window1_delay);
|
||||
|
||||
|
@ -317,11 +317,11 @@ void LoRaMac::check_frame_size(uint16_t size)
|
|||
}
|
||||
}
|
||||
|
||||
bool LoRaMac::message_integrity_check(const uint8_t * const payload,
|
||||
bool LoRaMac::message_integrity_check(const uint8_t *const payload,
|
||||
const uint16_t size,
|
||||
uint8_t * const ptr_pos,
|
||||
uint8_t *const ptr_pos,
|
||||
uint32_t address,
|
||||
uint32_t* downlink_counter,
|
||||
uint32_t *downlink_counter,
|
||||
const uint8_t *nwk_skey)
|
||||
{
|
||||
uint32_t mic = 0;
|
||||
|
@ -349,7 +349,7 @@ bool LoRaMac::message_integrity_check(const uint8_t * const payload,
|
|||
// sizeof nws_skey must be the same as _params.keys.nwk_skey,
|
||||
_lora_crypto.compute_mic(payload, size - LORAMAC_MFR_LEN,
|
||||
nwk_skey,
|
||||
sizeof(_params.keys.nwk_skey)*8,
|
||||
sizeof(_params.keys.nwk_skey) * 8,
|
||||
address, DOWN_LINK, *downlink_counter, &mic);
|
||||
|
||||
if (mic_rx != mic) {
|
||||
|
@ -390,7 +390,7 @@ void LoRaMac::extract_data_and_mac_commands(const uint8_t *payload,
|
|||
if (_lora_crypto.decrypt_payload(payload + payload_start_index,
|
||||
frame_len,
|
||||
nwk_skey,
|
||||
sizeof(_params.keys.nwk_skey)*8,
|
||||
sizeof(_params.keys.nwk_skey) * 8,
|
||||
address,
|
||||
DOWN_LINK,
|
||||
downlink_counter,
|
||||
|
@ -425,10 +425,11 @@ void LoRaMac::extract_data_and_mac_commands(const uint8_t *payload,
|
|||
if (fopts_len > 0) {
|
||||
// Decode Options field MAC commands. Omit the fPort.
|
||||
if (_mac_commands.process_mac_commands(payload, 8,
|
||||
payload_start_index - 1, snr,
|
||||
payload_start_index - 1,
|
||||
snr,
|
||||
_mlme_confirmation,
|
||||
_params.sys_params, _lora_phy)
|
||||
!= LORAWAN_STATUS_OK) {
|
||||
_params.sys_params,
|
||||
_lora_phy) != LORAWAN_STATUS_OK) {
|
||||
_mcps_indication.status = LORAMAC_EVENT_INFO_STATUS_ERROR;
|
||||
return;
|
||||
}
|
||||
|
@ -477,7 +478,7 @@ void LoRaMac::extract_mac_commands_only(const uint8_t *payload,
|
|||
}
|
||||
}
|
||||
|
||||
void LoRaMac::handle_data_frame(const uint8_t* const payload,
|
||||
void LoRaMac::handle_data_frame(const uint8_t *const payload,
|
||||
const uint16_t size,
|
||||
uint8_t ptr_pos,
|
||||
uint8_t msg_type,
|
||||
|
@ -655,7 +656,7 @@ void LoRaMac::set_batterylevel_callback(mbed::Callback<uint8_t(void)> battery_le
|
|||
_mac_commands.set_batterylevel_callback(battery_level);
|
||||
}
|
||||
|
||||
void LoRaMac::on_radio_rx_done(const uint8_t* const payload, uint16_t size,
|
||||
void LoRaMac::on_radio_rx_done(const uint8_t *const payload, uint16_t size,
|
||||
int16_t rssi, int8_t snr)
|
||||
{
|
||||
// stop the RX1 timer here if its the first RX slot.
|
||||
|
@ -706,7 +707,7 @@ void LoRaMac::on_radio_rx_done(const uint8_t* const payload, uint16_t size,
|
|||
}
|
||||
}
|
||||
|
||||
void LoRaMac::on_radio_tx_timeout( void )
|
||||
void LoRaMac::on_radio_tx_timeout(void)
|
||||
{
|
||||
_lora_time.stop(_params.timers.rx_window1_timer);
|
||||
_lora_time.stop(_params.timers.rx_window2_timer);
|
||||
|
@ -738,25 +739,29 @@ rx_slot_t LoRaMac::on_radio_rx_timeout(bool is_timeout)
|
|||
|
||||
if (_params.rx_slot == RX_SLOT_WIN_1) {
|
||||
if (_params.is_node_ack_requested == true) {
|
||||
_mcps_confirmation.status = is_timeout ? LORAMAC_EVENT_INFO_STATUS_RX1_TIMEOUT
|
||||
: LORAMAC_EVENT_INFO_STATUS_RX1_ERROR;
|
||||
_mcps_confirmation.status = is_timeout ?
|
||||
LORAMAC_EVENT_INFO_STATUS_RX1_TIMEOUT :
|
||||
LORAMAC_EVENT_INFO_STATUS_RX1_ERROR;
|
||||
}
|
||||
_mlme_confirmation.status = is_timeout ? LORAMAC_EVENT_INFO_STATUS_RX1_TIMEOUT
|
||||
: LORAMAC_EVENT_INFO_STATUS_RX1_ERROR;
|
||||
_mlme_confirmation.status = is_timeout ?
|
||||
LORAMAC_EVENT_INFO_STATUS_RX1_TIMEOUT :
|
||||
LORAMAC_EVENT_INFO_STATUS_RX1_ERROR;
|
||||
|
||||
if (_device_class != CLASS_C) {
|
||||
if (_lora_time.get_elapsed_time(_params.timers.aggregated_last_tx_time ) >= _params.rx_window2_delay) {
|
||||
if (_lora_time.get_elapsed_time(_params.timers.aggregated_last_tx_time) >= _params.rx_window2_delay) {
|
||||
_lora_time.stop(_params.timers.rx_window2_timer);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (_params.is_node_ack_requested == true) {
|
||||
_mcps_confirmation.status = is_timeout ? LORAMAC_EVENT_INFO_STATUS_RX2_TIMEOUT
|
||||
: LORAMAC_EVENT_INFO_STATUS_RX2_ERROR;
|
||||
_mcps_confirmation.status = is_timeout ?
|
||||
LORAMAC_EVENT_INFO_STATUS_RX2_TIMEOUT :
|
||||
LORAMAC_EVENT_INFO_STATUS_RX2_ERROR;
|
||||
}
|
||||
|
||||
_mlme_confirmation.status = is_timeout ? LORAMAC_EVENT_INFO_STATUS_RX2_TIMEOUT
|
||||
: LORAMAC_EVENT_INFO_STATUS_RX2_ERROR;
|
||||
_mlme_confirmation.status = is_timeout ?
|
||||
LORAMAC_EVENT_INFO_STATUS_RX2_TIMEOUT :
|
||||
LORAMAC_EVENT_INFO_STATUS_RX2_ERROR;
|
||||
}
|
||||
|
||||
if (_device_class == CLASS_C) {
|
||||
|
@ -929,8 +934,7 @@ void LoRaMac::on_ack_timeout_timer_event(void)
|
|||
if ((_params.ack_timeout_retry_counter % 2)
|
||||
&& (_params.sys_params.adr_on)) {
|
||||
tr_debug("Trading datarate for range");
|
||||
_params.sys_params.channel_data_rate = _lora_phy.get_next_lower_tx_datarate(
|
||||
_params.sys_params.channel_data_rate);
|
||||
_params.sys_params.channel_data_rate = _lora_phy.get_next_lower_tx_datarate(_params.sys_params.channel_data_rate);
|
||||
}
|
||||
|
||||
_mcps_confirmation.nb_retries = _params.ack_timeout_retry_counter;
|
||||
|
@ -945,6 +949,7 @@ void LoRaMac::on_ack_timeout_timer_event(void)
|
|||
_mac_commands.clear_command_buffer();
|
||||
_params.is_node_ack_requested = false;
|
||||
_mcps_confirmation.ack_received = false;
|
||||
_mcps_confirmation.nb_retries = _params.ack_timeout_retry_counter;
|
||||
|
||||
// now that is a critical failure
|
||||
lorawan_status_t status = handle_retransmission();
|
||||
|
@ -978,7 +983,7 @@ bool LoRaMac::validate_payload_length(uint16_t length,
|
|||
void LoRaMac::set_mlme_schedule_ul_indication(void)
|
||||
{
|
||||
_mlme_indication.indication_type = MLME_SCHEDULE_UPLINK;
|
||||
_mlme_indication.pending= true;
|
||||
_mlme_indication.pending = true;
|
||||
}
|
||||
|
||||
// This is not actual transmission. It just schedules a message in response
|
||||
|
@ -1213,7 +1218,7 @@ void LoRaMac::reset_ongoing_tx(bool reset_pending)
|
|||
}
|
||||
|
||||
int16_t LoRaMac::prepare_ongoing_tx(const uint8_t port,
|
||||
const uint8_t* const data,
|
||||
const uint8_t *const data,
|
||||
uint16_t length,
|
||||
uint8_t flags,
|
||||
uint8_t num_retries)
|
||||
|
@ -1319,7 +1324,7 @@ device_class_t LoRaMac::get_device_class() const
|
|||
return _device_class;
|
||||
}
|
||||
|
||||
void LoRaMac::set_device_class(const device_class_t& device_class,
|
||||
void LoRaMac::set_device_class(const device_class_t &device_class,
|
||||
mbed::Callback<void(void)>ack_expiry_handler)
|
||||
{
|
||||
_device_class = device_class;
|
||||
|
@ -1331,12 +1336,12 @@ void LoRaMac::set_device_class(const device_class_t& device_class,
|
|||
} else if (CLASS_C == _device_class) {
|
||||
_params.is_node_ack_requested = false;
|
||||
_lora_phy.put_radio_to_sleep();
|
||||
_lora_phy.compute_rx_win_params(
|
||||
_params.sys_params.rx2_channel.datarate,
|
||||
_lora_phy.compute_rx_win_params(_params.sys_params.rx2_channel.datarate,
|
||||
_params.sys_params.min_rx_symb,
|
||||
_params.sys_params.max_sys_rx_error,
|
||||
&_params.rx_window2_config);
|
||||
}
|
||||
|
||||
if (CLASS_C == _device_class) {
|
||||
tr_debug("Changing device class to -> CLASS_C");
|
||||
open_rx2_window();
|
||||
|
@ -1358,10 +1363,10 @@ lorawan_status_t LoRaMac::prepare_join(const lorawan_connect_t *params, bool is_
|
|||
{
|
||||
if (params) {
|
||||
if (is_otaa) {
|
||||
if ((params->connection_u.otaa.dev_eui == NULL) ||
|
||||
(params->connection_u.otaa.app_eui == NULL) ||
|
||||
(params->connection_u.otaa.app_key == NULL) ||
|
||||
(params->connection_u.otaa.nb_trials == 0)) {
|
||||
if ((params->connection_u.otaa.dev_eui == NULL)
|
||||
|| (params->connection_u.otaa.app_eui == NULL)
|
||||
|| (params->connection_u.otaa.app_key == NULL)
|
||||
|| (params->connection_u.otaa.nb_trials == 0)) {
|
||||
return LORAWAN_STATUS_PARAMETER_INVALID;
|
||||
}
|
||||
_params.keys.dev_eui = params->connection_u.otaa.dev_eui;
|
||||
|
@ -1411,13 +1416,12 @@ lorawan_status_t LoRaMac::prepare_join(const lorawan_connect_t *params, bool is_
|
|||
_params.net_id = (MBED_CONF_LORA_DEVICE_ADDRESS & LORAWAN_NETWORK_ID_MASK);
|
||||
_params.dev_addr = MBED_CONF_LORA_DEVICE_ADDRESS;
|
||||
|
||||
memcpy(_params.keys.nwk_skey, nwk_skey,
|
||||
sizeof(_params.keys.nwk_skey));
|
||||
memcpy(_params.keys.nwk_skey, nwk_skey, sizeof(_params.keys.nwk_skey));
|
||||
|
||||
memcpy(_params.keys.app_skey, app_skey,
|
||||
sizeof(_params.keys.app_skey));
|
||||
memcpy(_params.keys.app_skey, app_skey, sizeof(_params.keys.app_skey));
|
||||
#endif
|
||||
}
|
||||
|
||||
return LORAWAN_STATUS_OK;
|
||||
}
|
||||
|
||||
|
@ -1453,7 +1457,7 @@ lorawan_status_t LoRaMac::prepare_frame(loramac_mhdr_t *machdr,
|
|||
uint16_t i;
|
||||
uint8_t pkt_header_len = 0;
|
||||
uint32_t mic = 0;
|
||||
const void* payload = fbuffer;
|
||||
const void *payload = fbuffer;
|
||||
uint8_t frame_port = fport;
|
||||
lorawan_status_t status = LORAWAN_STATUS_OK;
|
||||
|
||||
|
@ -1605,7 +1609,7 @@ lorawan_status_t LoRaMac::prepare_frame(loramac_mhdr_t *machdr,
|
|||
break;
|
||||
case FRAME_TYPE_PROPRIETARY:
|
||||
if ((fbuffer != NULL) && (_params.tx_buffer_len > 0)) {
|
||||
memcpy(_params.tx_buffer + pkt_header_len, (uint8_t*) fbuffer,
|
||||
memcpy(_params.tx_buffer + pkt_header_len, (uint8_t *) fbuffer,
|
||||
_params.tx_buffer_len);
|
||||
_params.tx_buffer_len = pkt_header_len + _params.tx_buffer_len;
|
||||
}
|
||||
|
@ -1654,19 +1658,19 @@ lorawan_status_t LoRaMac::send_frame_on_channel(uint8_t channel)
|
|||
|
||||
void LoRaMac::reset_mcps_confirmation()
|
||||
{
|
||||
memset((uint8_t*) &_mcps_confirmation, 0, sizeof(_mcps_confirmation));
|
||||
memset((uint8_t *) &_mcps_confirmation, 0, sizeof(_mcps_confirmation));
|
||||
_mcps_confirmation.status = LORAMAC_EVENT_INFO_STATUS_ERROR;
|
||||
}
|
||||
|
||||
void LoRaMac::reset_mlme_confirmation()
|
||||
{
|
||||
memset((uint8_t*) &_mlme_confirmation, 0, sizeof(_mlme_confirmation));
|
||||
memset((uint8_t *) &_mlme_confirmation, 0, sizeof(_mlme_confirmation));
|
||||
_mlme_confirmation.status = LORAMAC_EVENT_INFO_STATUS_ERROR;
|
||||
}
|
||||
|
||||
void LoRaMac::reset_mcps_indication()
|
||||
{
|
||||
memset((uint8_t*) &_mcps_indication, 0, sizeof(_mcps_indication));
|
||||
memset((uint8_t *) &_mcps_indication, 0, sizeof(_mcps_indication));
|
||||
_mcps_indication.status = LORAMAC_EVENT_INFO_STATUS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -1800,7 +1804,7 @@ void LoRaMac::set_nwk_joined(bool joined)
|
|||
_is_nwk_joined = joined;
|
||||
}
|
||||
|
||||
lorawan_status_t LoRaMac::add_channel_plan(const lorawan_channelplan_t& plan)
|
||||
lorawan_status_t LoRaMac::add_channel_plan(const lorawan_channelplan_t &plan)
|
||||
{
|
||||
if (tx_ongoing()) {
|
||||
return LORAWAN_STATUS_BUSY;
|
||||
|
@ -1818,7 +1822,7 @@ lorawan_status_t LoRaMac::remove_channel_plan()
|
|||
return _channel_plan.remove_plan();
|
||||
}
|
||||
|
||||
lorawan_status_t LoRaMac::get_channel_plan(lorawan_channelplan_t& plan)
|
||||
lorawan_status_t LoRaMac::get_channel_plan(lorawan_channelplan_t &plan)
|
||||
{
|
||||
return _channel_plan.get_plan(plan, _lora_phy.get_phy_channels());
|
||||
}
|
||||
|
@ -1856,8 +1860,7 @@ lorawan_status_t LoRaMac::multicast_channel_link(multicast_params_t *channel_par
|
|||
return LORAWAN_STATUS_OK;
|
||||
}
|
||||
|
||||
lorawan_status_t LoRaMac::multicast_channel_unlink(
|
||||
multicast_params_t *channel_param)
|
||||
lorawan_status_t LoRaMac::multicast_channel_unlink(multicast_params_t *channel_param)
|
||||
{
|
||||
if (channel_param == NULL) {
|
||||
return LORAWAN_STATUS_PARAMETER_INVALID;
|
||||
|
@ -1887,7 +1890,7 @@ lorawan_status_t LoRaMac::multicast_channel_unlink(
|
|||
return LORAWAN_STATUS_OK;
|
||||
}
|
||||
|
||||
void LoRaMac::bind_radio_driver(LoRaRadio& radio)
|
||||
void LoRaMac::bind_radio_driver(LoRaRadio &radio)
|
||||
{
|
||||
_lora_phy.set_radio_instance(radio);
|
||||
}
|
||||
|
@ -1898,7 +1901,7 @@ void LoRaMac::bind_radio_driver(LoRaRadio& radio)
|
|||
**************************************************************************/
|
||||
|
||||
|
||||
lorawan_status_t LoRaMac::mlme_request( loramac_mlme_req_t *mlmeRequest )
|
||||
lorawan_status_t LoRaMac::mlme_request(loramac_mlme_req_t *mlmeRequest)
|
||||
{
|
||||
if (LORAMAC_IDLE != _params.mac_state) {
|
||||
return LORAWAN_STATUS_BUSY;
|
||||
|
@ -1933,7 +1936,6 @@ lorawan_status_t LoRaMac::mlme_request( loramac_mlme_req_t *mlmeRequest )
|
|||
_params.flags.bits.mlme_req = 0;
|
||||
}
|
||||
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -2007,7 +2009,7 @@ lorawan_status_t LoRaMac::LoRaMacSetTxTimer( uint32_t TxDutyCycleTime )
|
|||
return LORAWAN_STATUS_OK;
|
||||
}
|
||||
|
||||
lorawan_status_t LoRaMac::LoRaMacStopTxTimer( )
|
||||
lorawan_status_t LoRaMac::LoRaMacStopTxTimer( )
|
||||
{
|
||||
_lora_time.stop(tx_next_packet_timer);
|
||||
return LORAWAN_STATUS_OK;
|
||||
|
|
|
@ -135,7 +135,7 @@ public:
|
|||
* \ref LORAWAN_STATUS_BUSY
|
||||
* \ref LORAWAN_STATUS_PARAMETER_INVALID
|
||||
*/
|
||||
lorawan_status_t add_channel_plan(const lorawan_channelplan_t& plan);
|
||||
lorawan_status_t add_channel_plan(const lorawan_channelplan_t &plan);
|
||||
|
||||
/**
|
||||
* @brief Removes a channel plan from the system.
|
||||
|
@ -166,7 +166,7 @@ public:
|
|||
* \ref LORAWAN_STATUS_BUSY
|
||||
* \ref LORAWAN_STATUS_PARAMETER_INVALID
|
||||
*/
|
||||
lorawan_status_t get_channel_plan(lorawan_channelplan_t& plan);
|
||||
lorawan_status_t get_channel_plan(lorawan_channelplan_t &plan);
|
||||
|
||||
/**
|
||||
* @brief Remove a given channel from the active plan.
|
||||
|
@ -221,7 +221,7 @@ public:
|
|||
* @param radio LoRaRadio object, i.e., the radio driver
|
||||
*
|
||||
*/
|
||||
void bind_radio_driver(LoRaRadio& radio);
|
||||
void bind_radio_driver(LoRaRadio &radio);
|
||||
|
||||
/**
|
||||
* @brief Configures the events to trigger an MLME-Indication with
|
||||
|
@ -333,7 +333,7 @@ public:
|
|||
* @param num_retries Number of retries for a confirmed type message
|
||||
* @return The number of bytes prepared for sending.
|
||||
*/
|
||||
int16_t prepare_ongoing_tx(const uint8_t port, const uint8_t* data,
|
||||
int16_t prepare_ongoing_tx(const uint8_t port, const uint8_t *data,
|
||||
uint16_t length, uint8_t flags, uint8_t num_retries);
|
||||
|
||||
/**
|
||||
|
@ -353,7 +353,7 @@ public:
|
|||
* @param device_class Device class to use.
|
||||
* @param ack_expiry_handler callback function to inform about ack expiry
|
||||
*/
|
||||
void set_device_class(const device_class_t& device_class,
|
||||
void set_device_class(const device_class_t &device_class,
|
||||
mbed::Callback<void(void)>ack_expiry_handler);
|
||||
|
||||
/**
|
||||
|
@ -391,7 +391,7 @@ public:
|
|||
/**
|
||||
* MAC operations upon reception
|
||||
*/
|
||||
void on_radio_rx_done(const uint8_t* const payload, uint16_t size,
|
||||
void on_radio_rx_done(const uint8_t *const payload, uint16_t size,
|
||||
int16_t rssi, int8_t snr);
|
||||
|
||||
/**
|
||||
|
@ -460,8 +460,16 @@ public:
|
|||
* the stack thread safe.
|
||||
*/
|
||||
#if MBED_CONF_RTOS_PRESENT
|
||||
void lock(void) { osStatus status = _mutex.lock(); MBED_ASSERT(status == osOK); }
|
||||
void unlock(void) { osStatus status = _mutex.unlock(); MBED_ASSERT(status == osOK); }
|
||||
void lock(void)
|
||||
{
|
||||
osStatus status = _mutex.lock();
|
||||
MBED_ASSERT(status == osOK);
|
||||
}
|
||||
void unlock(void)
|
||||
{
|
||||
osStatus status = _mutex.unlock();
|
||||
MBED_ASSERT(status == osOK);
|
||||
}
|
||||
#else
|
||||
void lock(void) { }
|
||||
void unlock(void) { }
|
||||
|
|
|
@ -272,8 +272,7 @@
|
|||
/**
|
||||
* TX configuration parameters.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/**
|
||||
* The TX channel.
|
||||
*/
|
||||
|
@ -304,8 +303,7 @@ typedef struct
|
|||
* This structure contains parameters for ADR request coming from
|
||||
* network server.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
/*!
|
||||
* A pointer to the payload containing the MAC commands.
|
||||
*/
|
||||
|
@ -339,8 +337,7 @@ typedef struct
|
|||
/**
|
||||
* Structure containing data for local ADR settings
|
||||
*/
|
||||
typedef struct link_adr_params_s
|
||||
{
|
||||
typedef struct link_adr_params_s {
|
||||
/**
|
||||
* The number of repetitions.
|
||||
*/
|
||||
|
@ -367,8 +364,7 @@ typedef struct link_adr_params_s
|
|||
* Structure used to store ADR values received from network
|
||||
* for verification (legality) purposes.
|
||||
*/
|
||||
typedef struct verify_adr_params_s
|
||||
{
|
||||
typedef struct verify_adr_params_s {
|
||||
/*!
|
||||
* The current status of the AdrLinkRequest.
|
||||
*/
|
||||
|
@ -412,8 +408,7 @@ typedef struct verify_adr_params_s
|
|||
* Contains rx parameter setup request coming from
|
||||
* network server.
|
||||
*/
|
||||
typedef struct rx_param_setup_req_s
|
||||
{
|
||||
typedef struct rx_param_setup_req_s {
|
||||
/**
|
||||
* The datarate to set up.
|
||||
*/
|
||||
|
@ -431,8 +426,7 @@ typedef struct rx_param_setup_req_s
|
|||
/**
|
||||
* The parameter structure for the function RegionNextChannel.
|
||||
*/
|
||||
typedef struct channel_selection_params_s
|
||||
{
|
||||
typedef struct channel_selection_params_s {
|
||||
/**
|
||||
* The aggregated time-off time.
|
||||
*/
|
||||
|
@ -458,8 +452,7 @@ typedef struct channel_selection_params_s
|
|||
/*!
|
||||
* The parameter structure for the function RegionContinuousWave.
|
||||
*/
|
||||
typedef struct continuous_wave_mode_params_s
|
||||
{
|
||||
typedef struct continuous_wave_mode_params_s {
|
||||
/*!
|
||||
* The current channel index.
|
||||
*/
|
||||
|
|
|
@ -204,7 +204,7 @@ typedef struct lorawan_connect {
|
|||
*
|
||||
*/
|
||||
typedef enum lora_events {
|
||||
CONNECTED=0,
|
||||
CONNECTED = 0,
|
||||
DISCONNECTED,
|
||||
TX_DONE,
|
||||
TX_TIMEOUT,
|
||||
|
@ -288,7 +288,7 @@ typedef union {
|
|||
* The allowed ranges are region-specific.
|
||||
* Please refer to \ref DR_0 to \ref DR_15 for details.
|
||||
*/
|
||||
int8_t min :4;
|
||||
int8_t min : 4;
|
||||
/**
|
||||
* The maximum data rate.
|
||||
*
|
||||
|
@ -297,7 +297,7 @@ typedef union {
|
|||
* The allowed ranges are region-specific.
|
||||
* Please refer to \ref DR_0 to \ref DR_15 for details.
|
||||
*/
|
||||
int8_t max :4;
|
||||
int8_t max : 4;
|
||||
} fields;
|
||||
} dr_range_t;
|
||||
|
||||
|
|
|
@ -431,8 +431,7 @@ typedef union {
|
|||
/*!
|
||||
* The structure containing single access to header bits.
|
||||
*/
|
||||
struct hdr_bits_s
|
||||
{
|
||||
struct hdr_bits_s {
|
||||
/*!
|
||||
* Major version.
|
||||
*/
|
||||
|
@ -461,8 +460,7 @@ typedef union {
|
|||
/*!
|
||||
* The structure containing single access to bits.
|
||||
*/
|
||||
struct ctrl_bits_s
|
||||
{
|
||||
struct ctrl_bits_s {
|
||||
/*!
|
||||
* Frame options length.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue