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

Lean status attributes #189

Open
emiltin opened this issue Oct 29, 2024 · 4 comments
Open

Lean status attributes #189

emiltin opened this issue Oct 29, 2024 · 4 comments
Labels

Comments

@emiltin
Copy link
Contributor

emiltin commented Oct 29, 2024

Some status mesages include metadata that should not itself trigger a status message.

For example, when you subscribe to signal group status in a TLC, you want a status update whenever any of the signal groups change state. When that happen, you the current cycle counter should be included. See rsmp-nordic/rsmp_sxl_traffic_lights#21

But you don't want a status message each time just the cycle counter changes, but not the actual signal group status. This is already a problem when the cycle counter changes once per second, but it becomes much worse when we want to include the resolution of the cycle counter.

To support this, I suggest we distinguish between data and metadata in status attributes. Attributes marked as 'meta' should not trigger status updates.

@emiltin
Copy link
Contributor Author

emiltin commented Nov 7, 2024

Instead of marking some attributes in the SXL as metadata, you could choose at subscription time which attribute should trigger an update. More flexible, but also maybe more complex to implement.

@emiltin
Copy link
Contributor Author

emiltin commented Nov 13, 2024

Here's an example of a status subscription message:

{
     "mType": "rSMsg",
     "type": "StatusSubscribe",
     "mId": "d6d97f8b-e9db-4572-8084-70b55e312584",
     "ntsOId": "O+14439=481WA001",
     "xNId": "",
     "cId": "O+14439=481WA001",
     "sS": [
         {
             "sCI": "S0001",
             "n": "signalgroupstatus",
             "uRt": "5",
             "sOc": false
         },{
             "sCI": "S0001",
             "n": "cyclecounter",
             "uRt": "5",
             "sOc": false
         },{
             "sCI": "S0001",
             "n": "basecyclecounter",
             "uRt": "5",
             "sOc": false
         }
     ]
}

As shown, updateRate and sendOnChange are specified for each attribute.

Could we use these two existing flags to indicate that an attribute should only be send when other attributes change?

From https://rsmp-nordic.github.io/rsmp_core/3.2.2/applicability/basic_structure.html#structure-for-a-status-subscription-request-message:

It is not valid to set updateRate=0 and sendOnChange=false since it means that no subscription updates will be sent

A possibility would be change that definition to something like:

If updateRate=0 and sendOnChange=false then the attribute is considered metadata and will be send when another non-metadata attribute changes.

For example, when you subscribe to S0001, the cyclecounter could be subscribed to as metadata, so you only get a message when the signalgroupstatus attribute change, which will then include the cyclecounter:.

{
     "mType": "rSMsg",
     "type": "StatusSubscribe",
     "mId": "d6d97f8b-e9db-4572-8084-70b55e312584",
     "ntsOId": "O+14439=481WA001",
     "xNId": "",
     "cId": "O+14439=481WA001",
     "sS": [
         {
             "sCI": "S0001",
             "n": "signalgroupstatus",
             "uRt": "0",
             "sOc": true
         },{
             "sCI": "S0001",
             "n": "cyclecounter",
             "uRt": "0",
             "sOc": false
         }
     ]
}

The benefit of this would be:

  • no fields added or removed, which avoids now flag combinations to consider)
  • no new types introduces (still string for uRt and boolean for sOc)

@emiltin
Copy link
Contributor Author

emiltin commented Nov 13, 2024

Added a PR #197 with the above idea of using uRt=0 and sOc=false to indicate lazy lean updates.

@emiltin emiltin changed the title Metadata in status messages Lean status attributes Jan 22, 2025
@emiltin
Copy link
Contributor Author

emiltin commented Jan 22, 2025

I suggest using the word "lean" to describe attributes that don't trigger updates, but are send when other attributes trigger an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant