Skip to content

LoRaWAN code in separate class (or repo?) #470

@TD-er

Description

@TD-er

I was looking to integrate parts of your Lorawan code into my own project (ESPEasy) and I came across a few small issues.

First to make it clear where I borrowed the code from (the credentials part), I would like to have the lorawan.h/.cpp files as much the same as you have.
It also would allow me to later merge fixes you have and it would make my own code a lot more clean.

Still it looks better to have it in one C++ object, so I started wrapping it into a class to have it even more contained.
This lead to some compiler issues which may also be indicative of latent problems you may encounter later on.

For example:
Some functions -like the callback functions- need to be static in order to have them set as callback function.
You don't have that compiler/linker issue right now, since your functions are declared in global scope.
Simply adding static to the function declarations in the header file does stop the compiler from complaining, but that's quite dangerous if the header file will be included more than once.

Does it sound OK to you if I would propose a PR to have the lorawan code in a separate class?
This class would then be responsible for creating the queue, lmic task and handling all lora traffic.

I did notice you were also working on the Lora part, so multiple big changes on the same code at the same time is maybe not the most practical :)
Did you plan to work on the lorawan part for a longer period now?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestwontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions