Skip to content
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

Rewrite MAC parser, debug, pass compliance #378

Merged
merged 27 commits into from
Aug 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ad4fd70
Fix #87: refactor to parse MAC messages properly
terrillmoore Aug 15, 2019
c8445a0
Remove unused field
terrillmoore Aug 15, 2019
b24514e
Always reset LMIC.pendMacLen
terrillmoore Aug 15, 2019
1cf5e16
Passing all but sections 17.12~17.15 of RWC Korean Cert Test
terrillmoore Aug 17, 2019
ebe396a
Clean up LinkADRReq processing
terrillmoore Aug 17, 2019
59192e7
Add NbTrans handling
terrillmoore Aug 17, 2019
bfe662a
Fix certification of LinkADRReq: don't set ADRACKReq eagerly
terrillmoore Aug 17, 2019
4a1839c
Pass KR920 tests (individually)
terrillmoore Aug 17, 2019
5a37419
Fix #344: Fix #346: improve FSK handling, add docs
terrillmoore Aug 19, 2019
88af127
touch up comments
terrillmoore Aug 19, 2019
53e9b9e
Fix #375: correct names, add back inadvertent drop of MCMD_BeaconInfoReq
terrillmoore Aug 19, 2019
97c2366
Move ADR check out of middle of code building MAC uplink
terrillmoore Aug 19, 2019
a13b623
Add repeat-count debugging
terrillmoore Aug 19, 2019
ca88538
Trim whitespace
terrillmoore Aug 19, 2019
d7d8f35
Fix #377: don't repeat uplink seqnos for acks of confs
terrillmoore Aug 21, 2019
434871d
Rename the trace functions LMICOS_logEvent() etc.
terrillmoore Aug 22, 2019
0d6d951
Add LMIC event name string table macros
terrillmoore Aug 22, 2019
aabd00e
Trim whitespace
terrillmoore Aug 22, 2019
eeb2bf9
Revert logging default to 'off'; document logging control
terrillmoore Aug 22, 2019
7f29f68
compile compliance script correctly w/o LMIC logging
terrillmoore Aug 22, 2019
99481b4
Fix #382: Fix #238: confirmed uplink/explicit NACK must retry
terrillmoore Aug 23, 2019
317fc2e
Set version to v2.3.2.70
terrillmoore Aug 24, 2019
18149ae
Add documentation
terrillmoore Aug 24, 2019
20b4747
Catch asserts in compliance sketch and log instead
terrillmoore Aug 24, 2019
1fe1a9a
Trim whitespace
terrillmoore Aug 24, 2019
3f06760
Fix #384: properly parenthesize mask comparisons
terrillmoore Aug 24, 2019
3388653
Fix #379: add CI checks for compliance sketch
terrillmoore Aug 24, 2019
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
25 changes: 23 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ before_install:
# Put one or more arguments into lmic_project_config.h as `#define $i 1\n` or `#define $i $arg`
- function _splitdef { if [ "$1" = "${1/=/}" ]; then echo "$1" 1 ; else echo "${1/=/ }" ; fi ; }
- function _projcfg { for i in "$@" ; do printf '#define %s %s\n' $(_splitdef "$i") ; done > $PWD/project_config/lmic_project_config.h ; }
- function _projcfg_class_a { for i in "$@" "DISABLE_PING" "DISABLE_BEACONS"; do printf '#define %s %s\n' $(_splitdef "$i") ; done > $PWD/project_config/lmic_project_config.h ; }
#
# Handy macro to deal with expected failures.
- 'function _expect_failure { if [ $? -eq 0 ]; then echo "Suceeded, but should have failed!" ; echo project_config/lmic_project_config.h ; cat $PWD/project_config/lmic_project_config.h ; return 1 ; else echo "Failed, as expected"; return 0 ; fi ; }'
Expand Down Expand Up @@ -135,6 +136,14 @@ script:
- _notesp32 || { _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio && arduino --verify --board $(_esp32opts '' projcfg) $PWD/examples/ttn-abp/ttn-abp.ino ; }
# make sure debug works
- _notesp32 || { _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio LMIC_DEBUG_LEVEL=2 LMIC_PRINTF_TO=Serial && arduino --verify --board $(_esp32opts '' projcfg) $PWD/examples/ttn-otaa/ttn-otaa.ino ; }
# make sure the compliance sketch compiles on AVR in all regions.
- _notesp32 || { _projcfg CFG_us915 CFG_sx1276_radio && arduino --verify --board $(_esp32opts '' projcfg) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }
- _notesp32 || { _projcfg CFG_eu868 CFG_sx1276_radio && arduino --verify --board $(_esp32opts '' projcfg) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }
- _notesp32 || { _projcfg CFG_au921 CFG_sx1276_radio && arduino --verify --board $(_esp32opts '' projcfg) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }
- _notesp32 || { _projcfg CFG_as923 CFG_sx1276_radio && arduino --verify --board $(_esp32opts '' projcfg) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }
- _notesp32 || { _projcfg CFG_as923jp CFG_sx1276_radio && arduino --verify --board $(_esp32opts '' projcfg) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }
- _notesp32 || { _projcfg CFG_kr920 CFG_sx1276_radio && arduino --verify --board $(_esp32opts '' projcfg) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }
- _notesp32 || { _projcfg CFG_in866 CFG_sx1276_radio && arduino --verify --board $(_esp32opts '' projcfg) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }

