/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.usb.gadget@1.0;

interface IUsbGadgetCallback {
    /**
     * Callback function used to propagate the status of configuration
     * switch to the caller.
     *
     * @param functions list of functions defined by GadgetFunction
     *                  included in the current USB gadget composition.
     * @param status SUCCESS when the functions are applied.
     *               FUNCTIONS_NOT_SUPPORTED when the configuration is
     *                                       not supported.
     *               ERROR otherwise.
     */
    oneway setCurrentUsbFunctionsCb(bitfield<GadgetFunction> functions,
                                    Status status);

    /**
     * Callback function used to propagate the current USB gadget
     * configuration.
     * @param functions list of functions defined by GadgetFunction
     *                  included in the current USB gadget composition.
     * @param status FUNCTIONS_APPLIED when list of functions have been
     *                                 applied.
     *               FUNCTIONS_NOT_APPLIED when the functions have not
     *                                     been applied.
     *               ERROR otherwise.
     */
    oneway getCurrentUsbFunctionsCb(bitfield<GadgetFunction> functions,
                                    Status status);
};
