当前位置: 首页>>代码示例>>C++>>正文


C++ dict_write_uint8函数代码示例

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


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

示例1: request_weather

void request_weather(WeatherData *weather_data)
{
  APP_LOG(APP_LOG_LEVEL_DEBUG, "Request weather, retry: %i", retry_count);

  if (retry_count > MAX_RETRY) {
    APP_LOG(APP_LOG_LEVEL_DEBUG, "Too many retries");
    retry_count = 0;
    return;
  }

  if (!bluetooth_connection_service_peek()) {
    weather_data->error = WEATHER_E_DISCONNECTED;
    return;
  }

  DictionaryIterator *iter;
  app_message_outbox_begin(&iter);
  
  if (iter == NULL) {
    APP_LOG(APP_LOG_LEVEL_DEBUG, "Null iter");
    return;
  }

  dict_write_cstring(iter, KEY_SERVICE, weather_data->service);
  dict_write_cstring(iter, KEY_SCALE, weather_data->scale);
  dict_write_uint8(iter, KEY_DEBUG, (uint8_t)weather_data->debug);
  dict_write_uint8(iter, KEY_BATTERY, (uint8_t)weather_data->battery);

  dict_write_end(iter);

  app_message_outbox_send();
}
开发者ID:Zeduaz,项目名称:Weather-My-Way-INVERTED,代码行数:32,代码来源:network.c

示例2: 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

示例3: update_time

static void update_time() {
  // Get a tm structure
  time_t temp = time(NULL); 
  struct tm *tick_time = localtime(&temp);

  // Create a long-lived buffer
  static char buffer[] = "00:00";

  // Write the current hours and minutes into the buffer
  if(clock_is_24h_style() == true) {
    // Use 24 hour format
    strftime(buffer, sizeof("00:00"), "%H:%M", tick_time);
  } else {
    // Use 12 hour format
    strftime(buffer, sizeof("00:00"), "%I:%M", tick_time);
  }

  // Display this time on the TextLayer
  text_layer_set_text(s_time_layer, buffer);

  // Get weather update every 30 minutes
  if(tick_time->tm_min % 30 == 0) {
    // Begin dictionary
    DictionaryIterator *iter;
    app_message_outbox_begin(&iter);

    // Add a key-value pair
    dict_write_uint8(iter, 0, 0);
    dict_write_uint8(iter, 1, 1);

    // Send the message!
    app_message_outbox_send();
  }
}
开发者ID:remcovz,项目名称:PebbleTutorial1,代码行数:34,代码来源:main.c

示例4: push_button

void push_button(int buttonId) {
    DictionaryIterator *iter;
    app_message_outbox_begin(&iter);
    dict_write_uint8(iter, KEY_CMD_EXECUTED, CMD_PUSH_BUTTON);
    dict_write_uint8(iter, KEY_BUTTON_ID, buttonId);
    dict_write_end(iter);
    app_message_outbox_send();
}
开发者ID:rbenamotz,项目名称:PebbleSoundTouch,代码行数:8,代码来源:comm.c

示例5: change_volume

void change_volume() {
    DictionaryIterator *iter;
    app_message_outbox_begin(&iter);
    dict_write_uint8(iter, KEY_CMD_EXECUTED,CMD_SET_VOLUME);
    dict_write_uint8(iter, KEY_NEW_VOLUME,volume);
    dict_write_end(iter);
    app_message_outbox_send();
    win_now_playing_refresh_data();
}
开发者ID:rbenamotz,项目名称:PebbleSoundTouch,代码行数:9,代码来源:comm.c

示例6: simply_msg_long_click

bool simply_msg_long_click(ButtonId button) {
  DictionaryIterator *iter = NULL;
  if (app_message_outbox_begin(&iter) != APP_MSG_OK) {
    return false;
  }
  dict_write_uint8(iter, 0, SimplyACmd_longClick);
  dict_write_uint8(iter, 1, button);
  return (app_message_outbox_send() == APP_MSG_OK);
}
开发者ID:ericmigi,项目名称:simplyjs-1,代码行数:9,代码来源:simply_msg.c

示例7: send_message

// Write message to buffer & send
void send_message(void){
	DictionaryIterator *iter;
	
	app_message_outbox_begin(&iter);
	dict_write_uint8(iter, STATUS_KEY, 0x1);
  dict_write_uint8(iter, GET_UPDATE_KEY, 0x2);
	
	dict_write_end(iter);
  	app_message_outbox_send();
}
开发者ID:smalley,项目名称:PebbleWorldCup,代码行数:11,代码来源:base.c

示例8: simply_msg_accel_tap

