Skip to content

Add missing MAC settings profile ID path fields#7952

Open
halimi wants to merge 2 commits into
v3.36from
fix/apply-mac-settings-profile-config
Open

Add missing MAC settings profile ID path fields#7952
halimi wants to merge 2 commits into
v3.36from
fix/apply-mac-settings-profile-config

Conversation

@halimi

@halimi halimi commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

References: https://github.com/TheThingsIndustries/lorawan-stack-support/issues/1467
References: https://github.com/TheThingsIndustries/lorawan-stack-support/issues/1477

This fixes a bug when the MAC settings profile config values are not applied to the new MAC state during the join procedure (OTAA) or during the factory reset (ABP).

Changes

  • Adds missing MAC settings profile ID path fields

Testing

Steps
  1. Create a MAC settings profile with a desired max EIRP value 30
  2. Assign this profile to an OTAA device
  3. Re-join the device
  4. Check that the device's MAC state desired parameters has the max eirp value 30
  5. Assign the profile to an ABP device
  6. Do a factory reset on the device
  7. Check that the device's MAC state desired parameters has the max eirp value 30
Results

Create a MAC settings profile with a desired max EIRP value 30

curl --request POST \
  --url http://localhost:1885/api/v3/ns/applications/myapp/mac_settings_profiles \
  --header 'authorization: Bearer <token>' \
  --header 'content-type: application/json' \
  --data '{
  "mac_settings_profile": {
    "ids": {
      "application_ids": {
        "application_id": "myapp"
      },
      "profile_id": "maxeirp"
    },
    "mac_settings": {
      "desired_max_eirp": "DEVICE_EIRP_30"
    }
  }
}'

Check that the device's MAC state desired parameters has the max eirp value 30

curl --request GET \
  --url 'http://localhost:1885/api/v3/ns/applications/myapp/devices/<device id>?field_mask=version_ids,frequency_plan_id,mac_settings,supports_class_b,supports_class_c,supports_join,lorawan_version,lorawan_phy_version,multicast,session,pending_session,mac_settings_profile_ids,mac_state' \
  --header 'authorization: Bearer <token>'

Response:

.
.
 "mac_state": {
    "current_parameters": {
      "max_eirp": 16,
      "adr_nb_trans": 1,
      "rx1_delay": 1,
      "rx2_frequency": "869525000",
      "ping_slot_frequency": "869525000",
      "beacon_frequency": "869525000",
.
.
   "desired_parameters": {
      "max_eirp": 30,
      "adr_nb_trans": 1,
      "rx1_delay": 5,
      "rx2_data_rate_index": 3,
      "rx2_frequency": "869525000",
      "ping_slot_frequency": "869525000",
      "beacon_frequency": "869525000",
.
.
Regressions

...

Notes for Reviewers

...

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • Testing: The steps/process to test this feature are clearly explained including testing for regressions.
  • Infrastructure: If infrastructural changes (e.g., new RPC, configuration) are needed, a separate issue is created in the infrastructural repositories.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

@halimi halimi requested a review from a team as a code owner June 25, 2026 09:42
@halimi halimi requested a review from johanstokking June 25, 2026 09:42
@github-actions github-actions Bot added the c/network server This is related to the Network Server label Jun 25, 2026

@johanstokking johanstokking left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need a test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/network server This is related to the Network Server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants