Commit Graph

28581 Commits (feature-lorawan-1-1)

Author SHA1 Message Date
Antti Kauppila d98f42f057
Merge pull request #12762 from rvolosatovs/fix/lorawan-1.1
Various LoRaWAN 1.1 fixes
2020-04-13 07:36:26 +03:00
Roman Volosatovs e90fc00176
Fix MIC calculation in LoRaWAN 1.1 2020-04-10 16:02:01 +02:00
Roman Volosatovs 69ed8ed1a9
Avoid sending DeviceModeInd twice 2020-04-06 12:48:19 +02:00
Roman Volosatovs caa8abfc7b
Fix handling of DeviceModeInd and BeaconFreqAns 2020-04-06 12:47:56 +02:00
Roman Volosatovs d60bbd60d0 Add missing 1.1 MAC command tests 2020-02-06 18:38:36 +02:00
Roman Volosatovs 75cc50e853 Fix handling of 1.1 MAC commands 2020-02-06 18:38:36 +02:00
Antti Kauppila 7fb6efa9cd Unittests fixed 2020-02-06 18:38:36 +02:00
Unknown 694790f5fe Class B feature branch rebase conflict fixes
Picked the wrong diff a few times while resolving rebase conflicts.
2020-02-06 18:38:36 +02:00
Unknown 042a2f58cc Fix unit tests
Code review requested changes
2020-02-06 18:38:36 +02:00
Unknown 672de92e4a Unit test fix
Add missing Class B flags to unit test cmake
2020-02-06 18:38:36 +02:00
Unknown cf834bddb8 Fix get_rx1_frequency
Return alternate RX1 if set
2020-02-06 18:38:36 +02:00
Unknown 65e1e9c222 Fix Beacon Time On Air Computation
Beacon time on air  computation bandwidth param was hard coded to 500 KHz.  Now  it is read from the phy bandwidths table.
2020-02-06 18:38:36 +02:00
Unknown 00dc81114d Fix IN865 Beacon Frequency
Set IN865 beacon frequency to 866.55 MHz
2020-02-06 18:38:36 +02:00
Unknown bd3549f74b Astyle fixes
astyle on unit test sources
2020-02-06 18:38:36 +02:00
Unknown e92966f806 Unit Test LoRaPHY
Fix compilation failures caused by lorawan api changes introduced by Class B support
2020-02-06 18:38:36 +02:00
Unknown bf2e7a712a Unit Test LoRaPHY: rx_config test updates
LoRaPHY::rx_config() is now used by all regions. All region specific implementations have been removed.
2020-02-06 18:38:36 +02:00
Unknown 33e076ce55 Unit Test LoRaWANStack: Remove set class B device class test
With class B now being available the device class test moved to the LoRaMac class which then queries the Class B interface for support.  
The Class B interface is not available here because the unit test stack class instantiates a LoRaMac stub class .
2020-02-06 18:38:36 +02:00
Unknown 0cca8f0ed9 Fix unit tests
Fix compilation failures caused by lorawan api changes introduced by Class B support.
2020-02-06 18:38:36 +02:00
Unknown 663c94e13d Add LoRaWANInterface Class B API related documentation
- Documented LoRaWANInterface beacon acquisition,  and ping slot APIs
- Existing GPS time set/get documentation was only in LoRaWANStack.h, so I copied their docs to LoRaWANInterface and lightly modified them 
  to be a higher level description like the other documentation in this file.
- Updated  set_utc_time to handle millisecond precision gps time.
2020-02-06 18:38:36 +02:00
Shaun Nelson 043ddcda8f Another astyle format change 2020-02-06 18:38:36 +02:00
Shaun Nelson d90a489e67 astyle formatting 2020-02-06 18:38:36 +02:00
Unknown fc4ce50321 Fix Travis astyle failures
Ran asytle to fix line ending s
2020-02-06 18:38:36 +02:00
Unknown f12c071591 Function documentation cleanup 2020-02-06 18:38:36 +02:00
Unknown 6e59fb8ad0 Move class B resume and close rx window improvement
Use close_rx_window  callback to disable active class b window. This change protects against disabling the radio during class A transmit 
Move class B resume notification to one location in LoRaMac::set_tx_ongoing()
2020-02-06 18:38:36 +02:00
Unknown 690ee0f951 Add a return status to Rx window computation functions
- Added a bool return status to  LoRaPHY::compute_*_win_params(...)   methods. Currently, failed status returned if the rx slot type is invalid or rf frequency is invalid
 - Updated Class B implementation to check return status
2020-02-06 18:38:36 +02:00
Unknown dacc5b9674 License headers
- 2019 for new file
- Added license where missing
2020-02-06 18:38:36 +02:00
Shaun Nelson 833b0e1f4f Radio not put to sleep after class A Rx windows.
The Rx done/timeout event handler now checks if the radio is currently
transmitting before putting the radio to sleep. This test returns true in
class A rx window event handlers, so the radio is not not put to sleep.

