PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
hrm_manager_private.h File Reference
#include <pbl/kernel/msgq.h>
#include "hrm_manager.h"
#include <applib/event_service_client.h>
#include <pbl/services/hrm/hrm_activity_scene.h>
#include <pbl/drivers/rtc.h>
#include <kernel/events.h>
#include <pbl/kernel/mutex.h>
#include <process_management/app_install_types.h>
#include <pbl/services/new_timer/new_timer.h>
#include <pbl/util/list.h>
#include <pbl/util/circular_buffer.h>
#include <stdint.h>

Data Structures

struct  HRMSubscriberState
 Subscriber state. More...
 
struct  HRMManagerState
 HRM manager state. More...
 

Macros

#define HRM_SENSOR_SPIN_UP_SEC   20
 Time needed for a good reading after turning the sensor on, in seconds.
 
#define HRM_LOW_LATENCY_MAX_INTERVAL_S   2
 Maximum interval of a foreground app getting the low latency FIFO cadence, in seconds.
 
#define NUM_EVENTS_TO_QUEUE   (8)
 Number of events queued for KernelBG subscribers.
 
#define EVENT_STORAGE_SIZE   (sizeof(PebbleHRMEvent) * NUM_EVENTS_TO_QUEUE)
 Size of the KernelBG event storage, in bytes.
 
#define HRM_MANAGER_ACCEL_MANAGER_SAMPLES_PER_UPDATE   4
 Accelerometer samples per accelerometer manager update.
 
#define HRM_CHECK_SENSOR_DISABLE_COUNT   3
 Number of driver reports between checks for turning the sensor off.
 
#define HRM_MAX_ENABLE_FAILURES   3
 Consecutive sensor enable failures after which retries stop until reboot.
 
#define HRM_MAX_UNSERVED_TIME_SEC   120
 Sensor on-time after which a subscriber without a usable reading is deferred, in seconds.
 

Typedefs

typedef void(* HRMSubscriberCallback) (PebbleHRMEvent *event, void *context)
 Callback receiving HRM events, for KernelBG and KernelMain subscribers.
 
typedef struct AccelServiceState AccelServiceState
 Opaque accelerometer service state.
 

Functions

HRMSessionRef hrm_manager_subscribe_with_callback (AppInstallId app_id, uint32_t update_interval_s, uint16_t expire_s, HRMFeature features, bool low_latency, HRMSubscriberCallback callback, void *context)
 Subscribe a KernelBG or KernelMain client to sensor updates.
 
void hrm_manager_set_activity_scene (HRMActivityScene scene)
 Set the activity scene the heart rate algorithm optimizes for.