/*!
 @brief deleteメソッド,DeviceOrientationプロファイルのメッセージを処理する.

 @param[in] received 受信したメッセージ
 @param[in] iter レスポンスを格納するイテレータ

 */
static void in_received_delete_device_orientation_handler(DictionaryIterator *received) {

    Tuple *attributeTuple = dict_find(received, KEY_ATTRIBUTE);
    switch (attributeTuple->value->uint8) {
    case DEVICE_ORIENTATION_ATTRIBUTE_ON_DEVICE_ORIENTATION:
        accel_data_service_unsubscribe();
        pebble_sniff_interval_reduced();
        break;
    default:
        // not support
        entry_log( "not support", "orientation" ) ;
        pebble_set_error_code(ERROR_NOT_SUPPORT_ATTRIBUTE);
        break;
    }
}
示例#2
0
/*!
 @brief deleteメソッド,eventsプロファイルのメッセージを処理する.

 @param[in] received 受信したメッセージ
 @param[in] iter レスポンスを格納するイテレータ

 */
static void in_received_delete_event_handler(DictionaryIterator *received, DictionaryIterator *iter) {
    DBG_LOG(APP_LOG_LEVEL_DEBUG, "in_received_delete_event_handler");

    Tuple *attributeTuple = dict_find(received, KEY_ATTRIBUTE);
    switch (attributeTuple->value->uint8) {
    case SYSTEM_ATTRIBUTE_EVENTS:
        entry_log( "delete", "system/events" ) ;
        battery_service_unsubscribe_force() ;
        orientation_service_unsubscribe_force();
        pebble_sniff_interval_reduced();
        return ;
    default:
        entry_log( "error", "system/events?");
        pebble_set_error_code(iter, ERROR_NOT_SUPPORT_ATTRIBUTE);
        break;
    }
}