PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
protobuf_log.h File Reference
#include <pbl/services/hrm/hrm_manager.h>
#include <pbl/services/data_logging/dls_private.h>
#include <system/version.h>
#include <stdbool.h>
#include <stdint.h>
#include <measurements.pb.h>
#include <event.pb.h>

Data Structures

struct  ProtobufLogConfig
 Session configuration. More...
 
union  ProtobufLogConfig.__unnamed74__
 
struct  ProtobufLogConfig.__unnamed74__.measurements
 Configuration of ProtobufLogType_Measurements sessions. More...
 
struct  ProtobufLogConfig.__unnamed74__.events
 Configuration of ProtobufLogType_Events sessions, empty. More...
 

Macros

#define ProtobufLogMeasurementType_TimeMS   pebble_pipeline_MeasurementSet_Type_TimeMS
 Time in milliseconds.
 
#define ProtobufLogMeasurementType_VMC   pebble_pipeline_MeasurementSet_Type_VMC
 Vector magnitude counts, a unitless measure of total activity.
 
#define ProtobufLogMeasurementType_Steps   pebble_pipeline_MeasurementSet_Type_Steps
 Accumulated steps.
 
#define ProtobufLogMeasurementType_DistanceCM   pebble_pipeline_MeasurementSet_Type_DistanceCM
 Distance in centimeters.
 
#define ProtobufLogMeasurementType_RestingGCalories    pebble_pipeline_MeasurementSet_Type_RestingGCalories
 Resting calories, in gram calories.
 
#define ProtobufLogMeasurementType_ActiveGCalories    pebble_pipeline_MeasurementSet_Type_ActiveGCalories
 Active calories, in gram calories.
 
#define ProtobufLogMeasurementType_BPM   pebble_pipeline_MeasurementSet_Type_BPM
 Heart rate in beats per minute.
 
#define ProtobufLogMeasurementType_RR   pebble_pipeline_MeasurementSet_Type_RR
 Heart rate variability, peak to peak time in milliseconds.
 
#define ProtobufLogMeasurementType_Orientation   pebble_pipeline_MeasurementSet_Type_Orientation
 Orientation.
 
#define ProtobufLogMeasurementType_Light   pebble_pipeline_MeasurementSet_Type_Light
 Ambient light.
 
#define ProtobufLogMeasurementType_Temperature   pebble_pipeline_MeasurementSet_Type_Temperature
 Watch temperature in kelvin.
 
#define ProtobufLogMeasurementType_HRQuality   pebble_pipeline_MeasurementSet_Type_HRQuality
 Heart rate signal quality.
 
#define ProtobufLogActivityType_UnknownType   pebble_pipeline_ActivityType_InternalType_UnknownType
 Unknown activity.
 
#define ProtobufLogActivityType_Sleep   pebble_pipeline_ActivityType_InternalType_Sleep
 Sleep.
 
#define ProtobufLogActivityType_DeepSleep   pebble_pipeline_ActivityType_InternalType_DeepSleep
 Deep sleep.
 
#define ProtobufLogActivityType_Nap   pebble_pipeline_ActivityType_InternalType_Nap
 Nap.
 
#define ProtobufLogActivityType_DeepNap   pebble_pipeline_ActivityType_InternalType_DeepNap
 Deep nap.
 
#define ProtobufLogActivityType_Walk   pebble_pipeline_ActivityType_InternalType_Walk
 Walk.
 
#define ProtobufLogActivityType_Run   pebble_pipeline_ActivityType_InternalType_Run
 Run.
 
#define ProtobufLogActivityType_Open   pebble_pipeline_ActivityType_InternalType_Open
 Open workout.
 
#define PLOG_MAX_SENDER_ID_LEN   64
 Size of a buffer holding the payload sender ID, the watch serial number.
 
#define PLOG_MAX_SENDER_TYPE_LEN   64
 Size of a buffer holding the payload sender type.
 
#define PLOG_MAX_SENDER_VERSION_PATCH_LEN   FW_METADATA_VERSION_TAG_BYTES
 Size of a buffer holding the payload sender version patch string.
 
#define PLOG_PAYLOAD_SENDER_TYPE   "watch"
 Payload sender type.
 
#define PLOG_DLS_RECORD_SIZE   DLS_SESSION_MAX_BUFFERED_ITEM_SIZE
 Size of the data logging records, and maximum encoded message size.
 

Typedefs

typedef pebble_pipeline_MeasurementSet_Type ProtobufLogMeasurementType
 Measurement type.
 
typedef pebble_pipeline_ActivityType_InternalType ProtobufLogActivityType
 Activity type.
 
typedef void * ProtobufLogRef
 Session handle.
 
typedef bool(* ProtobufLogTransportCB) (uint8_t *buffer, size_t buf_size)
 Transport sending an encoded record.
 

Enumerations

enum  ProtobufLogType { ProtobufLogType_Measurements , ProtobufLogType_Events }
 Session payload type. More...
 

Functions

bool protobuf_log_init (void)
 Initialize the service.
 
ProtobufLogRef protobuf_log_create (ProtobufLogConfig *config, ProtobufLogTransportCB transport, size_t max_encoded_msg_size)
 Create a session.
 
bool protobuf_log_session_add_measurements (ProtobufLogRef session, time_t sample_utc, uint32_t num_values, uint32_t *values)
 Add a sample to a measurement session.
 
bool protobuf_log_session_add_event (ProtobufLogRef session_ref, pebble_pipeline_Event *event)
 Add an event to an event session.
 
bool protobuf_log_session_flush (ProtobufLogRef session)
 Encode and send the data accumulated so far.
 
bool protobuf_log_session_delete (ProtobufLogRef session)
 Flush and free a session.