AppMessage transport: weather requests out, settings + readings in. Decodes the wire format and hands results to the app through handlers, so it never reaches into the UI itself.
More...
|
|
void | appmessage_on_weather (WeatherHandler cb) |
| | One weather message, every group it carried.
|
|
void | appmessage_on_coords (CoordsHandler cb) |
| | Latitude and longitude.
|
|
void | appmessage_on_settings_changed (SettingsChangedHandler cb) |
| | A setting changed on the phone.
|
|
void | appmessage_on_unit_changed (UnitChangedHandler cb) |
| | The wearer switched the temperature unit.
|
|
void | appmessage_on_stock_strip (StockStripHandler cb) |
| | Packed watchlist strip.
|
|
void | appmessage_on_calendar_strip (CalendarStripHandler cb) |
| | Packed agenda strip.
|
|
void | appmessage_on_custom_colors (CustomColorsHandler cb) |
| | Inbound: splits and stores the combined string.
|
|
void | appmessage_set_custom_colors_provider (CustomColorsProvider cb) |
| | Outbound: rebuilds the combined string.
|
| void | appmessage_add_inbox_complete (InboxCompleteHandler cb) |
| | Adds work to run once after a whole inbound message is handled, after every channel in it.
|
|
static void | pump (void) |
| | Send the head job when the outbox is free, once the phone is there.
|
| static uint32_t | settings_reply_size (void) |
| | The most outbox bytes the settings reply could take, counting everything write_settings writes. The outbox is opened at this, so no settings change can outgrow it later.
|
| static bool | write_settings (DictionaryIterator *iter) |
| | Write the settings reply payload into the outbox iterator.
|
| static bool | kind_has_key (OutboxKind kind) |
| | Whether this face declares the key a kind is sent under.
|
| static bool | send_job (OutboxKind kind) |
| | Build the message for kind and hand it to the outbox.
|
| static void | enqueue (OutboxKind kind, int retries) |
| | Add a job to the work queue unless its kind is already pending, then pump either way.
|
| static void | retry_pass (void *data) |
| | Move the whole failed set back into the work queue for another pass, then pump.
|
|
void | appmessage_request_weather (void) |
| | Asks the phone for a fresh weather reading. The weather store calls this on its turn on the shared cadence. On a face that does not declare the weather keys it sends nothing and logs one warning the first time it is called. The weather keys are WEATHER_REQUEST, WEATHER_TEMPERATURE, WEATHER_CONDITIONS, and WEATHER_OK, and a face that declares only some of them fails to build, with each missing one named.
|
|
void | appmessage_request_stock (void) |
| | Asks the phone for fresh quotes. The stock store calls this on its turn on the shared cadence. Does nothing on faces that do not declare the stock keys.
|
|
void | appmessage_request_calendar (void) |
| | Asks the phone for a fresh agenda. The calendar store calls this on its turn on the shared cadence. Does nothing on faces that do not declare the calendar keys.
|
|
static void | send_settings (void) |
| | Queue the settings reply so it serializes with the data requests through the one outbox.
|
| static void | inbox_received_callback (DictionaryIterator *iterator, void *context) |
| | Apply an inbox message: weather, coords, and any changed settings.
|
| static void | inbox_dropped_callback (AppMessageResult reason, void *context) |
| | Log a dropped inbox message.
|
| static void | outbox_failed_callback (DictionaryIterator *iter, AppMessageResult reason, void *context) |
| | Outbox send was nacked (usually the phone's pkjs is asleep).
|
| static void | outbox_sent_callback (DictionaryIterator *iter, void *context) |
| | Outbox delivered. Frees the outbox and sends the next queued job.
|
| void | appmessage_open (uint32_t inbox_size) |
| | Register the SDK callbacks and open the inbox and outbox.
|
AppMessage transport: weather requests out, settings + readings in. Decodes the wire format and hands results to the app through handlers, so it never reaches into the UI itself.