C++ app_message_register_outbox_sent函数代码示例

本文整理汇总了C++中app_message_register_outbox_sent函数的典型用法代码示例。如果您正苦于以下问题:C++ app_message_register_outbox_sent函数的具体用法?C++ app_message_register_outbox_sent怎么用?C++ app_message_register_outbox_sent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


C++ app_message_register_outbox_sent函数代码示例

在下文中一共展示了app_message_register_outbox_sent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: app_message_init

static void app_message_init(void) {
    app_message_register_inbox_dropped(app_message_inbox_dropped);
    app_message_register_inbox_received(app_message_inbox_received);
    app_message_register_outbox_failed(app_message_outbox_failed);
    app_message_register_outbox_sent(app_message_outbox_sent);
    app_message_open(app_message_inbox_size_maximum(), 256);
}
开发者ID:henriwatson,项目名称:PebbleBucks,代码行数:7,代码来源:main.c

示例2: handle_init

void handle_init(void) {
    APP_LOG(APP_LOG_LEVEL_DEBUG, "Init. Register callbacks, create windows and text layer.");

    // Register callbacks
    app_message_register_inbox_received(inbox_received_callback);
    app_message_register_inbox_dropped(inbox_dropped_callback);
    app_message_register_outbox_failed(outbox_failed_callback);
    app_message_register_outbox_sent(outbox_sent_callback);

    // Open AppMessage
    app_message_open(app_message_inbox_size_maximum(), app_message_outbox_size_maximum());

    // Create a window and text layer
    window = window_create();
    text_layer = text_layer_create(GRect(0, 0, 144, 154));

    // Set the text, font, and text alignment
    text_layer_set_text(text_layer, "Hi, I'm a Pebble!");
    text_layer_set_font(text_layer, fonts_get_system_font(FONT_KEY_GOTHIC_28_BOLD));
    text_layer_set_text_alignment(text_layer, GTextAlignmentCenter);

    // Add the text layer to the window
    layer_add_child(window_get_root_layer(window), text_layer_get_layer(text_layer));

    // Push the window
    window_stack_push(window, true);

    // App Logging!
    APP_LOG(APP_LOG_LEVEL_DEBUG, "Just pushed a window!");
}
开发者ID:edmund-k,项目名称:pebble-helloworld,代码行数:30,代码来源:hello_world.c

示例3: main

int main(void) {
	appmessage_max_size = app_message_inbox_size_maximum();
	if (appmessage_max_size > 4096)
		appmessage_max_size = 4096; //Limit inbox size to conserve RAM.

	#ifdef PBL_PLATFORM_APLITE
		//Aplite has so little memory, we can't squeeze much more than that out of appmessage buffer.
		appmessage_max_size = 124;
	#endif

	app_message_register_inbox_received(received_data);
	app_message_register_outbox_sent(sent_data);
	app_message_open(appmessage_max_size, 408);

	loadingMode = true;
	send_initial_packet();
	app_timer_register(3000, loading_retry_timer, NULL);

	switchWindow(0);
	app_event_loop();
	window_stack_pop_all(false);

	free(config_periodicVibrationPattern);

    AppLaunchReason appLaunchReason = launch_reason();
    if (appLaunchReason == APP_LAUNCH_PHONE && !config_dontClose) {
        // If app was launched by phone and close to last app is disabled, always exit to the watchface instead of to the menu
        exit_reason_set(APP_EXIT_ACTION_PERFORMED_SUCCESSFULLY);
    }

	return 0;
}
开发者ID:matejdro,项目名称:PebbleNotificationCenter-Watchapp,代码行数:32,代码来源:NotificationCenter.c

示例4: init

void init() 
{
	//create window
	window = window_create();
	window_set_background_color(window,GColorBlack);
	window_stack_push(window, true);
	Layer* window_layer = window_get_root_layer(window);	
	
	//load background
	background = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BACKGROUND);
	
	//load font
	raleway_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_RALEWAY_22));
	
	//create layer
	layer = layer_create(GRect(0,0,144,168));
	layer_set_update_proc(layer, update_layer);
	layer_add_child(window_layer, layer);	
	
	//subscribe to seconds tick event
	tick_timer_service_subscribe(SECOND_UNIT, (TickHandler) tick);
	
	// Register callbacks
	app_message_register_inbox_received(inbox_received_callback);
	app_message_register_inbox_dropped(inbox_dropped_callback);
	app_message_register_outbox_failed(outbox_failed_callback);
	app_message_register_outbox_sent(outbox_sent_callback);

	// Open AppMessage
	app_message_open(app_message_inbox_size_maximum(), app_message_outbox_size_maximum());
}
开发者ID:jsternfield,项目名称:ZenForSteel,代码行数:31,代码来源:watchface.c

