Skip to content

LoRaWAN: Style and bug fixes #6938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions features/lorawan/LoRaWANBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class LoRaWANBase {
* 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.
Expand Down Expand Up @@ -259,7 +259,7 @@ class LoRaWANBase {
* 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.
*
Expand All @@ -283,7 +283,7 @@ class LoRaWANBase {
* 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.
*
Expand Down
8 changes: 4 additions & 4 deletions features/lorawan/LoRaWANInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

using namespace events;

LoRaWANInterface::LoRaWANInterface(LoRaRadio& radio)
LoRaWANInterface::LoRaWANInterface(LoRaRadio &radio)
{
_lw_stack.bind_radio_driver(radio);
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
18 changes: 12 additions & 6 deletions features/lorawan/LoRaWANInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class LoRaWANInterface: public LoRaWANBase {
* construct a single instance of LoRaWANInterface.
*
*/
LoRaWANInterface(LoRaRadio& radio);
LoRaWANInterface(LoRaRadio &radio);

virtual ~LoRaWANInterface();

Expand Down Expand Up @@ -315,7 +315,7 @@ class LoRaWANInterface: public LoRaWANBase {
* 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.
Expand Down Expand Up @@ -357,7 +357,7 @@ class LoRaWANInterface: public LoRaWANBase {
* 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.
*
Expand All @@ -381,7 +381,7 @@ class LoRaWANInterface: public LoRaWANBase {
* 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.
*
Expand Down Expand Up @@ -502,8 +502,14 @@ class LoRaWANInterface: public LoRaWANBase {
*/
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:
Expand Down
Loading