3.2. Captures
- class backendapp.captures.CaptureSampleService[source]
Create and find timestamped environmental sensor samples.
- class backendapp.captures.CaptureService[source]
Create and find captures for a tag.
- create(tagobj, timestamp, loopcount, status, batvoltagemv, cursorpos, format, timeintmins, hash, samples)[source]
Create a new Capture from unencoded data that are not part of a URL.
- Parameters
tagobj – The Capture will be assigned to this Tag instance.
timestamp – When this capture was created.
loopcount – Number of times the circular buffer cursor has wrapped around from the end to the start.
status – Reference to a CaptureStatus object.
batvoltagemv – Voltage in milliVolts of the battery powering cuplTag.
cursorpos – Position of the circular buffer cursor relative to the start of the string.
format – Indicates how to decode parameters in the cupl URL.
timeintmins – Time interval between samples in minutes.
hash – MD5 or HMAC of Capture data.
samples – A list of CaptureSamples objects.
- Returns
A new Capture made from decoded URL parameters.
- decode_and_create(tagobj, statb64, timeintb64, circb64, vfmtb64) backendapp.captures.models.Capture [source]
Decode the URL parameters read from a Tag and use these to create a Capture.
- Parameters
tagobj – The Tag that the cupl URL parameters were read from.
statb64 – Base64 encoded tag status information.
timeintb64 – Base64 encoded time interval between samples.
circb64 – Base64 encoded circular buffer containing temperature and humidity samples.
vfmtb64 – Base64 encoded format code.
- Returns
A new Capture made from decoded URL parameters.