Loading...
Searching...
No Matches
sensor_capture.h
Go to the documentation of this file.
50 for (size_t index = 0; index < bytes; ++index) data[index] = (unsigned char)(value >> (index * 8));
109static inline bool sensor_capture_encode(const struct sensor_capture *record, unsigned char *data, size_t capacity)
114 for (size_t index = 0; index < 36; ++index) data[8 + index] = (unsigned char)record->boot_id[index];
136static inline bool sensor_capture_decode(struct sensor_capture *record, const unsigned char *data, size_t size)
138 if (!record || !data || size != SENSOR_CAPTURE_BYTES || memcmp(data, "SENSOR02", 8)) return false;
static int record(const union dc_shot_union *shot)
Retrieve a point and admit a new observation only when its credit is free.
Definition dipla_camera_backend.c:206
static bool sensor_capture_decode(struct sensor_capture *record, const unsigned char *data, size_t size)
Decode a complete SENSOR02 record.
Definition sensor_capture.h:136
static bool sensor_capture_encode(const struct sensor_capture *record, unsigned char *data, size_t capacity)
Encode a SENSOR02 record in the fixed on-disk layout.
Definition sensor_capture.h:109
static uint64_t sensor_capture_get(const unsigned char *data, size_t bytes)
Read a fixed-width little-endian integer.
Definition sensor_capture.h:61
static int64_t sensor_capture_signed(uint64_t value)
Interpret a 64-bit wire field as a signed two's-complement value.
Definition sensor_capture.h:75
static void sensor_capture_put(unsigned char *data, uint64_t value, size_t bytes)
Write a fixed-width little-endian integer.
Definition sensor_capture.h:48
static bool sensor_capture_valid(const struct sensor_capture *record)
Check the structural constraints shared by the wire encoder and decoder.
Definition sensor_capture.h:87
Definition sensor_capture.h:33