Skip to content

Instantly share code, notes, and snippets.

@ngsmrk
Last active August 29, 2015 14:01
Show Gist options
  • Save ngsmrk/07a1e0c5088447e0e1c6 to your computer and use it in GitHub Desktop.
Save ngsmrk/07a1e0c5088447e0e1c6 to your computer and use it in GitHub Desktop.
pebble_1
static void init(void) {
window = window_create();
window_set_click_config_provider(window, click_config_provider);
}
static void click_config_provider(void *context) {
window_single_click_subscribe(BUTTON_ID_SELECT, select_click_handler);
}
static void select_click_handler(ClickRecognizerRef recognizer, void *context) {
text_layer_set_text(text_layer, "Loading...");
send_to_phone();
}
static void send_to_phone() {
APP_LOG(APP_LOG_LEVEL_DEBUG, "Sending to Phone");
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
if (iter == NULL) {
APP_LOG(APP_LOG_LEVEL_DEBUG, "null iter");
}
Tuplet tuple = TupletCString(1, "");
dict_write_tuplet(iter, &tuple);
dict_write_end(iter);
app_message_outbox_send();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment