我正在研究 Pebble 表盘,但遇到了问题,函数 app_message_outbox_send 似乎抛出了一个错误(然后我的应用程序崩溃了)。错误是“[INFO] E call_internal.c:36 系统调用失败!0..0x8 不在应用程序空间中。”
相关代码:
static void askPhoneForCharge(){
if(bluetooth_connection_service_peek()){
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
dict_write_uint8(iter, KEY_PHONE_ASK, 0);
app_message_outbox_send();
}else{
phoneCharging = 0;
phoneCharge = 0;
updatePhoneBattery();
}
}
以下是我如何设置处理程序并打开通道:
app_message_register_inbox_received(inboxReceivedCallback);
app_message_register_inbox_dropped(inboxDroppedCallback);
app_message_register_outbox_failed(outboxFailedCallback);
app_message_register_outbox_sent(outboxSentCallback);
app_message_open(app_message_inbox_size_maximum(), app_message_outbox_size_maximum());