本文整理汇总了C++中dict_write_tuplet函数的典型用法代码示例。如果您正苦于以下问题:C++ dict_write_tuplet函数的具体用法?C++ dict_write_tuplet怎么用?C++ dict_write_tuplet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dict_write_tuplet函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: select_menu_callback
// Menu callback
void select_menu_callback(int index, void *context) {
app_message_outbox_begin(&iter);
static char* select_action;
if (strcmp(menu_action, "c") == 0) {
select_action = "selClient";
} else if(strcmp(menu_action, "t") == 0) {
select_action = "selTask";
snprintf(task_title, 40, "Task:\n%s", list_menu_items[index].title);
text_layer_set_text(task_layer, task_title);
} else if (strcmp(menu_action, "p") == 0) {
select_action = "selProj";
snprintf(project_title, 40, "Project:\n%s", list_menu_items[index].title);
text_layer_set_text(task_layer, project_title);
} else {
// strcmp failed to find a match
APP_LOG(APP_LOG_LEVEL_DEBUG, "No match on strcmp, value of menu_action follows");
APP_LOG(APP_LOG_LEVEL_DEBUG, menu_action);
}
Tuplet action_type = TupletCString(0, select_action);
dict_write_tuplet(iter, &action_type);
Tuplet selected = TupletInteger(1, index);
dict_write_tuplet(iter, &selected);
app_message_outbox_send(); // this send is causing crash :S
//pop the menu off
window_stack_pop(true);
}
开发者ID:BillMyTime,项目名称:bill-my-time-pebble,代码行数:28,代码来源:billmytime.c
示例2: go_next_or_prev
// Next or previous
void go_next_or_prev(uint8_t key, uint8_t cmd){
if (current == -1 || max == -1){
//Not all data has been received, unable to determine if you can go next/prev
return;
}
if (current == 1 && cmd == BUTTON_PREVIOUS){
//First already, cannot prev, exit
return;
}
if (current == max && cmd == BUTTON_NEXT){
//Last in list, exit
return;
}
resetData();
if (debugMode)
APP_LOG(APP_LOG_LEVEL_INFO, "Sending data to phone");
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
Tuplet value = TupletInteger(key, cmd);
dict_write_tuplet(iter, &value);
if (current != -1){
Tuplet page = TupletInteger(MESSAGE_CURRENT_FAV, current);
dict_write_tuplet(iter, &page);
}
app_message_outbox_send();
}
开发者ID:itachi1706,项目名称:SingBuses,代码行数:30,代码来源:bus_layout.c
示例3: tick_handler
/*
* Tick-Handler - executes once every second using watch's internal clock.
* Switched every other second between getting most recent temp (if desired) and checking for tripped alarm.
*/
static void tick_handler(struct tm *tick_time, TimeUnits units_changed) {
if (tickTimerMod % 2 == 0){
if (wantAverage && !standbyEngaged && !tripped){
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
int key = 0;
// send the message "b" to the phone, using key #0
Tuplet value = TupletCString(key, "b");
dict_write_tuplet(iter, &value);
app_message_outbox_send();
}
}
else{
//checks if alarm has been tripped, checks to see every 10 seconds if not
if (tripped){
text_layer_set_text(hello_layer, "INTRUDER ALERT!!!");
vibes_double_pulse();
}
else {
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
int key = 0;
// send the message "t" to the phone, using key #0
Tuplet value = TupletCString(key, "t");
dict_write_tuplet(iter, &value);
app_message_outbox_send();
}
}
tickTimerMod += 1;
}
开发者ID:RyCSmith,项目名称:WatchDog,代码行数:34,代码来源:main.c
示例4: http_capture_send_buffer
static void http_capture_send_buffer() {
int len = 64;
if (http_capture_sentLen+len > 18*168)
len = 18*168 - http_capture_sentLen;
if (len <= 0)
return;
Tuplet start = TupletInteger(0xFFF9, http_capture_sentLen);
Tuplet buf = TupletBytes(1000, &http_capture_frameBuffer[http_capture_sentLen], len);
DictionaryIterator *iter;
app_message_out_get(&iter);
if (iter == NULL)
return;
dict_write_tuplet(iter, &start);
dict_write_tuplet(iter, &buf);
dict_write_end(iter);
http_capture_sentLen += len;
app_message_out_send();
app_message_out_release();
}
开发者ID:MarkusLitz,项目名称:meditation,代码行数:25,代码来源:httpcapture.c
示例5: fetch_data
static void fetch_data(void) {
Tuplet style_tuple = TupletInteger(STYLE_KEY, 0);
Tuplet bluetoothvibe_tuple = TupletInteger(BLUETOOTHVIBE_KEY, 0);
Tuplet hourlyvibe_tuple = TupletInteger(HOURLYVIBE_KEY, 0);
Tuplet blink_tuple = TupletInteger(BLINK_KEY, 0);
Tuplet dateformat_tuple = TupletInteger(DATEFORMAT_KEY, 0);
Tuplet units_tuple = TupletInteger(WEATHER_UNITS, 0);
Tuplet weather_temperature_tuple = TupletInteger(WEATHER_TEMPERATURE_KEY, 0);
Tuplet weather_icon_tuple = TupletInteger(WEATHER_ICON_KEY, 0);
Tuplet weather_high_tuple = TupletInteger(WEATHER_TEMPERATUREHIGH_KEY, 0);
Tuplet weather_low_tuple = TupletInteger(WEATHER_TEMPERATURELOW_KEY, 0);
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
if (iter == NULL) {
return;
}
dict_write_tuplet(iter, &style_tuple);
dict_write_tuplet(iter, &bluetoothvibe_tuple);
dict_write_tuplet(iter, &hourlyvibe_tuple);
dict_write_tuplet(iter, &units_tuple);
dict_write_tuplet(iter, &weather_temperature_tuple);
dict_write_tuplet(iter, &weather_icon_tuple);
dict_write_tuplet(iter, &weather_high_tuple);
dict_write_tuplet(iter, &weather_low_tuple);
dict_write_tuplet(iter, &blink_tuple);
dict_write_tuplet(iter, &dateformat_tuple);
dict_write_end(iter);
app_message_outbox_send();
}
开发者ID:vekexasia,项目名称:Chunk-Weather-v2.0,代码行数:34,代码来源:chunk.c
示例6: up_double_click_handler
/*
* Responds to double up button clicks. When !tripped, asks the server to put the Arduino in
* or out of standby mode and records it. When tripped, resets the alarm on the server and Arduino.
*/
void up_double_click_handler(ClickRecognizerRef recognizer, void *context) {
if (!tripped){
standbyEngaged = !standbyEngaged;
wantAverage = 0;
//text_layer_set_text(hello_layer, "UP!");
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
int key = 0;
// send the message "hello?" to the phone, using key #0
Tuplet value = TupletCString(key, "s");
dict_write_tuplet(iter, &value);
app_message_outbox_send();
}
else {
tripped = 0;
//text_layer_set_text(hello_layer, "UP!");
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
int key = 0;
// send the message "hello?" to the phone, using key #0
Tuplet value = TupletCString(key, "r");
dict_write_tuplet(iter, &value);
app_message_outbox_send();
}
}
开发者ID:RyCSmith,项目名称:WatchDog,代码行数:29,代码来源:main.c
示例7: send_cmd
static void send_cmd(void) {
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
if (iter == NULL) {
return;
}
static char *bgptr = last_bg;
static char *bgptr2 = last_bg_2;
static char *timeptr = new_time;
static char *timeptr_2 = new_time_2;
Tuplet alertval = TupletInteger(3, 0);
Tuplet bgVal = TupletCString(1, bgptr);
Tuplet bgVal2 = TupletCString(4, bgptr2);
Tuplet lastTimeVal = TupletCString(2, timeptr);
Tuplet lastTimeVal2 = TupletCString(6, timeptr_2);
dict_write_tuplet(iter, &alertval);
dict_write_tuplet(iter, &bgVal);
dict_write_tuplet(iter, &bgVal2);
dict_write_tuplet(iter, &lastTimeVal);
dict_write_tuplet(iter, &lastTimeVal2);
dict_write_end(iter);
app_message_outbox_send();
}
开发者ID:CGMintheCloud,项目名称:cgm-pebble-splitscreen,代码行数:31,代码来源:cgm.c
示例8: change_client_click
// Change to another client
void change_client_click(ClickRecognizerRef recognizer, Window *window) {
app_message_outbox_begin(&iter);
Tuplet value = TupletCString(0, "getClients");
dict_write_tuplet(iter, &value);
Tuplet pager = TupletInteger(1, page);
dict_write_tuplet(iter, &pager);
app_message_outbox_send();
}
开发者ID:BillMyTime,项目名称:bill-my-time-pebble,代码行数:9,代码来源:billmytime.c
示例9: submit_time_to_task
void submit_time_to_task(ClickRecognizerRef recognizer, Window *window) {
app_message_outbox_begin(&iter);
Tuplet value = TupletCString(0, "postTask");
dict_write_tuplet(iter, &value);
Tuplet start = TupletInteger(1, start_time);
dict_write_tuplet(iter, &start);
Tuplet duration = TupletInteger(1, elapsed_time);
dict_write_tuplet(iter, &duration);
app_message_outbox_send();
}
开发者ID:BillMyTime,项目名称:bill-my-time-pebble,代码行数:10,代码来源:billmytime.c
示例10: send_change_units_message
/* Sends a request to change the units between celsius and fahrenheit */
void send_change_units_message() {
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
if (celsius) {
Tuplet value = TupletCString(4, "Use celsius");
dict_write_tuplet(iter, &value);
} else {
Tuplet value = TupletCString(5, "Use Fahrenheit");
dict_write_tuplet(iter, &value);
}
app_message_outbox_send();
}
开发者ID:carengahi,项目名称:Pebble-Watch-Application,代码行数:13,代码来源:watchapp.c
示例11: send_message
/*!
@brief メッセージ送信処理。
*/
void send_message()
{
DBG_LOG(APP_LOG_LEVEL_DEBUG, "send_message");
DictionaryIterator *iter = NULL;
app_message_outbox_begin(&iter);
if (iter == NULL) {
// 送信用イテレータの作成に失敗
//entry_log( "error", "outbox_begin" ) ;
DBG_LOG(APP_LOG_LEVEL_DEBUG, "send_message_error: outbox_begin");
return;
}
int k = 0, v = 0;
bool more = mq_kv_get_first(&k, &v);
while (more) {
if (k == KEY_PARAM_SETTING_DATE) {
time_t timer = time(NULL);
struct tm *local = localtime(&timer);
char str[64];
// ポインタにしないとTupletCStringがエラーを出す
char *p = str;
int year = local->tm_year + 1900;
int month = local->tm_mon + 1;
int day = local->tm_mday;
int hour = local->tm_hour;
int min = local->tm_min;
int sec = local->tm_sec;
// RFC 3339に合わせて変換を行う
snprintf(str, sizeof(str), "%4d-%02d-%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
entry_log("get setting/date", str);
Tuplet dateTuple = TupletCString(KEY_PARAM_SETTING_DATE, p);
dict_write_tuplet(iter, &dateTuple);
} else {
Tuplet tuple = TupletInteger(k, v);
dict_write_tuplet(iter, &tuple);
}
more = mq_kv_get_next(&k, &v);
}
// データ終了
dict_write_end(iter);
// データ送信
AppMessageResult res = app_message_outbox_send();
DBG_LOG(APP_LOG_LEVEL_DEBUG, "res:%d", res);
}
开发者ID:Onuzimoyr,项目名称:d-Common,代码行数:52,代码来源:send_message.c
示例12: send_cmd
static void send_cmd(void) {
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
if (iter == NULL) {
return;
}
Tuplet direction = TupletCString(0, index);
dict_write_tuplet(iter, &direction);
Tuplet load = TupletCString(2, "Loading...");
dict_write_tuplet(iter, &load);
dict_write_end(iter);
app_message_outbox_send();
}
开发者ID:aclymer,项目名称:SpitReport_V0.70,代码行数:15,代码来源:SpitReport.c
示例13: getDetails
void getDetails(char *monitorId) {
APP_LOG(APP_LOG_LEVEL_DEBUG, "Getting info for %s", monitorId);
Tuplet get_details_tuple = TupletInteger(MONITOR_GET_DETAILS, 1);
Tuplet monitor_id_tuple = TupletCString(MONITOR_ID, monitorId);
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
if (iter == NULL) {
return;
}
dict_write_tuplet(iter, &get_details_tuple);
dict_write_tuplet(iter, &monitor_id_tuple);
dict_write_end(iter);
app_message_outbox_send();
}
开发者ID:bdjett,项目名称:UptimeRobot-Pebble,代码行数:16,代码来源:details.c
示例14: select_click_callback
static void select_click_callback(MenuLayer *menu_layer, MenuIndex *cell_index, void *callback_context)
{
switch(cell_index->row){
case 0:
finish_init();
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
char * phone_num = (char*)malloc(11 * sizeof(char));
phone_num[0] = cont_num[0];
phone_num[1] = cont_num[1];
phone_num[2] = cont_num[2];
phone_num[3] = cont_num[4];
phone_num[4] = cont_num[5];
phone_num[5] = cont_num[6];
phone_num[6] = cont_num[8];
phone_num[7] = cont_num[9];
phone_num[8] = cont_num[10];
phone_num[9] = cont_num[11];
phone_num[10] = '\0';
Tuplet value = TupletCString(1, phone_num);
dict_write_tuplet(iter, &value);
int number = (int)(amount * 10);
dict_write_int(iter, 2, &number, sizeof(int), 0);
app_message_outbox_send();
break;
case 1:
amount = 0;
was_back = 1;
show_home();
break;
}
}
开发者ID:zsimpso,项目名称:Paybble,代码行数:34,代码来源:conf_pay.c
示例15: app_msg_RequestLatLong_internal
static bool app_msg_RequestLatLong_internal(void)
{
bool fMyRet = true;
#if TESTING_DISABLE_LOCATION_REQUEST
return true;
#endif
Tuplet fetch_tuple = TupletInteger(MSG_KEY_GET_LAT_LONG, 1);
DictionaryIterator *iter;
AppMessageResult amRet;
amRet = app_message_outbox_begin(&iter);
if (amRet != APP_MSG_OK)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "app_message_outbox_begin failed, ret = %04X", amRet);
return false;
}
if (iter == NULL)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "app_message_outbox_begin returned null iter");
return false;
}
DictionaryResult dRet;
dRet = dict_write_tuplet(iter, &fetch_tuple);
if (dRet != DICT_OK)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "dict_write_tuplet failed, ret = %04X", dRet);
fMyRet = false;
// fall through to call end anyway
}
unsigned uRet;
uRet = dict_write_end(iter);
if (uRet == 0)
{
fMyRet = false;
}
if (fMyRet)
{
amRet = app_message_outbox_send();
if (amRet != APP_MSG_OK)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "app_message_outbox_send failed, ret = %04X", amRet);
fMyRet = false;
}
}
return fMyRet;
} /* end of app_msg_RequestLatLong_internal(void) */
开发者ID:tilden,项目名称:pebble-sunclock,代码行数:59,代码来源:messaging.c
示例16: select_click_down_handler
/* This is called when the down button is clicked */
void select_click_down_handler(ClickRecognizerRef recognizer, void *context) {
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
int key = 0;
Tuplet value = TupletCString(key, "tmrw");
dict_write_tuplet(iter, &value);
app_message_outbox_send();
}
开发者ID:prohel,项目名称:pebbleHelloWorld,代码行数:9,代码来源:main.c
示例17: notifySpark
static void notifySpark(int sparkkey) {
Tuplet value = TupletInteger(KEY_NOTIFY,sparkkey);
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
dict_write_tuplet(iter,&value);
app_message_outbox_send();
}
开发者ID:modulusx,项目名称:headrest-for-pebble,代码行数:8,代码来源:main.c
示例18: setLED
static void setLED(int newLEDState) {
Tuplet value = TupletInteger(KEY_LED,newLEDState);
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
dict_write_tuplet(iter,&value);
app_message_outbox_send();
}
开发者ID:modulusx,项目名称:headrest-for-pebble,代码行数:8,代码来源:main.c
示例19: getListOfRoutes
void getListOfRoutes(char stopid[512], char stopname[512]) {
strncpy(currentstopid, stopid, sizeof(currentstopid));
strncpy(currentstopname, stopname, sizeof(currentstopname));
Tuplet get_routes_tuple = TupletInteger(DOUBLEMAP_GET_ROUTES, 1);
Tuplet stop_id_tuple = TupletCString(DOUBLEMAP_STOP_ID, stopid);
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
if (iter == NULL) {
return;
}
dict_write_tuplet(iter, &get_routes_tuple);
dict_write_tuplet(iter, &stop_id_tuple);
dict_write_end(iter);
app_message_outbox_send();
}
开发者ID:bdjett,项目名称:busETA,代码行数:17,代码来源:routelist.c
示例20: send_appmessage
static void send_appmessage(char* message) {
APP_LOG(APP_LOG_LEVEL_DEBUG, "Fetching stop time");
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
Tuplet value = TupletCString(ACTION, message);
dict_write_tuplet(iter, &value);
app_message_outbox_send();
}
开发者ID:jtewfik,项目名称:myBus,代码行数:8,代码来源:my_js_project.c
注:本文中的dict_write_tuplet函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论