#
# *** Tests for Feather 32u4
Expand All @@ -156,6 +165,15 @@ script:
- _notavr || { _projcfg COMPILE_REGRESSION_TEST CFG_kr920 CFG_sx1276_radio && arduino --verify --board $(_avropts) $PWD/examples/raw-feather/raw-feather.ino ; }
- _notavr || { _projcfg COMPILE_REGRESSION_TEST CFG_in866 CFG_sx1276_radio && arduino --verify --board $(_avropts) $PWD/examples/raw-feather/raw-feather.ino ; }

# make sure the compliance sketch compiles on AVR in all regions. This also requires class-A only
- _notavr || { _projcfg_class_a CFG_us915 CFG_sx1276_radio && arduino --verify --board $(_avropts) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }
- _notavr || { _projcfg_class_a CFG_eu868 CFG_sx1276_radio && arduino --verify --board $(_avropts) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }
- _notavr || { _projcfg_class_a CFG_au921 CFG_sx1276_radio && arduino --verify --board $(_avropts) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }
- _notavr || { _projcfg_class_a CFG_as923 CFG_sx1276_radio && arduino --verify --board $(_avropts) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }
- _notavr || { _projcfg_class_a CFG_as923jp CFG_sx1276_radio && arduino --verify --board $(_avropts) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }
- _notavr || { _projcfg_class_a CFG_kr920 CFG_sx1276_radio && arduino --verify --board $(_avropts) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }
- _notavr || { _projcfg_class_a CFG_in866 CFG_sx1276_radio && arduino --verify --board $(_avropts) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino ; }

# test the raw sketch
- _notavr || { _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio && arduino --verify --board $(_avropts) $PWD/examples/raw/raw.ino ; }
- _notavr || { _projcfg COMPILE_REGRESSION_TEST CFG_eu868 CFG_sx1276_radio && arduino --verify --board $(_avropts) $PWD/examples/raw/raw.ino ; }
Expand Down Expand Up @@ -213,8 +231,8 @@ script:
- _notsamd || { _projcfg COMPILE_REGRESSION_TEST CFG_au921 CFG_sx1276_radio && arduino --verify --board mcci:samd:mcci_catena_4450:lorawan_region=projcfg $PWD/examples/ttn-otaa/ttn-otaa.ino ; }
- _notsamd || { _projcfg COMPILE_REGRESSION_TEST CFG_as923 CFG_sx1276_radio && arduino --verify --board mcci:samd:mcci_catena_4450:lorawan_region=projcfg $PWD/examples/ttn-otaa/ttn-otaa.ino ; }
- _notsamd || { _projcfg COMPILE_REGRESSION_TEST CFG_as923jp CFG_sx1276_radio && arduino --verify --board mcci:samd:mcci_catena_4450:lorawan_region=projcfg $PWD/examples/ttn-otaa/ttn-otaa.ino ; }
- _notsamd || { _projcfg COMPILE_REGRESSION_TEST CFG_kr920 CFG_sx1276_radio && arduino --verify --board mcci:samd:mcci_catena_4450:lorawan_region=projcfg $PWD/examples/ttn-otaa/ttn-otaa.ino ; }
- _notsamd || { _projcfg COMPILE_REGRESSION_TEST CFG_in866 CFG_sx1276_radio && arduino --verify --board mcci:samd:mcci_catena_4450:lorawan_region=projcfg $PWD/examples/ttn-otaa/ttn-otaa.ino ; }
- _notsamd || { _projcfg COMPILE_REGRESSION_TEST CFG_kr920 CFG_sx1276_radio && arduino --verify --board mcci:samd:mcci_catena_4450:lorawan_region=projcfg $PWD/examples/ttn-otaa/ttn-otaa.ino ; }
- _notsamd || { _projcfg COMPILE_REGRESSION_TEST CFG_in866 CFG_sx1276_radio && arduino --verify --board mcci:samd:mcci_catena_4450:lorawan_region=projcfg $PWD/examples/ttn-otaa/ttn-otaa.ino ; }
#
# test ttn-abp with all regions
- _notsamd || { _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio && arduino --verify --board mcci:samd:mcci_catena_4450:lorawan_region=projcfg $PWD/examples/ttn-abp/ttn-abp.ino ; }
Expand Down Expand Up @@ -264,6 +282,9 @@ script:
- _notsamd || { _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio && arduino --verify --board $(_samdopts 'mcci_catena_4460' projcfg) $PWD/examples/ttn-otaa-halconfig-us915/ttn-otaa-halconfig-us915.ino ; }
- _notsamd || { _projcfg COMPILE_REGRESSION_TEST CFG_us915 CFG_sx1276_radio && arduino --verify --board $(_samdopts 'mcci_catena_4470' projcfg) $PWD/examples/ttn-otaa-halconfig-us915/ttn-otaa-halconfig-us915.ino ; }

