-
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
Add Network layer BatteryPercentage to ApplicationUplink #7449
base: v3.33
Are you sure you want to change the base?
Conversation
f035a81
to
3ddac1b
Compare
// The battery percentage of the end device. | ||
// The value is defined in the [0, 100] interval. | ||
google.protobuf.FloatValue value = 2 [(validate.rules).float = { | ||
gte: 0, | ||
lte: 1 | ||
}]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment doesn't really match the validation rules. I think the comment needs to be changed to [0..1]
interval. That would not be a percentage anymore, which is [0..100].
I hope it is [0, 100]
like the comment says, otherwise turn it into a [0, 100]
so that it matches the name (percentage), which is what API consumers would find most natural I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've copied this from the end_device.proto
and calls it "percentage" but indeed then the validation should be [0, 100]
https://github.com/TheThingsNetwork/lorawan-stack/blob/v3.33/api/ttn/lorawan/v3/end_device.proto#L1142-L1148
// Latest-known battery percentage of the device.
// Received via the DevStatus MAC command at last_dev_status_received_at or earlier.
// Stored in Network Server.
google.protobuf.FloatValue battery_percentage = 35 [(validate.rules).float = {
gte: 0,
lte: 1
}];
But I'll check it again and change it (or convert it) in my implementation to be a percentage value [0, 100]
.
Summary
References: #7427
The Network Server already receives the battery percentage via the
DevStatus
MAC command and stores it. We can forward this value to the Application Server in theApplicationUplink
message.Changes
ApplicationUplink
message with theLastBatteryPercentage
messageTesting
Steps
...
Results
Regressions
...
Notes for Reviewers
...
Checklist
README.md
for the chosen target branch.CHANGELOG.md
.CONTRIBUTING.md
, there are no fixup commits left.