/* * 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; import ISupplicantIface; import ISupplicantP2pIfaceCallback; /** * Interface exposed by the supplicant for each P2P mode network * interface (e.g p2p0) it controls. */ interface ISupplicantP2pIface extends ISupplicantIface { enum WpsProvisionMethod : uint32_t { /** * Push button method. */ PBC, /** * Display pin method configuration - pin is generated and displayed on * device. */ DISPLAY, /** * Keypad pin method configuration - pin is entered on device. */ KEYPAD }; /** * Use to specify a range of frequencies. * For example: 2412-2432,2462,5000-6000, etc. */ struct FreqRange { uint32_t min; uint32_t max; }; /** * Enum describing the modes of Miracast supported * via driver commands. */ enum MiracastMode : uint8_t { DISABLED = 0, /** * Operating as source. */ SOURCE = 1, /** * Operating as sink. */ SINK = 2 }; /** * Register for callbacks from this interface. * * These callbacks are invoked for events that are specific to this interface. * Registration of multiple callback objects is supported. These objects must * be automatically deleted when the corresponding client process is dead or * if this interface is removed. * * @param callback An instance of the |ISupplicantP2pIfaceCallback| HIDL * interface object. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ registerCallback(ISupplicantP2pIfaceCallback callback) generates (SupplicantStatus status); /** * Gets the MAC address of the device. * * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| * @return deviceAddress MAC address of the device. */ getDeviceAddress() generates (SupplicantStatus status, MacAddress deviceAddress); /** * Set the postfix to be used for P2P SSID's. * * @param postfix String to be appended to SSID. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_ARGS_INVALID|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ setSsidPostfix(vec<uint8_t> postfix) generates (SupplicantStatus status); /** * Set the Maximum idle time in seconds for P2P groups. * This value controls how long a P2P group is maintained after there * is no other members in the group. As a group owner, this means no * associated stations in the group. As a P2P client, this means no * group owner seen in scan results. * * @param groupIfName Group interface name to use. * @param timeoutInSec Timeout value in seconds. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ setGroupIdle(string groupIfName, uint32_t timeoutInSec) generates (SupplicantStatus status); /** * Turn on/off power save mode for the interface. * * @param groupIfName Group interface name to use. * @param enable Indicate if power save is to be turned on/off. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID|, * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| */ setPowerSave(string groupIfName, bool enable) generates (SupplicantStatus status); /** * Initiate a P2P service discovery with an optional timeout. * * @param timeoutInSec Max time to be spent is peforming discovery. * Set to 0 to indefinely continue discovery untill and explicit * |stopFind| is sent. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| */ find(uint32_t timeoutInSec) generates (SupplicantStatus status); /** * Stop an ongoing P2P service discovery. * * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| */ stopFind() generates (SupplicantStatus status); /** * Flush P2P peer table and state. * * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ flush() generates (SupplicantStatus status); /** * Start P2P group formation with a discovered P2P peer. This includes * optional group owner negotiation, group interface setup, provisioning, * and establishing data connection. * * @param peerAddress MAC address of the device to connect to. * @method provisionMethod Provisioning method to use. * @param preSelectedPin Pin to be used, if |provisionMethod| uses one of the * preselected |PIN*| methods. * @param joinExistingGroup Indicates that this is a command to join an * existing group as a client. It skips the group owner negotiation * part. This must send a Provision Discovery Request message to the * target group owner before associating for WPS provisioning. * @param persistent Used to request a persistent group to be formed. * @param goIntent Used to override the default Intent for this group owner * negotiation (Values from 1-15). Refer to section 4.1.6 in * Wi-Fi Peer-to-Peer (P2P) Technical Specification Version 1.7. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_ARGS_INVALID|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| * @return generatedPin Pin generated, if |provisionMethod| uses one of the * generated |PIN*| methods. */ connect(MacAddress peerAddress, WpsProvisionMethod provisionMethod, string preSelectedPin, bool joinExistingGroup, bool persistent, uint32_t goIntent) generates (SupplicantStatus status, string generatedPin); /** * Cancel an ongoing P2P group formation and joining-a-group related * operation. This operation unauthorizes the specific peer device (if any * had been authorized to start group formation), stops P2P find (if in * progress), stops pending operations for join-a-group, and removes the * P2P group interface (if one was used) that is in the WPS provisioning * step. If the WPS provisioning step has been completed, the group is not * terminated. * * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_NOT_STARTED|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ cancelConnect() generates (SupplicantStatus status); /** * Send P2P provision discovery request to the specified peer. The * parameters for this command are the P2P device address of the peer and the * desired configuration method. * * @param peerAddress MAC address of the device to send discovery. * @method provisionMethod Provisioning method to use. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ provisionDiscovery(MacAddress peerAddress, WpsProvisionMethod provisionMethod) generates (SupplicantStatus status); /** * Set up a P2P group owner manually (i.e., without group owner * negotiation with a specific peer). This is also known as autonomous * group owner. Optional |persistentNetworkId| may be used to specify * restart of a persistent group. * * @param persistent Used to request a persistent group to be formed. * @param persistentNetworkId Used to specify the restart of a persistent * group. Set to UINT32_MAX for a non-persistent group. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ addGroup(bool persistent, SupplicantNetworkId persistentNetworkId) generates (SupplicantStatus status); /** * Terminate a P2P group. If a new virtual network interface was used for * the group, it must also be removed. The network interface name of the * group interface is used as a parameter for this command. * * @param groupIfName Group interface name to use. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ removeGroup(string groupIfName) generates (SupplicantStatus status); /** * Reject connection attempt from a peer (specified with a device * address). This is a mechanism to reject a pending group owner negotiation * with a peer and request to automatically block any further connection or * discovery of the peer. * * @param peerAddress MAC address of the device to reject. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| * |SupplicantStatusCode.FAILURE_IFACE_DISABLED| */ reject(MacAddress peerAddress) generates (SupplicantStatus status); /** * Invite a device to a persistent group. * If the peer device is the group owner of the persistent group, the peer * parameter is not needed. Otherwise it is used to specify which * device to invite. |goDeviceAddress| parameter may be used to override * the group owner device address for Invitation Request should it not be * known for some reason (this should not be needed in most cases). * * @param groupIfName Group interface name to use. * @param goDeviceAddress MAC address of the group owner device. * @param peerAddress MAC address of the device to invite. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ invite(string groupIfName, MacAddress goDeviceAddress, MacAddress peerAddress) generates (SupplicantStatus status); /** * Reinvoke a device from a persistent group. * * @param persistentNetworkId Used to specify the persistent group. * @param peerAddress MAC address of the device to reinvoke. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ reinvoke(SupplicantNetworkId persistentNetworkId, MacAddress peerAddress) generates (SupplicantStatus status); /** * Configure Extended Listen Timing. * * If enabled, listen state must be entered every |intervalInMillis| for at * least |periodInMillis|. Both values have acceptable range of 1-65535 * (with interval obviously having to be larger than or equal to duration). * If the P2P module is not idle at the time the Extended Listen Timing * timeout occurs, the Listen State operation must be skipped. * * @param periodInMillis Period in milliseconds. * @param intervalInMillis Interval in milliseconds. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_ARGS_INVALID|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ configureExtListen(uint32_t periodInMillis, uint32_t intervalInMillis) generates (SupplicantStatus status); /** * Set P2P Listen channel. * * When specifying a social channel on the 2.4 GHz band (1/6/11) there is no * need to specify the operating class since it defaults to 81. When * specifying a social channel on the 60 GHz band (2), specify the 60 GHz * operating class (180). * * @param channel Wifi channel. eg, 1, 6, 11. * @param operatingClass Operating Class indicates the channel set of the AP * indicated by this BSSID * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ setListenChannel(uint32_t channel, uint32_t operatingClass) generates (SupplicantStatus status); /** * Set P2P disallowed frequency ranges. * * Specify ranges of frequencies that are disallowed for any p2p operations. * @param ranges List of ranges which needs to be disallowed. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ setDisallowedFrequencies(vec<FreqRange> ranges) generates (SupplicantStatus status); /** * Gets the operational SSID of the device. * * @param peerAddress MAC address of the peer. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| * @return ssid SSID of the device */ getSsid(MacAddress peerAddress) generates (SupplicantStatus status, Ssid ssid); /** * Gets the capability of the group which the device is a * member of. * * @param peerAddress MAC address of the peer. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| * @return capabilityMask Combination of |P2pGroupCapabilityMask| values. */ getGroupCapability(MacAddress peerAddress) generates (SupplicantStatus status, bitfield<P2pGroupCapabilityMask> capabilities); /** * This command can be used to add a bonjour service. * * @param query Hex dump of the query data. * @param return Hex dump of the response data. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ addBonjourService(vec<uint8_t> query, vec<uint8_t> response) generates (SupplicantStatus status); /** * This command can be used to remove a bonjour service. * * @param query Hex dump of the query data. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_NOT_STARTED|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ removeBonjourService(vec<uint8_t> query) generates (SupplicantStatus status); /** * This command can be used to add a UPNP service. * * @param version Version to be used. * @package serviceName Service name to be used. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ addUpnpService(uint32_t version, string serviceName) generates (SupplicantStatus status); /** * This command can be used to remove a UPNP service. * * @param version Version to be used. * @package serviceName Service name to be used. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_NOT_STARTED|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ removeUpnpService(uint32_t version, string serviceName) generates (SupplicantStatus status); /** * This command can be used to flush all services from the * device. * * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ flushServices() generates (SupplicantStatus status); /** * Schedule a P2P service discovery request. The parameters for this command * are the device address of the peer device (or 00:00:00:00:00:00 for * wildcard query that is sent to every discovered P2P peer that supports * service discovery) and P2P Service Query TLV(s) as hexdump. * * @param peerAddress MAC address of the device to discover. * @param query Hex dump of the query data. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| * @return identifier Identifier for the request. Can be used to cancel the * request. */ requestServiceDiscovery(MacAddress peerAddress, vec<uint8_t> query) generates (SupplicantStatus status, uint64_t identifier); /** * Cancel a previous service discovery request. * * @return identifier Identifier for the request to cancel. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_NOT_STARTED|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ cancelServiceDiscovery(uint64_t identifier) generates (SupplicantStatus status); /** * Send driver command to set Miracast mode. * * @param mode Mode of Miracast. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ setMiracastMode(MiracastMode mode) generates (SupplicantStatus status); /** * Initiate WPS Push Button setup. * The PBC operation requires that a button is also pressed at the * AP/Registrar at about the same time (2 minute window). * * @param groupIfName Group interface name to use. * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ startWpsPbc(string groupIfName, Bssid bssid) generates (SupplicantStatus status); /** * Initiate WPS Pin Keypad setup. * * @param groupIfName Group interface name to use. * @param pin 8 digit pin to be used. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ startWpsPinKeypad(string groupIfName, string pin) generates (SupplicantStatus status); /** * Initiate WPS Pin Display setup. * * @param groupIfName Group interface name to use. * @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| * @return generatedPin 8 digit pin generated. */ startWpsPinDisplay(string groupIfName, Bssid bssid) generates (SupplicantStatus status, string generatedPin); /** * Cancel any ongoing WPS operations. * * @param groupIfName Group interface name to use. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ cancelWps(string groupIfName) generates (SupplicantStatus status); /** * Enable/Disable Wifi Display. * * @param enable true to enable, false to disable. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ enableWfd(bool enable) generates (SupplicantStatus status); /** * Set Wifi Display device info. * * @param info WFD device info as described in section 5.1.2 of WFD technical * specification v1.0.0. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ setWfdDeviceInfo(uint8_t[6] info) generates (SupplicantStatus status); /** * Creates a NFC handover request message. * * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| * @return request Bytes representing the handover request as specified in * section 3.1.1 of NFC Connection Handover 1.2 Technical * Specification. */ createNfcHandoverRequestMessage() generates (SupplicantStatus status, vec<uint8_t> request); /** * Creates a NFC handover select message. * * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| * @return select Bytes representing the handover select as specified in * section 3.1.2 of NFC Connection Handover 1.2 Technical * Specification. */ createNfcHandoverSelectMessage() generates (SupplicantStatus status, vec<uint8_t> select); /** * Report the response of the NFC handover request. * * @param request Bytes representing the handover request as specified in * section 3.1.1 of NFC Connection Handover 1.2 Technical * Specification. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ reportNfcHandoverResponse(vec<uint8_t> request) generates (SupplicantStatus status); /** * Report the initiation of the NFC handover select. * * @param select Bytes representing the handover select as specified in * section 3.1.2 of NFC Connection Handover 1.2 Technical * Specification. * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ reportNfcHandoverInitiation(vec<uint8_t> select) generates (SupplicantStatus status); /** * Persist the current configuration to disk. * * @return status Status of the operation. * Possible status codes: * |SupplicantStatusCode.SUCCESS|, * |SupplicantStatusCode.FAILURE_UNKNOWN|, * |SupplicantStatusCode.FAILURE_IFACE_INVALID| */ saveConfig() generates (SupplicantStatus status); };