示例5: strap_init

void strap_init() {
    if (!persist_read_bool(STRAP_OPT_OUT)) {
        memset(cur_activity, 0, sizeof(cur_activity));
        strap_set_activity("UNKNOWN");
        app_message_register_outbox_sent(strap_out_sent_handler);
        app_message_register_outbox_failed(strap_out_failed_handler);

        // detect if app crashed last time
        if (persist_read_bool(STRAP_CRASH_WATCHER)) {
            strap_log_action("STRAP_CRASH");
        }

        // set persistent boolean that will be removed when app is deinited
        // we will check for existance on init, and if it is true
        persist_write_bool(STRAP_CRASH_WATCHER,true);

        // start sending accl data in 30 seconds
        #ifndef DISABLE_ACCL
            acclStart = app_timer_register(30 * 1000, app_timer_accl_start,NULL);
        #endif
        battTimer = app_timer_register(1 * 10 * 1000, app_timer_battery,NULL);
        //app_timer_register(30 * 1000,log_timer, NULL);
        app_timer_register(1  * 1000,log_action,"STRAP_START");
    } else {
        app_log(APP_LOG_LEVEL_INFO, "log", 0, "USER OPTED OUT OF STRAP METRICS");
    }
}
开发者ID:clementGdev,项目名称:E8_pebble_watchface,代码行数:27,代码来源:strap.c

示例6: main

int main() {
	app_message_register_outbox_sent(data_delivered);
	app_message_register_inbox_received(received_data);

	app_message_open(124, 50);

	DictionaryIterator *iterator;
	app_message_outbox_begin(&iterator);
	dict_write_uint8(iterator, 0, 0);
	dict_write_uint8(iterator, 1, 0);
	dict_write_uint16(iterator, 2, PROTOCOL_VERSION);
	#ifdef PBL_PLATFORM_APLITE
		dict_write_uint8(iterator, 3, 0);
	#else
		dict_write_uint8(iterator, 3, 1);
	#endif

	app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED);
	app_message_outbox_send();

	switchWindow(0);
	app_event_loop();
	window_stack_pop_all(false);
	return 0;
}
开发者ID:faelys,项目名称:PebbleDialer-Watchapp,代码行数:25,代码来源:PebbleDialer.c

示例7: appmessage_init

void appmessage_init(void) {
	app_message_register_inbox_received(in_received_handler);
	app_message_register_inbox_dropped(in_dropped_handler);
	app_message_register_outbox_sent(out_sent_handler);
	app_message_register_outbox_failed(out_failed_handler);
	app_message_open_max();
}
开发者ID:Debiggs,项目名称:OpalX,代码行数:7,代码来源:appmessage.c

示例8: handle_init

static void handle_init(void) {
    window = window_create();
    window_stack_push(window, true /* Animated */);

    // child init
    simplebig_init(window);
    status_init(window);
    termo_init(window);

    // Register callbacks
    app_message_register_inbox_received(inbox_received_callback);
    app_message_register_inbox_dropped(inbox_dropped_callback);
    app_message_register_outbox_failed(outbox_failed_callback);
    app_message_register_outbox_sent(outbox_sent_callback);

    // Open AppMessage
    AppMessageResult result = app_message_open(APP_MESSAGE_INBOX_SIZE_MINIMUM, APP_MESSAGE_OUTBOX_SIZE_MINIMUM);
    if (result != APP_MSG_OK) {
        APP_LOG(APP_LOG_LEVEL_ERROR, "Can't open inbox");
    }

    // handlers
    tick_timer_service_subscribe(MINUTE_UNIT, handle_minute_tick);
    UnobstructedAreaHandlers ua_handler = {
        .change = handle_unobstructed_change
    };
    unobstructed_area_service_subscribe(ua_handler, NULL);

    // style
    set_style();

    // draw first frame
    force_update();
}
开发者ID:foxel,项目名称:pebble-simplef,代码行数:34,代码来源:main.c