Now to accurately test if transmitting, a mod ongoing flag is set true on send
and false on tx done/timeout.
2020-02-06 18:38:36 +02:00
Unknown 089ece4c63 Doxygen formatting
Reviewed and fixed  potential doxygen format issues.
2020-02-06 18:38:36 +02:00
Unknown 4e11aa0bcc Astyle format ting
99.9% white space changes
2020-02-06 18:38:36 +02:00
Unknown ab166720f2 Add back Class B Rx handler skip optimization
Skip handler check was dropped on the last commit moving the static class b api out of its class to an interface.
2020-02-06 18:38:36 +02:00
Unknown edd9b5c40b mbed-os style update: Add LoRaMacClassBInterface
Make class function names lower case. Previously, class b's public  interface was part of the class and to avoid function name conflicts the static API was being distinguished from instance methods  by upper-casing the first letter. 
Fixed by moving the public interface to new LoRaMacClassBInterface
2020-02-06 18:38:36 +02:00
Unknown 75dcacd33a Add back PHY computed ping slot window offset
Removed unintentionally in last commit
2020-02-06 18:38:36 +02:00
Unknown 0dfd7d54bd Remove extra beacon debug setting
Was only used to print bad beacon frames
2020-02-06 18:38:36 +02:00
Unknown bf7b6be032 Fix LoRaWAN interface gps time type
Switched to  high precision gps time
2020-02-06 18:38:36 +02:00
Unknown 002f7fc306 Moved Beacon GPS time set
Moved from stack to class b beacon handler
2020-02-06 18:38:36 +02:00
Unknown 7656e91630 Fix PingSlotInfoReq parsing
PingSlotInfoReq 1 byte payload
2020-02-06 18:38:36 +02:00
Unknown 75b588412a Reorder class b slot types by priority 2020-02-06 18:38:36 +02:00
Unknown a28d6ec615 Fix class b disable timers
Stop beacon acquisition timer
2020-02-06 18:38:36 +02:00
Unknown 78b55c3ffc Stack Class B support
- Switched to millisecond gps time
- Updated process rx/rx_timeout events for  class B windows
- Added beacon event callback
2020-02-06 18:38:36 +02:00
Unknown 61cd2d7a05 LoRaRadio on air time computation
Instead of implementing this in each derived radio class, let's do it once here.
2020-02-06 18:38:36 +02:00
Unknown e6ea8309b3 Add core Class B implementation
Here it is - the main Class B functionaiity
2020-02-06 18:38:36 +02:00
Unknown bb878fea8a PHY Class B configuration
- Initialize Class B configuration
- Implement class B receiver configuration
- For regions such as US915 with derived rx_config(),  changes to the base class implementation makes the derivation unnecessary , so these region specific versions have been removed
2020-02-06 18:38:36 +02:00
Unknown bf6f45a05b PHY Class B handling
Support class b beacon and ping slot rx configuration
2020-02-06 18:38:36 +02:00
Unknown 0a30aeeec2 PHY Class B beacon and ping slot configuration
- Add PHY beacon and ping slot configuration
2020-02-06 18:38:36 +02:00
Unknown 62bcb061e5 Class B json configuration
Added Class B configuration
2020-02-06 18:38:36 +02:00
Unknown 792269305f LoRaWAN Interface Class B APIs
Added:
-  enable beacon acquisition
-  add/remove PingSlotInfoReq MAC  command
-  get last received beacon
2020-02-06 18:38:36 +02:00
Unknown ff16ddd8c3 Add Class B related MAC Commands
-  PingSlotInfoReq & PingSlotInfoAns 
-  PingSlotChannelReq & PingSlotChannelAns
-  BeaconFreqReq & BeaconFreqAns

Switch to millisecond computation for  device time handling
2020-02-06 18:38:36 +02:00
Unknown 88c44480c4 Add Crypto ping slot random offset computation
Implement ping slot pseudo-random offset computation
2020-02-06 18:38:36 +02:00
Unknown 42ddb617d9 Switch to millisecond resolution gps time
The existing gps time  resolution is seconds, while class b beacon and ping slot scheduling requires millisecond resolution.
This set of changes switches gps time to  millisecond resolution.
2020-02-06 18:38:36 +02:00
Hasnain Virk d7a57fb0f3 Fixing DevTimeAns handling
As per discussion with Nicolas Sornin, any device time synchronization
value must be handled as is (monotonically increasing GPS epoch time guaranteed to be monotonic with granularity 1 second).

Once we receive a response to DevTimeReq (i.e., DevTimeAns is received)
we immediately set our local gps time stamp and take a snapshot of our
local monotonic (ticker or equivalent) clock. This is achieved by
calling 'set_gps_time(...)' API in the LoRaWANTimer module.
After that an event is generated to let the application know that a
device time has been synched.
2020-02-06 18:38:36 +02:00