Loading...
Searching...
No Matches
appmessage_features.h
Go to the documentation of this file.
1
13#pragma once
14
15// a face has weather when it declares all four of these. the watch asks with the first and reads a
16// reading off the other three, so all four are one decision. the ok flag is the one that tells a
17// failed fetch from a reading, and a face without it would show "NO GPS" as a live 0 degrees.
18// a face that declares none opted out of weather and builds without it. a face that declares only
19// some has a typo or a gap, which would otherwise build and go wrong on the watch, so the build
20// stops and names each missing key
21#if defined(HAS_MESSAGE_KEY_WEATHER_REQUEST) && defined(HAS_MESSAGE_KEY_WEATHER_TEMPERATURE) && \
22 defined(HAS_MESSAGE_KEY_WEATHER_CONDITIONS) && defined(HAS_MESSAGE_KEY_WEATHER_OK)
23#define APPMESSAGE_HAS_WEATHER 1
24#elif defined(HAS_MESSAGE_KEY_WEATHER_REQUEST) || defined(HAS_MESSAGE_KEY_WEATHER_TEMPERATURE) || \
25 defined(HAS_MESSAGE_KEY_WEATHER_CONDITIONS) || defined(HAS_MESSAGE_KEY_WEATHER_OK)
26#if !defined(HAS_MESSAGE_KEY_WEATHER_REQUEST)
27#error "weather needs WEATHER_REQUEST in messageKeys. A face with weather declares WEATHER_REQUEST, WEATHER_TEMPERATURE, WEATHER_CONDITIONS, and WEATHER_OK"
28#endif
29#if !defined(HAS_MESSAGE_KEY_WEATHER_TEMPERATURE)
30#error "weather needs WEATHER_TEMPERATURE in messageKeys. A face with weather declares WEATHER_REQUEST, WEATHER_TEMPERATURE, WEATHER_CONDITIONS, and WEATHER_OK"
31#endif
32#if !defined(HAS_MESSAGE_KEY_WEATHER_CONDITIONS)
33#error "weather needs WEATHER_CONDITIONS in messageKeys. A face with weather declares WEATHER_REQUEST, WEATHER_TEMPERATURE, WEATHER_CONDITIONS, and WEATHER_OK"
34#endif
35#if !defined(HAS_MESSAGE_KEY_WEATHER_OK)
36#error "weather needs WEATHER_OK in messageKeys. A face with weather declares WEATHER_REQUEST, WEATHER_TEMPERATURE, WEATHER_CONDITIONS, and WEATHER_OK"
37#endif
38#endif
39
40// a face gets coordinates when it declares both halves of the pair. they arrive together, so one
41// without the other could never make a fix, and the build stops and names the missing half rather
42// than leave the face without coordinates and nothing to say why
43#if defined(HAS_MESSAGE_KEY_LOCATION_LATITUDE) && defined(HAS_MESSAGE_KEY_LOCATION_LONGITUDE)
44#define APPMESSAGE_HAS_LOCATION 1
45#elif defined(HAS_MESSAGE_KEY_LOCATION_LATITUDE)
46#error "coordinates need LOCATION_LONGITUDE in messageKeys beside LOCATION_LATITUDE"
47#elif defined(HAS_MESSAGE_KEY_LOCATION_LONGITUDE)
48#error "coordinates need LOCATION_LATITUDE in messageKeys beside LOCATION_LONGITUDE"
49#endif