Commit Graph

91 Commits (18fa9414cd21deb17790c8a484e75f5ae2be6e2e)

Author SHA1 Message Date
Kimmo Vaisanen d336ceeee8 Lora: Make automatic uplink message configurable
Currently lora stack will automatically send an empty uplink message to lora gateway in case of:
- Node received message with pending bit set.
- Node received MAC command which requires instant response (sticky MAC command)
- Node received confirmed message in class C mode

This commit makes this configurable via config item

        "automatic-uplink-message": {
            "help": "In case of pending bit, class c confirmed message or sticky MAC command, stack will automatically send empty uplink message",
            "value": true
        }

Default value is true. If sending an empty message fails, stack will send event AUTOMATIC_UPLINK_ERROR application.

If automatic uplink sending is disabled, stack will send application UPLINK_REQUIRED -event to indicate
application should issue a new uplink to gateway as soon as possible.
2018-04-18 09:29:20 +03:00
Cruz Monrreal 4522405d06
Merge pull request #6588 from hasnainvirk/base_structs
[IOTCELL-741] Separating public data structures
2018-04-17 10:54:45 -05:00
Cruz Monrreal 4343253533
Merge pull request #6600 from hasnainvirk/fix_au915
[IOTCELL] Setting up channels for AU915
2018-04-13 10:47:21 -05:00
Hasnain Virk c34b5e6d6f [IOTCELL-741] Separating public data structures
Any data structure used in LoRaWANBase class should be available
in a separate header in order to make the code easy to port and
easy to read as the developer doesn't need to know about all the
internal data structures being used in Mbed LoRaWAN stack.
2018-04-13 10:41:06 +03:00
Cruz Monrreal 68ebbb0637
Merge pull request #6569 from kivaisan/LORAWAN_FEATURE_BRANCH
Lora: small fixes
2018-04-12 18:43:01 -05:00
Cruz Monrreal 94103f9306
Merge pull request #6586 from kivaisan/new_receive_method
Lora: Introduce new receive API which returns port and flags
2018-04-12 18:32:12 -05:00
Hasnain Virk ec34796fd5 [IOTCELL] Setting up channels for AU915
Bug was reported by @tpet93 and it was correctly diagnosed that channels
were not being set in the phy_params structure. This commit fixes the bug
and sets up channels correctly.
2018-04-11 15:41:22 +03:00
Antti Kauppila 67157fc3bd LoRa: Internal include paths corrected 2018-04-10 14:04:18 +03:00
Kimmo Vaisanen 19883f12f8 Lora: Introduce new receive API which returns port and flags
This is a fix for issue #6389.

Currently when application receives RX_DONE event from stack, it has to provide the correct port
value to receive method in order to read the received message. The problem is that current
API does not provide any way to know in to which port message was received.

