Skip to content

Instantly share code, notes, and snippets.

@bani
Created February 16, 2016 01:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bani/5a3a2d531806c80def38 to your computer and use it in GitHub Desktop.
Save bani/5a3a2d531806c80def38 to your computer and use it in GitHub Desktop.
inbox_received_handler C implementation for Pebble configuration
static void inbox_received_handler(DictionaryIterator *iter, void *context) {
APP_LOG(APP_LOG_LEVEL_DEBUG, "New gem color received");
Tuple *gem_color_t = dict_find(iter, KEY_GEM_COLOR);
if (gem_color_t) {
int gem_color = gem_color_t->value->int32;
persist_write_int(KEY_GEM_COLOR, gem_color);
set_background_gem(gem_color);
Layer *window_layer = window_get_root_layer(window);
layer_mark_dirty(window_layer);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment