Some changes and feature additions #172
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My additions and corrections :
Class C behavior was wrong, right after sending uplink, device opens RX2 continously with fixed SF,BW and Frequency. Therefore device could not hear any downlink on RX1 window. With my changes, device can hear downlink messages including ACK bit.
(Refer to : https://lora-developers.semtech.com/documentation/tech-papers-and-guides/lorawan-class-c-devices/
https://lora-alliance.org/resource_hub/rp002-1-0-0-lorawan-regional-parameters/ )
For class selection, I add a definition in Config file. When you define it, mode will be Class C otherwise Class A.
I changed message receiving structure. I made it with callback function to provide a bit of abstraction.
I add "isConfirmed" feature to be able to send ACK info in case we get confirmed downlink from NS.
I create sendACK function In case of getting confirmed downlink.
I correct readAck function by eding a line of code to clear previous ACK bit.
I use Chirpstack NS and test the example code I added, It works great.
I am sorry that I make changes a bit of carelessly since I dont have sufficent time, I couldn't do all the thing I want to do.
If I have more time, I will go on developing...