This commit introduces a new receive() method, which instead of checking these values, will return
them to application.
2018-04-10 13:04:23 +03:00
Kimmo Vaisanen 01fd8804df Fix Coverity warning
Fixed Coverity warning "stored value is overwritten before it can be used".
2018-04-10 10:19:03 +03:00
Kimmo Vaisanen 10c269bcfa Add some debug traces 2018-04-10 10:19:03 +03:00
Kimmo Vaisanen f6decc0131 Initialize mcps_indication status
_mcps_indication.status is not initialized properly and it can cause incorrect
status value to be returned.
2018-04-10 10:13:40 +03:00
Kevin Bracey 96610a6aed LoRa: Improved region macro handling 2018-04-09 15:22:48 +03:00
Antti Kauppila 1a86bb3604 Removed default values from internal functions
- Also removed useless else from loraphy_target.h
2018-04-09 13:30:08 +03:00
Antti Kauppila db167af3c1 LoRa: Fixed doxygen error, enabled commented out code 2018-04-09 11:48:03 +03:00
Antti Kauppila fa062fff76 LoRa: Moved connect logic from LoRaWANStack to LoRaMac class
- Internal change only
2018-04-09 11:10:40 +03:00
Antti Kauppila 1310392d1b LoRa: Removed unneeded function and cleaned up some code 2018-04-09 11:10:40 +03:00
Antti Kauppila d1bbd21e01 LoRa: Improved handling of region selection
- This implements IOTCELL-697
- This touches API, but does not break it, old ones still work in a same manner!
2018-04-09 11:10:40 +03:00
Antti Kauppila 6ef331b9db LoRa: Fixed cflist decoding issue
- This fixes defect IOTCELL-754
2018-04-06 12:54:01 +03:00
Antti Kauppila 10ad173091 LoRa: Small fixes
- changed few static variables to have const
2018-04-03 14:58:01 +03:00
Kimmo Vaisanen c1983570b4 Fix compilance test compilation
Fix compilation of compilance test and at the same time refactor compliance
test handler. Renamed mcps_request as test_request as it is only used for
compliance test. Also fixed a bug with null buffer in send_compliance_test_frame_to_mac.
2018-03-21 14:39:18 +02:00
Antti Kauppila cbdeb7dc4b LoRa: Added API break warnings for lorawan_channelplan_t struct and it's components 2018-03-21 08:54:42 +02:00
Antti Kauppila dc98228139 LoRa: Struct cleanups
- Unneeded structs removed and replaced by variables in functions
2018-03-21 08:54:42 +02:00
Antti Kauppila 489eecf7df LoRa: LoRaMAC class refactored
- Internal change only, no functional changes
- Tested by running Green tea tests manually
2018-03-21 08:54:42 +02:00
Antti Kauppila 6b54478af4 LoRaWANStack is made independent of MAC sublayers
- Only internal changes, no API has been broke.
- Tested by manually running Green tea tests
2018-03-21 08:54:42 +02:00
Antti Kauppila b63c98e103 LoRa: LoRaPHY dependency removed from LoRaMacStack
- This is internal change, no functionality has been changed
- LoRaWanInterface cleaned up and code moved to LoRaMacStack
- Compliance code in LoRaMacStack moved to EOF
- Green tea tests have been run manually
- Doxygen updated accordingly

LoRA: reorder class members
2018-03-21 08:54:42 +02:00
Kimmo Vaisanen fe225a8430 Remove redundant event from timer callbacks
Since our timers are now already using events, we no longer need to
defer timer callback calls.
2018-03-21 08:54:42 +02:00
Kimmo Vaisanen c6eee4fd98 Simplify check for pending bit 2018-03-21 08:54:42 +02:00
Kimmo Vaisanen 32075b91b5 Fix reception of class C messages
- Do not put radio into sleep when message is received in class c mode
- Experimental feature for acknowledging confirmed downlink messages
2018-03-21 08:54:42 +02:00
Kimmo Vaisanen a26fca8bf5 Add set_device_class API to change active device class
This API can be used to runtime change device class.

Please note that only class A and C are supported at the moment.
Trying to set class B will return LORAWAN_STATUS_UNSUPPORTED.

Fix set_device_class documentation

fix documentation
2018-03-21 08:54:42 +02:00
Kimmo Vaisanen 4aba3434f4 Change minimum required channels from 6 to 2 (US915Hybrid)
https://github.com/Lora-net/LoRaMac-node/issues/362
2018-03-21 08:54:42 +02:00
Kimmo Vaisanen 65b2dbc7dc Update DevStatusAnd format
In the DevStatusAns format, the protocol requires RFU(7:6) value = 0
2018-03-21 08:54:42 +02:00
Kimmo Vaisanen e1fff2e738 Update handling for functions OnRadioRxError and OnRadioRxTimout.
This is especially important for class c devices.
2018-03-21 08:54:42 +02:00
Kimmo Vaisanen 6c165e0f19 Changed mcps confirmation ul_frequency to channel 2018-03-21 08:54:42 +02:00
Kimmo Vaisanen e097429b69 Remove unused is_fPort_allowed method 2018-03-21 08:54:42 +02:00
Kimmo Vaisanen a9e1076572 Bug fix in RX timeout and RX error handling for class c nodes.
1. Do not stop the 2nd window timer, as it is not running.
2. Wait for the OnAckTimeout event, before setting MacDone
3. Process for class c also the 2nd window timeout part, as we do
   not have a 2nd window timer.
