Loading...
Searching...
No Matches
settings_catalog.h File Reference

The shared catalog of known settings. A KNOWN_* macro per setting bakes in its neutral wire key, encoding, bounds, default, and side effects. More...

#include <stddef.h>
#include "system/settings/settings.h"
#include "system/settings/setting_values.h"
#include "health/goals.h"
#include "settings_page.h"

Go to the source code of this file.

Macros

#define SETTINGS_COUNT(key)
 How many choices the settings page offers on a message key, worked out by the build.
#define SETTINGS_COUNT_CHECKED(key, table_count)
 The page's count on a message key, checked against the size of the face's own table.
#define SETTINGS_TEXT_FIELD(blob, member, bytes)
 A text entry's offset and size, with a build stop when the member is not that size.
#define SETTINGS_DEFAULT(key)
 The default the settings page opens with on a message key, worked out by the build.
#define KNOWN_TEMPERATURE_UNIT(off)
 Setting definition for Temperature Unit (Celsius or Fahrenheit).
#define KNOWN_DATE_FORMAT(blob, member)
 Setting definition for Date Format.
#define KNOWN_THEME(off, table_count)
 Setting definition for Theme.
#define KNOWN_STEPS_MODE(off)
 Setting definition for Steps Mode.
#define KNOWN_DISTANCE_UNIT(off)
 Setting definition for Distance Unit.
#define KNOWN_TIME_FORMAT(off)
 Setting definition for Time Format.
#define KNOWN_BLUETOOTH_ICON(off)
 Setting definition for Bluetooth Icon.
#define KNOWN_QUIET_TIME_ICON(off)
 Setting definition for the Quiet Time Icon.
#define KNOWN_BLUETOOTH_VIBE_CONNECT(off)
 Setting definition for Bluetooth Vibe Connect.
#define KNOWN_BLUETOOTH_VIBE_DISCONNECT(off)
 Setting definition for Bluetooth Vibe Disconnect.
#define KNOWN_HOURLY_VIBE(off)
 Setting definition for the Hourly Vibration (a VibeChoice fired at the top of each hour).
#define KNOWN_BATTERY_DISPLAY(off)
 Setting definition for Battery Display (icon + percent / icon / percent).
#define KNOWN_WIND_UNIT(off)
 Setting definition for Wind Unit, the WindUnit a wind speed reads out in.
#define KNOWN_GOAL_STEPS(off)
 Setting definition for the Step Goal, an index into goals_steps.
#define KNOWN_GOAL_DISTANCE(off)
 Setting definition for the Distance Goal, an index into goals_distance_m.
#define KNOWN_GOAL_CALORIES(off)
 Setting definition for the Calorie Goal, an index into goals_calories.
#define KNOWN_GOAL_ACTIVE(off)
 Setting definition for the Activity Goal, an index into goals_active_min.
#define KNOWN_GOAL_SLEEP(off)
 Setting definition for the Sleep Goal, an index into goals_sleep_min.
#define KNOWN_GOAL_HR(off)
 Setting definition for the Heart Rate Limit, an index into goals_hr_limit.
#define KNOWN_GOAL_VIBE(blob, member)
 Setting definition for the Goal Met Vibration, the pick vibe_goal plays.
#define KNOWN_GOAL_VIBE_CUSTOM(blob, member)
 Setting definition for the Custom Vibration Pattern, which vibe_goal plays when the pick is Custom.

Detailed Description

The shared catalog of known settings. A KNOWN_* macro per setting bakes in its neutral wire key, encoding, bounds, default, and side effects.

A face subscribes to a known setting by placing its KNOWN_* entry in the face's field table at the offset of the matching struct member, and by declaring the setting's MESSAGE_KEY in the face's package.json. Face-only settings are declared inline in the table instead, with an id of SETTING_COUNT or greater.

A choice the face's own settings page lists, such as the theme, takes its count from settings_page.h, which paf build writes into the sandbox from the page, and the face passes the size of its own table so the build stops when the two disagree. A choice the framework lists takes the framework's own count from setting_values.h, since the watch can only draw the values its own enum names. A daily goal takes the page's count, checked against the framework's goal table in health/goals.h.

Every entry takes its default from the same header, so a fresh watch starts on the value the settings page opens with. A setting the page does not show keeps the framework's own default.