/*
 * Copyright 2016 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.wifi.supplicant@1.0;

/**
 * Interface exposed by the supplicant for each network configuration it
 * controls.
 * A network is the supplicant's way of representing the configuration
 * parameters of a Wifi service set. Service sets are identified by their
 * service set identitifier (SSID). The parameters for a network includes the
 * credentials, bssid, etc.
 */
interface ISupplicantNetwork {
  /**
   * Retrieves the ID allocated to this network by the supplicant.
   *
   * This is not the |SSID| of the network, but an internal identifier for
   * this network used by the supplicant.
   *
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
   * @return id Network ID.
   */
  getId() generates (SupplicantStatus status, SupplicantNetworkId id);

  /**
   * Retrieves the name of the interface this network belongs to.
   *
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
   * @return Name of the network interface, e.g., wlan0
   */
  getInterfaceName() generates (SupplicantStatus status, string name);

  /**
   * Retrieves the type of the interface this network belongs to.
   *
   * @return status Status of the operation.
   *         Possible status codes:
   *         |SupplicantStatusCode.SUCCESS|,
   *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
   * @return type Type of the network interface, e.g., STA.
   */
  getType() generates (SupplicantStatus status, IfaceType type);
};