bool simply_msg_accel_tap(AccelAxisType axis, int32_t direction) {
  DictionaryIterator *iter = NULL;
  if (app_message_outbox_begin(&iter) != APP_MSG_OK) {
    return false;
  }
  dict_write_uint8(iter, 0, SimplyACmd_accelTap);
  dict_write_uint8(iter, 1, axis);
  dict_write_int8(iter, 2, direction);
  return (app_message_outbox_send() == APP_MSG_OK);
}
开发者ID:ericmigi,项目名称:simplyjs-1,代码行数:10,代码来源:simply_msg.c

示例9: send_initial_packet

static void send_initial_packet() {
	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);
	dict_write_uint32(iterator, 3, getCapabilities(appmessage_max_size));

	app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED);
	app_message_outbox_send();
}
开发者ID:matejdro,项目名称:PebbleNotificationCenter-Watchapp,代码行数:11,代码来源:NotificationCenter.c

示例10: requestNumbers

static void requestNumbers(uint16_t pos)
{
	DictionaryIterator *iterator;
	app_message_outbox_begin(&iterator);
	dict_write_uint8(iterator, 0, 2);
	dict_write_uint8(iterator, 1, 0);
	dict_write_uint16(iterator, 2, pos);

	app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED);
	app_message_outbox_send();
}
开发者ID:faelys,项目名称:PebbleDialer-Watchapp,代码行数:11,代码来源:CallLogWindow.c

示例11: send_message

// Write message to buffer & send
void send_message(int d)
{
	DictionaryIterator *iter;
	
	app_message_outbox_begin(&iter);
	dict_write_uint8(iter, STATUS_KEY, 0x1);
     dict_write_uint8(iter, MESSAGE_KEY, d);

     dict_write_end(iter);
     app_message_outbox_send();
}
开发者ID:loganisitt,项目名称:Pebblesss-watchapp,代码行数:12,代码来源:main.c

示例12: closeApp

void closeApp(void)
{
	DictionaryIterator *iterator;
	app_message_outbox_begin(&iterator);
	dict_write_uint8(iterator, 0, 0);
	dict_write_uint8(iterator, 1, 2);
	app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED);
	app_message_outbox_send();

	closingMode = true;
}
开发者ID:faelys,项目名称:PebbleDialer-Watchapp,代码行数:11,代码来源:PebbleDialer.c

示例13: sendAction

void sendAction(int buttonId)
{
    DictionaryIterator *iterator;
    app_message_outbox_begin(&iterator);

    dict_write_uint8(iterator, 0, 7);
    dict_write_uint8(iterator, 1, buttonId);

    app_message_outbox_send();

    busy = true;
    vibes_cancel();
}
开发者ID:vitaliyy,项目名称:PebbleDialer-Watchapp,代码行数:13,代码来源:callscreen.c

示例14: menu_picked

void menu_picked(int index, void* context)
{
	show_loading();

	DictionaryIterator *iterator;
	app_message_outbox_begin(&iterator);

	dict_write_uint8(iterator, 0, 6);
	dict_write_uint8(iterator, 1, index);

	app_message_outbox_send();

	app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED);
	app_comm_set_sniff_interval(SNIFF_INTERVAL_NORMAL);
}
开发者ID:40ft,项目名称:PebbleNotificationCenter-Watchapp,代码行数:15,代码来源:MainMenu.c

示例15: send_to_phone

static void send_to_phone() {
  APP_LOG(APP_LOG_LEVEL_DEBUG, "Preparing data to send to Phone");

  if (listSize == 0) return;
  DictionaryIterator *dict;
  app_message_outbox_begin(&dict);

  int indexToSend = (int) menu_layer_get_selected_index(s_menu_layer).row;
  APP_LOG(APP_LOG_LEVEL_DEBUG, "statusList[indexToSend] set to: %s", statusList[indexToSend]);
  
  if (strcmp(statusList[indexToSend],"Ready") != 0 &&
     strcmp(statusList[indexToSend],"Pending...") != 0) {
    free (statusList[indexToSend]);
    statusList[indexToSend] = NULL;
   APP_LOG(APP_LOG_LEVEL_DEBUG, "?Preparing data to send to Phone");
  }
  menu_layer_reload_data(s_menu_layer);
  statusList[indexToSend] = "Pending...";
  APP_LOG(APP_LOG_LEVEL_DEBUG, "statusList[%d] set to Waiting...", indexToSend);

  APP_LOG(APP_LOG_LEVEL_DEBUG, "Menu index to send: %d", indexToSend);
  dict_write_uint8(dict,KEY_INDEX,indexToSend);
  const uint32_t final_size = dict_write_end(dict);
  APP_LOG(APP_LOG_LEVEL_DEBUG, "Sent message to phone! (%d bytes)", (int) final_size);
  app_message_outbox_send();
}
开发者ID:clach04,项目名称:HTTP-Push,代码行数:26,代码来源:HTTP.c


注:本文中的dict_write_uint8函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。