Caution! Article for developers
Information on this page is intended particularly for users with advanced technical knowledge.Combining burst fragments into complete bursts
Dec 1, 2022 · 2 minutes to read
This article describes how to merge burst fragments into complete bursts.
Introduction
Each burst will have unique1 measurement id e.g: "MeasurementId":225
and burst id e.g: "BurstId":133
. You should identify your burst with this information along with SensorNodeId
.
After you have your burst fragments you can start combining them into complete bursts with their "Values"
, "Valuemapping"
, "BurstDataOffset"
and "DataSize"
-fields where:
Field | Meaning |
---|---|
"Values" | Contains byte-values from burst. Format will be specified by "Valuemapping" . |
"Valuemapping" | Defines format of "Values" -field |
"BurstDataOffset" | Fragments starting bytes position in bytearray with size of "DataSize" |
"DataSize" | Size of the burst in bytes |
How bursts are split into fragments
Bursts are split into smaller fragments and sent via wirepas to gateway which sends them to cloud. Each fragment contains partial array of the data-bytes from the complete burst. Because these fragments cannot be guaranteed to come in correct order and some might be missing they have field "BurstDataOffset"
which tells to whoever processes nodes messages that this bursts fragment starts at at this byte-offset.
Below figure should illustrate how burst offset works:
In addition to all of this data sent there is also field "FragCount"
which should never be used when reconstructing the complete burst. Field "FragCount"
is added by the gateway and is just incrementing counter of how many fragments have arrived to the gateway. This means that if a fragment with "BurstDataOffset"
of 96 would come before fragment with "BurstDataOffset"
of 0 it would get smaller "FragCount"
than the fragment with offset of 0.
Ids are not exactly unique but they cycle from
0..n
depending on node. ↩︎