# make sure the compliance sketch compiles on SAMD in EU region.
- _notsamd || arduino --verify --board $(_samdopts 'mcci_catena_4450' eu868 ) $PWD/examples/compliance-otaa-halconfig/compliance-otaa-halconfig.ino

#
# some tests that should generate build failures.
#
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ requires C99 mode to be enabled by default.
- [Disabling user events](#disabling-user-events)
- [Disabling external reference to `onEvent()`](#disabling-external-reference-to-onevent)
- [Enabling long messages](#enabling-long-messages)
- [Enabling LMIC event logging calls](#enabling-lmic-event-logging-calls)
- [Special purpose](#special-purpose)
- [Supported hardware](#supported-hardware)
- [Pre-Integrated Boards](#pre-integrated-boards)
Expand Down Expand Up @@ -314,14 +315,13 @@ If defined, removes code needed for OTAA activation. Removes the APIs `LMIC_star

#### Disabling Class A MAC commands

`DISABLE_MCMD_DCAP_REQ`, `DISABLE_MCMD_DN2P_SET`, and `DISABLE_MCMD_SNCH_REQ` respectively disable code for various Class A MAC
commands.
`DISABLE_MCMD_DutyCycleReq`, `DISABLE_MCMD_RXParamSetupReq`, `DISABLE_MCMD_RXTimingSetupReq`, `DISABLE_MCMD_NewChannelReq`, and `DISABLE_MCMD_DlChannelReq` respectively disable code for various Class A MAC commands.

#### Disabling Class B MAC commands

`DISABLE_MCMD_PING_SET` disables the PING_SET MAC commands. It's implied by `DISABLE_PING`.
`DISABLE_MCMD_PingSlotChannelReq` disables the PING_SET MAC commands. It's implied by `DISABLE_PING`.

`DISABLE_MCMD_BCNI_ANS` disables the next-beacon start command. It's implied by `DISABLE_BEACON`
`ENABLE_MCMD_BeaconTimingAns` enables the next-beacon start command. It's disabled by default, and overridden (if enabled) by `DISABLE_BEACON`. (This command is deprecated.)

#### Disabling user events

Expand All @@ -335,6 +335,12 @@ In some embedded systems, `onEvent()` may be defined for some other purpose; so

To save RAM for simple devices, the LMIC allows message length to be limited to 64 bytes instead of the LoRaWAN standard of 255 bytes max. This saves about 2*192 bytes of RAM. Unfortunately, compliance tests require the full message size. Long messages are enabled by setting `LMIC_ENABLE_long_messages` to 1, or disabled by setting it to zero. This C preprocessor macro is always defined as a post-condition of `#include "config.h"`; if non-zero, the maximum frame size is 255 bytes, and if zero, the maximum frame size is 64 bytes.

#### Enabling LMIC event logging calls

When debugging the LMIC, debug prints change timing, and can make things not work at all. The LMIC has embedded optional calls to capture debug information that can be printed out later, when the LMIC is not active. Logging is enabled by setting `LMIC_ENABLE_event_logging` to 1. The default is not to log. This C preprocessor macro is always defined as a post-condition of `#include "config.h"`.

The compliance test script includes a suitable logging implementation; the other example scripts do not.

#### Special purpose

`#define DISABLE_INVERT_IQ_ON_RX` disables the inverted Q-I polarity on RX. **Use of this variable is deprecated, see issue [#250](https://github.com/mcci-catena/arduino-lmic/issues/250).** Rather than defining this, set the value of `LMIC.noRXIQinversion`. If set non-zero, receive will be non-inverted. End-devices will be able to receive messages from each other, but will not be able to hear the gateway (other than Class B beacons)aa. If set zero, (the default), end devices will only be able to hear gateways, not each other.
Expand Down Expand Up @@ -1092,6 +1098,7 @@ function uflt12f(rawUflt12)

- HEAD adds the following changes.

- [#378](https://github.com/mcci-catena/arduino-lmic/pull/378) completely reworks MAC downlink handling. Resulting code passes the LoRaWAN V1.5 EU certification test. (v2.32.2.70)
- [#360](https://github.com/mcci-catena/arduino-lmic/pull/360) adds support for the KR-920 regional plan.

- v2.3.2 is a patch release. It incorporates two pull requests.
Expand Down
4 changes: 2 additions & 2 deletions doc/release-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ LMIC VERSION 1.6 (13-July-2015)

- License changed to BSD
- Modem included, see LMiC-Modem.pdf and examples/modem
- Additional stm32 hardware and Blipper board specific peripheral code
- Additional stm32 hardware and Blipper board specific peripheral code


==============================================================================
LMIC VERSION 1.5 (8-May-2015)
Expand Down
Loading