示例9: appmessage_init

void appmessage_init(void) {
	app_message_register_inbox_received(in_received_handler);
	app_message_register_inbox_dropped(in_dropped_handler);
	app_message_register_outbox_sent(out_sent_handler);
	app_message_register_outbox_failed(out_failed_handler);
	app_message_open(128 /* inbound_size */, 64 /* outbound_size */);
}
开发者ID:flipoidix,项目名称:Skipstone,代码行数:7,代码来源:appmessage.c

示例10: handle_init

void handle_init(void) {
  my_window = window_create();

//  text_layer = text_layer_create(GRect(0, 0, 144, 20));
  // Create time TextLayer
  s_time_layer = text_layer_create(GRect(0, 55, 144, 50));
  text_layer_set_background_color(s_time_layer, GColorClear);
  text_layer_set_text_color(s_time_layer, GColorBlack);
  text_layer_set_text(s_time_layer, "00:00");

  // Improve the layout to be more like a watchface
  text_layer_set_font(s_time_layer, fonts_get_system_font(FONT_KEY_BITHAM_42_BOLD));
  text_layer_set_text_alignment(s_time_layer, GTextAlignmentCenter);

  // Add it as a child layer to the Window's root layer
  layer_add_child(window_get_root_layer(my_window), text_layer_get_layer(s_time_layer));
  tick_timer_service_subscribe(MINUTE_UNIT, tick_handler);
  update_time();
  window_set_click_config_provider(my_window, config_provider);
  app_message_register_inbox_received(in_received_handler);
   app_message_register_inbox_dropped(in_dropped_handler);
   app_message_register_outbox_sent(out_sent_handler);
   app_message_register_outbox_failed(out_failed_handler);
const uint32_t inbound_size = 64;
   const uint32_t outbound_size = 64;
   app_message_open(inbound_size, outbound_size);
  window_stack_push(my_window, true);
}
开发者ID:jwiggers,项目名称:PVPebble,代码行数:28,代码来源:main.c

示例11: messsages_open_send

void messsages_open_send() {
  // first register callbacks
  app_message_register_inbox_received(messages_inbox_received);
  app_message_register_inbox_dropped(messages_inbox_dropped);
  app_message_register_outbox_sent(messages_outbox_sent);
  app_message_register_outbox_failed(messages_outbox_failed);
  
  if (app_message_open(APP_MESSAGE_INBOX_SIZE_MINIMUM, APP_MESSAGE_OUTBOX_SIZE_MINIMUM) != APP_MSG_OK) {
    APP_LOG(APP_LOG_LEVEL_ERROR, "Open Message Failed");
    return;
  }
  DictionaryIterator* dic_iterator;
  if (app_message_outbox_begin(&dic_iterator) != APP_MSG_OK) {
    APP_LOG(APP_LOG_LEVEL_ERROR, "Begin Message Outbox Failed");
    return;
  }
  char buffer[50];
  time_t now;
  time(&now);
  strftime(buffer, sizeof(buffer),"P: %H:%M %S", localtime(&now));
  // write some data
  dict_write_cstring(dic_iterator, 1, buffer);
  dict_write_end(dic_iterator);
  // send
  app_message_outbox_send();
  APP_LOG(APP_LOG_LEVEL_INFO,"Message %s sent",buffer);
}
开发者ID:bingtimren,项目名称:Testbed42,代码行数:27,代码来源:messages.c

示例12: main_init

