|
PebbleOS
|
Tunable parameters of the activity insights. More...
Macros | |
| #define | ACTIVITY_INSIGHTS_SETTINGS_SLEEP_REWARD "sleep_reward" |
| Key of the sleep reward settings. | |
| #define | ACTIVITY_INSIGHTS_SETTINGS_SLEEP_SUMMARY "sleep_summary" |
| Key of the sleep summary settings. | |
| #define | ACTIVITY_INSIGHTS_SETTINGS_ACTIVITY_REWARD "activity_reward" |
| Key of the activity reward settings. | |
| #define | ACTIVITY_INSIGHTS_SETTINGS_ACTIVITY_SUMMARY "activity_summary" |
| Key of the activity summary settings. | |
| #define | ACTIVITY_INSIGHTS_SETTINGS_ACTIVITY_SESSION "activity_session" |
| Key of the activity session settings. | |
Functions | |
| bool | activity_insights_settings_read (const char *insight_name, ActivityInsightSettings *settings_out) |
| Read the settings of an insight. | |
| bool | activity_insights_settings_write (const char *insight_name, ActivityInsightSettings *settings) |
| Write the settings of an insight (testing). | |
| uint16_t | activity_insights_settings_get_version (void) |
| Get the version of the insights settings file contents. | |
| void | activity_insights_settings_init (void) |
| Initialize the insights settings file. | |
| PFSCallbackHandle | activity_insights_settings_watch (PFSFileChangedCallback callback) |
| Watch the insights settings file. | |
| void | activity_insights_settings_unwatch (PFSCallbackHandle cb_handle) |
| Stop watching the insights settings file. | |
Tunable parameters of the activity insights.
Settings are stored per insight, keyed by name, in the insights settings file. Built-in defaults are used for insights missing from the file.
| struct ActivityRewardSettings |
Reward insight settings.
Day counts are in addition to today.
| Data Fields | ||
|---|---|---|
| union ActivityRewardSettings.__unnamed53__ | __unnamed__ | Insight specific settings. |
| uint8_t | continuous_min_days_data | Consecutive days of history required. |
| uint8_t | min_days_data | Days of history required. |
| uint32_t | notif_min_interval_seconds | Minimum interval between two notifications of this insight, in seconds. |
| uint16_t | target_percent_of_median | Percentage of the median that qualifying days must reach. |
| uint8_t | target_qualifying_days | Days that must be above target, in addition to today. |
| struct ActivitySummarySettings |
Summary pin settings.
Thresholds are percentages relative to 100% of the average: 105% is 5, 93% is -7.
| Data Fields | ||
|---|---|---|
| union ActivitySummarySettings.__unnamed57__ | __unnamed__ | Insight specific settings. |
| int8_t | above_avg_threshold | Values above this are above average. |
| int8_t | below_avg_threshold | Values below this are below average. |
| int8_t | fail_threshold | Values below this are a fail. |
| struct ActivitySessionSettings |
Activity session insight settings.
| Data Fields | ||
|---|---|---|
| union ActivitySessionSettings.__unnamed61__ | __unnamed__ | Session type specific settings. |
| bool | show_notification | Whether to show a notification. |
| struct ActivityInsightSettings |
Settings of one insight.
| Data Fields | ||
|---|---|---|
| union ActivityInsightSettings.__unnamed64__ | __unnamed__ | Insight specific settings. |
| bool | enabled | Insight enabled. |
| uint8_t | unused | Unused. |
| uint8_t | version |
Struct version, must be first. Records with another version are ignored. |
| union ActivityRewardSettings.__unnamed53__ |
Insight specific settings.
| Data Fields | ||
|---|---|---|
| struct ActivityRewardSettings.__unnamed53__.activity | activity | Activity reward settings. |
| struct ActivityRewardSettings.__unnamed53__.sleep | sleep | Sleep reward settings. |
| struct ActivityRewardSettings.__unnamed53__.sleep |
| struct ActivityRewardSettings.__unnamed53__.activity |
| union ActivitySummarySettings.__unnamed57__ |
Insight specific settings.
| Data Fields | ||
|---|---|---|
| struct ActivitySummarySettings.__unnamed57__.activity | activity | Activity summary settings. |
| struct ActivitySummarySettings.__unnamed57__.sleep | sleep | Sleep summary settings. |
| struct ActivitySummarySettings.__unnamed57__.activity |
Activity summary settings.
| struct ActivitySummarySettings.__unnamed57__.sleep |
Sleep summary settings.
| union ActivitySessionSettings.__unnamed61__ |
Session type specific settings.
| Data Fields | ||
|---|---|---|
| struct ActivitySessionSettings.__unnamed61__.activity | activity | Walk and run settings. |
| struct ActivitySessionSettings.__unnamed61__.activity |
| union ActivityInsightSettings.__unnamed64__ |
Insight specific settings.
| Data Fields | ||
|---|---|---|
| ActivityRewardSettings | reward | Reward settings. |
| ActivitySessionSettings | session | Activity session settings. |
| ActivitySummarySettings | summary | Summary pin settings. |
| #define ACTIVITY_INSIGHTS_SETTINGS_ACTIVITY_REWARD "activity_reward" |
Key of the activity reward settings.
| #define ACTIVITY_INSIGHTS_SETTINGS_ACTIVITY_SESSION "activity_session" |
Key of the activity session settings.
| #define ACTIVITY_INSIGHTS_SETTINGS_ACTIVITY_SUMMARY "activity_summary" |
Key of the activity summary settings.
| #define ACTIVITY_INSIGHTS_SETTINGS_SLEEP_REWARD "sleep_reward" |
Key of the sleep reward settings.
| #define ACTIVITY_INSIGHTS_SETTINGS_SLEEP_SUMMARY "sleep_summary" |
Key of the sleep summary settings.
| uint16_t activity_insights_settings_get_version | ( | void | ) |
Get the version of the insights settings file contents.
Separate from ActivityInsightSettings::version.
| void activity_insights_settings_init | ( | void | ) |
Initialize the insights settings file.
| bool activity_insights_settings_read | ( | const char * | insight_name, |
| ActivityInsightSettings * | settings_out | ||
| ) |
Read the settings of an insight.
Falls back to the built-in defaults when the file has no valid record for the insight.
| insight_name | Insight key, e.g. ACTIVITY_INSIGHTS_SETTINGS_SLEEP_REWARD. | |
| [out] | settings_out | Settings; zeroed on failure. |
| void activity_insights_settings_unwatch | ( | PFSCallbackHandle | cb_handle | ) |
Stop watching the insights settings file.
| cb_handle | Handle returned by activity_insights_settings_watch(). |
| PFSCallbackHandle activity_insights_settings_watch | ( | PFSFileChangedCallback | callback | ) |
Watch the insights settings file.
| callback | Called when the file is closed after modifications, or deleted. |
| bool activity_insights_settings_write | ( | const char * | insight_name, |
| ActivityInsightSettings * | settings | ||
| ) |
Write the settings of an insight (testing).
| insight_name | Insight key. |
| settings | Settings. |