Skip to content

Commit b00a91d

Browse files
author
Cruz Monrreal
authored
Merge pull request #6938 from hasnainvirk/style_and_bug_fixes
LoRaWAN: Style and bug fixes
2 parents 3206b81 + 0f0b3be commit b00a91d

File tree

10 files changed

+648
-615
lines changed

10 files changed

+648
-615
lines changed

features/lorawan/LoRaWANBase.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class LoRaWANBase {
217217
* LORAWAN_STATUS_WOULD_BLOCK if another TX is
218218
* ongoing, or a negative error code on failure.
219219
*/
220-
virtual int16_t send(uint8_t port, const uint8_t* data,
220+
virtual int16_t send(uint8_t port, const uint8_t *data,
221221
uint16_t length, int flags) = 0;
222222

223223
/** Receives a message from the Network Server on a specific port.
@@ -259,7 +259,7 @@ class LoRaWANBase {
259259
* nothing available to read at the moment.
260260
* iv) A negative error code on failure.
261261
*/
262-
virtual int16_t receive(uint8_t port, uint8_t* data, uint16_t length, int flags) = 0;
262+
virtual int16_t receive(uint8_t port, uint8_t *data, uint16_t length, int flags) = 0;
263263

264264
/** Receives a message from the Network Server from any port.
265265
*
@@ -283,7 +283,7 @@ class LoRaWANBase {
283283
* nothing available to read at the moment.
284284
* iv) A negative error code on failure.
285285
*/
286-
virtual int16_t receive(uint8_t* data, uint16_t length, uint8_t& port, int& flags) = 0;
286+
virtual int16_t receive(uint8_t *data, uint16_t length, uint8_t &port, int &flags) = 0;
287287

288288
/** Add application callbacks to the stack.
289289
*

features/lorawan/LoRaWANInterface.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
using namespace events;
2525

26-
LoRaWANInterface::LoRaWANInterface(LoRaRadio& radio)
26+
LoRaWANInterface::LoRaWANInterface(LoRaRadio &radio)
2727
{
2828
_lw_stack.bind_radio_driver(radio);
2929
}
@@ -116,7 +116,7 @@ lorawan_status_t LoRaWANInterface::remove_channel_plan()
116116
return _lw_stack.drop_channel_list();
117117
}
118118

119-
int16_t LoRaWANInterface::send(uint8_t port, const uint8_t* data, uint16_t length, int flags)
119+
int16_t LoRaWANInterface::send(uint8_t port, const uint8_t *data, uint16_t length, int flags)
120120
{
121121
Lock lock(*this);
122122
return _lw_stack.handle_tx(port, data, length, flags);
@@ -146,13 +146,13 @@ lorawan_status_t LoRaWANInterface::get_backoff_metadata(int &backoff)
146146
return _lw_stack.acquire_backoff_metadata(backoff);
147147
}
148148

149-
int16_t LoRaWANInterface::receive(uint8_t port, uint8_t* data, uint16_t length, int flags)
149+
int16_t LoRaWANInterface::receive(uint8_t port, uint8_t *data, uint16_t length, int flags)
150150
{
151151
Lock lock(*this);
152152
return _lw_stack.handle_rx(data, length, port, flags, true);
153153
}
154154

155-
int16_t LoRaWANInterface::receive(uint8_t* data, uint16_t length, uint8_t& port, int& flags)
155+
int16_t LoRaWANInterface::receive(uint8_t *data, uint16_t length, uint8_t &port, int &flags)
156156
{
157157
Lock lock(*this);
158158
return _lw_stack.handle_rx(data, length, port, flags, false);

features/lorawan/LoRaWANInterface.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class LoRaWANInterface: public LoRaWANBase {
3434
* construct a single instance of LoRaWANInterface.
3535
*
3636
*/
37-
LoRaWANInterface(LoRaRadio& radio);
37+
LoRaWANInterface(LoRaRadio &radio);
3838

3939
virtual ~LoRaWANInterface();
4040

@@ -315,7 +315,7 @@ class LoRaWANInterface: public LoRaWANBase {
315315
* LORAWAN_STATUS_WOULD_BLOCK if another TX is
316316
* ongoing, or a negative error code on failure.
317317
*/
318-
virtual int16_t send(uint8_t port, const uint8_t* data, uint16_t length,
318+
virtual int16_t send(uint8_t port, const uint8_t *data, uint16_t length,
319319
int flags);
320320

321321
/** Receives a message from the Network Server on a specific port.
@@ -357,7 +357,7 @@ class LoRaWANInterface: public LoRaWANBase {
357357
* nothing available to read at the moment.
358358
* iv) A negative error code on failure.
359359
*/
360-
virtual int16_t receive(uint8_t port, uint8_t* data, uint16_t length, int flags);
360+
virtual int16_t receive(uint8_t port, uint8_t *data, uint16_t length, int flags);
361361

362362
/** Receives a message from the Network Server on any port.
363363
*
@@ -381,7 +381,7 @@ class LoRaWANInterface: public LoRaWANBase {
381381
* nothing available to read at the moment.
382382
* iv) A negative error code on failure.
383383
*/
384-
virtual int16_t receive(uint8_t* data, uint16_t length, uint8_t& port, int& flags);
384+
virtual int16_t receive(uint8_t *data, uint16_t length, uint8_t &port, int &flags);
385385

386386
/** Add application callbacks to the stack.
387387
*
@@ -502,8 +502,14 @@ class LoRaWANInterface: public LoRaWANBase {
502502
*/
503503
virtual lorawan_status_t cancel_sending(void);
504504

505-
void lock(void) { _lw_stack.lock(); }
506-
void unlock(void) { _lw_stack.unlock(); }
505+
void lock(void)
506+
{
507+
_lw_stack.lock();
508+
}
509+
void unlock(void)
510+
{
511+
_lw_stack.unlock();
512+
}
507513

508514

509515
private:

0 commit comments

Comments
 (0)