-
Notifications
You must be signed in to change notification settings - Fork 310
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
feat: Add device attributes to ApplicationUp messages #7451
base: v3.33
Are you sure you want to change the base?
Conversation
@johanstokking @KrishnaIyer there is a note in the implementation plan that I don't get completely:
I understand that this change has to be made as it does not make sense to set these fields when the application sends a downlink to the end device (the fields should be set on end device creation and not modified through uplinks or downlinks). Does this mean that a whole new message must be defined where these fields are included? Something like: message EnrichedApplicationDownlink {
ApplicationDownlink downlinks = 1;
// End device location metadata, set by the Application Server while handling the message.
map<string, Location> locations = 3;
// End device version identifiers, set by the Application Server while handling the message.
EndDeviceVersionIdentifiers version_ids = 4;
// Network identifiers, set by the Network Server that handles the message.
NetworkIdentifiers network_ids = 5;
// Attributes for devices, set by the Application Server while handling the message.
map<string, string> attributes = 6 [(validate.rules).map = {
max_pairs: 10,
keys: {
string: {
pattern: "^[a-z0-9](?:[-]?[a-z0-9]){2,}$",
max_len: 36
}
},
values: {
string: {max_len: 200}
}
}];
// next: 7
} And by binary compatible variant, does that mean serialisable? |
No, these can be part of the existing message. We use comments to indicate which component sets them. Also, we can use |
04e15dd
to
54c9a07
Compare
6890128
to
5eeda26
Compare
4de08b9
to
557efe3
Compare
I see that the downlink replace and the downlink push both use the same request which does not contain a field mask:
However, looking through the code, most of the .Set methods have hardcoded paths, so it should be fine not adding a FieldMask and the corresponding ProhibitField call right? Also, I noticed that the attributes are saved in the entity registry (that belongs to the IS) which is different than the device registry (that belongs to the AS), is that right? I saw that the locations are also saved in the entity registry. I followed the location registry implementation to fetch the attributes, but only implemented the get call as no set should happened for the attributes in the message handlers. Let me know if this is okay. |
Yes
Indeed this information is stored in IS, and that has been the main reason we didn't put these fields in the upstream messages: it would require an IS roundtrip. In our global deployments, these are cross-continental roundtrips, delaying uplink messages, increasing memory usage, etc. So indeed, like location, AS should fetch this from IS in a similar way. These should be combined in one call otherwise there are two sequential roundtrips and that's even worse. |
Okay, got it. I'll refactor the location and attributes calls into one 👍 |
Summary
References #5879
Changes
Testing
Steps
Results
Join-accept:
Uplink:
Regressions
...
Notes for Reviewers
...
Checklist
README.md
for the chosen target branch.CHANGELOG.md
.CONTRIBUTING.md
, there are no fixup commits left.