2018-03-21 08:54:42 +02:00
Kimmo Vaisanen 591bc7da1f Add the possibility to set the default antenna gain. 2018-03-21 08:54:42 +02:00
Kimmo Vaisanen 256a3a5842 Fix calculation of the aggregated time-off.
Perform only an assignment.

https://github.com/Lora-net/LoRaMac-node/issues/282
2018-03-21 08:54:42 +02:00
Kimmo Vaisanen c1ea418ac4 Fix rx slot handling
Store the rx slot temporarily. When in class C, this variable will be changed
in function OpenContinuousRx2Window.
2018-03-21 08:54:42 +02:00
Kimmo Vaisanen fc1696b74f Do only set the MacDone if the MAC is not in class c 2018-03-21 08:54:42 +02:00
Kimmo Vaisanen 6114f2b3d5 Fix an issue with sequence calls.
This issue is only present for a device in class c mode, which
has perform unconfirmed uplinks.

https://github.com/Lora-net/LoRaMac-node/issues/327
2018-03-21 08:54:42 +02:00
Kimmo Vaisanen e206c1ee54 Changed RegionNextChannel function in order to return LoRaMacStatus_t instead of a boolean
Removed the while loop checking the return value from set_next_channel
(GitHub Issue https://github.com/Lora-net/LoRaMac-node/issues/357)

The new return values are:

LORAWAN_STATUS_OK                    : A channel has been found.
LORAWAN_STATUS_NO_FREE_CHANNEL_FOUND : No free channel has been found (AS923 and KR920 regions)
LORAWAN_STATUS_DUTYCYCLE_RESTRICTED  : No channel found due to the duty-cycle or JoinReq back-off restrictions. Trial must be delayed.
LORAWAN_STATUS_NO_CHANNEL_FOUND      : No channel has been found. Re-enabled the default channels.
2018-03-21 08:54:42 +02:00
Kimmo Vaisanen 339306ed1b Ensure DR_6 cannot be selected for IN865 region 2018-03-21 08:54:42 +02:00
Antti Kauppila a294aa028d LoRa: LoRaWANInterface refactored.
- Only internal changes, no functionality changes
- Some minor improvements to LoRaWanStack
2018-03-21 08:54:42 +02:00
Antti Kauppila 32257858d0 Added missing mac_cmd_buf_idx_to_repeat to LoRaMacCommand class
- Reordered LoRaWANStack internal variables for more compact code
2018-03-16 18:00:02 +02:00
Antti Kauppila 488cf03d1e LoRA: Code cleanup + doxygen updates
- Internal changes only
- reset function is created to LoRaPHY to reset LoRaMAC parameters with default values
- Doxygen updates for newly created functions
2018-03-16 18:00:02 +02:00
Antti Kauppila 2ac73a6cac LoRa: LoRaMacMcps refactored to remove dependency to LoRaMac.
- This is internal logic only and there are no functionality changes
- Some compliance test stuff have been moved to end of files
- Some internal data structures removed as useless after refactor
2018-03-16 18:00:02 +02:00
Antti Kauppila 37371df968 LoRa: reset_mac_parameters put to correct place 2018-03-16 18:00:02 +02:00
Antti Kauppila d232d3bb52 LoRa: Removed LoRaMac dependency from MIB and MLME classes
- Internal refactoring only, no functional changes
2018-03-16 18:00:02 +02:00
Antti Kauppila d1cdd77290 LoRa: get_phy_params() refactored
- get_phy_params function was very heavy weight and needed to be refactored.
- switch-case clauses have been refactored to be functions now and the complexity of the usage has been improved a lot.
- There are no functional changes, this is internal only change
2018-03-16 18:00:02 +02:00