// omain init - registers callback functions, reads persistent data, and requests most recent data from
// companion app. Sets default timer length to 10 seconds.
void main_init(void) {
  s_reset_app(NULL);
    
  // initialize app message
  app_message_register_inbox_received(inbox_received_callback);
  app_message_register_inbox_dropped(inbox_dropped_callback);
  app_message_register_outbox_failed(outbox_failed_callback);
  app_message_register_outbox_sent(outbox_sent_callback);
  app_message_open(app_message_inbox_size_maximum(), app_message_outbox_size_maximum());
   
  // send request for most recent data
  DictionaryIterator *iter;
  app_message_outbox_begin(&iter);
  dict_write_uint8(iter, 0, 42);
  app_message_outbox_send();
  
  // gather persistent data for timer length and passcode
  if (persist_exists(TIMERLEN_PERSIST_KEY)) {
    s_timer_len = persist_read_int(TIMERLEN_PERSIST_KEY);
  } else {
    s_timer_len = 10*1000;
  }
  if (persist_exists(PASSCODE_PERSIST_KEY)) {
    s_passcode_defined = true;
    persist_read_string(PASSCODE_PERSIST_KEY, s_passcode, PASSCODE_LEN + 1);
  } else {
    s_passcode_defined = false;
  }
}
开发者ID:Tsukinara,项目名称:DangerZone,代码行数:31,代码来源:quick_alert.c

示例13: init

//=====================================
// initiliase/tear down
static void init() {
  // register with the time service
  tick_timer_service_subscribe(SECOND_UNIT, tick_handler);

  //register for battery info updates
  battery_state_service_subscribe(battery_callback);

  // register for bluetooth events
  bluetooth_connection_service_subscribe(bluetooth_callback);

  // register callbacks
  app_message_register_inbox_received(inbox_received_callback);
  app_message_register_inbox_dropped(inbox_dropped_callback);
  app_message_register_outbox_failed(outbox_failed_callback);
  app_message_register_outbox_sent(outbox_sent_callback);

  //open app message
  app_message_open(app_message_inbox_size_maximum(), app_message_outbox_size_maximum());

  //create main window element and assign to pointer
  s_main_window = window_create();
  window_set_background_color(s_main_window, GColorCadetBlue);

  //set handlers to manage elements inside Window
  window_set_window_handlers(s_main_window, (WindowHandlers){
    .load = main_window_load,
    .unload = main_window_unload
  });
开发者ID:rtregaskis,项目名称:PebbleFace,代码行数:30,代码来源:main.c

示例14: handle_init

void handle_init(void) {
	// Create a window and text layer
	window = window_create();
	text_layer = text_layer_create(GRect(0, 0, 144, 154));
	
	// Set the text, font, and text alignment
	text_layer_set_text(text_layer, "Project Kina");
	text_layer_set_font(text_layer, fonts_get_system_font(FONT_KEY_GOTHIC_28_BOLD));
	text_layer_set_text_alignment(text_layer, GTextAlignmentCenter);
	
	// Add the text layer to the window
	layer_add_child(window_get_root_layer(window), text_layer_get_layer(text_layer));

	// Push the window
	window_stack_push(window, true);
	
	// App Logging!
	APP_LOG(APP_LOG_LEVEL_DEBUG, "Just pushed a window!");
  
   app_message_register_inbox_received(in_received_handler);
   app_message_register_inbox_dropped(in_dropped_handler);
   app_message_register_outbox_sent(out_sent_handler);
   app_message_register_outbox_failed(out_failed_handler);

   const int inbound_size = 64;
   const int outbound_size = 64;
   app_message_open(inbound_size, outbound_size);
}
开发者ID:dandiferr,项目名称:KINA,代码行数:28,代码来源:hello_world.c

示例15: init

static void init() {
  // Subscribe to Wakeup API
  wakeup_service_subscribe(wakeup_handler);
  
  // Register callbacks
  app_message_register_inbox_received(inbox_received_callback);
  app_message_register_inbox_dropped(inbox_dropped_callback);
  app_message_register_outbox_failed(outbox_failed_callback);
  app_message_register_outbox_sent(outbox_sent_callback);
  app_message_open(400,400);
  
  // Was this a wakeup launch?
  if (launch_reason() == APP_LAUNCH_WAKEUP) {
    // The app was started by a wakeup
    WakeupId id = 0;
    int32_t reason = 0;

    // Get details and handle the wakeup
    wakeup_get_launch_event(&id, &reason);
    wakeup_handler(id, reason);
  } else {
    // Launch main page
    init_main_window();
    
    // Launch the splash page
    init_splash_window();
  }
}
开发者ID:Herschee,项目名称:Watchdog,代码行数:28,代码来源:clock.c

本文标签属性:

示例:示例图

代码:代码零九

上一篇:春节成为联合国假日(春节成为联合国假日的原因)
下一篇:Python libmpf.mpf_add函数代码示例

为您推荐