supplicant(interface): Add P2P iface methods/cbs
Add the missing P2P iface methods and callbacks.
Bug: 34221586
Test: Compiles
Change-Id: I9bace8ac5304dd65d81bb255dac023657c9460cc
diff --git a/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal b/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal
index 9ac8b36..0731209 100644
--- a/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal
+++ b/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal
@@ -26,6 +26,70 @@
*/
interface ISupplicantP2pIfaceCallback {
/**
+ * WPS config methods.
+ */
+ enum WpsConfigMethods : uint16_t {
+ USBA = 0x0001,
+ ETHERNET = 0x0002,
+ LABEL = 0x0004,
+ DISPLAY = 0x0008,
+ EXT_NFC_TOKEN = 0x0010,
+ INT_NFC_TOKEN = 0x0020,
+ NFC_INTERFACE = 0x0040,
+ PUSHBUTTON = 0x0080,
+ KEYPAD = 0x0100,
+ VIRT_PUSHBUTTON = 0x0280,
+ PHY_PUSHBUTTON = 0x0480,
+ P2PS = 0x1000,
+ VIRT_DISPLAY = 0x2008,
+ PHY_DISPLAY = 0x4008
+ };
+
+ /**
+ * WPS Device Password ID
+ */
+ enum WpsDevPasswordId : uint16_t {
+ DEFAULT = 0x0000,
+ USER_SPECIFIED = 0x0001,
+ MACHINE_SPECIFIED = 0x0002,
+ REKEY = 0x0003,
+ PUSHBUTTON = 0x0004,
+ REGISTRAR_SPECIFIED = 0x0005,
+ NFC_CONNECTION_HANDOVER = 0x0007,
+ P2PS_DEFAULT = 0x0008
+ };
+
+ /**
+ * Status codes for P2P operations.
+ */
+ enum P2pStatusCode : uint32_t {
+ SUCCESS = 0,
+ FAIL_INFO_CURRENTLY_UNAVAILABLE = 1,
+ FAIL_INCOMPATIBLE_PARAMS = 2,
+ FAIL_LIMIT_REACHED = 3,
+ FAIL_INVALID_PARAMS = 4,
+ FAIL_UNABLE_TO_ACCOMMODATE = 5,
+ FAIL_PREV_PROTOCOL_ERROR = 6,
+ FAIL_NO_COMMON_CHANNELS = 7,
+ FAIL_UNKNOWN_GROUP = 8,
+ FAIL_BOTH_GO_INTENT_15 = 9,
+ FAIL_INCOMPATIBLE_PROV_METHOD = 10,
+ FAIL_REJECTED_BY_USER = 11,
+ SUCCESS_DEFERRED = 12,
+ };
+
+ /**
+ * Status codes for P2P discovery.
+ */
+ enum P2pProvDiscStatusCode : uint8_t {
+ SUCCESS = 0,
+ TIMEOUT = 1,
+ REJECTED = 2,
+ TIMEOUT_JOIN = 3,
+ INFO_UNAVAILABLE = 4
+ };
+
+ /**
* Used to indicate that a new network has been added.
*
* @param id Network ID allocated to the corresponding network.
@@ -38,4 +102,192 @@
* @param id Network ID allocated to the corresponding network.
*/
oneway onNetworkRemoved(SupplicantNetworkId id);
+
+ /**
+ * Used to indicate that a P2P device has been found.
+ *
+ * @param srcAddress MAC address of the device found. This must either
+ * be the P2P device address or the P2P interface address.
+ * @param p2pDeviceAddress P2P device address.
+ * @param primaryDeviceType Type of device. Refer to section B.1 of Wifi P2P
+ * Technical specification v1.2.
+ * @param deviceName Name of the device.
+ * @param configMethods Mask of WPS configuration methods supported by the
+ * device.
+ * @param deviceCapabilities Refer to section 4.1.4 of Wifi P2P Technical
+ * specification v1.2.
+ * @param groupCapabilites Refer to section 4.1.4 of Wifi P2P Technical
+ * specification v1.2.
+ * @param wfdDeviceInfo WFD device info as described in section 5.1.2 of WFD
+ * technical specification v1.0.0.
+ */
+ oneway onDeviceFound(
+ MacAddress srcAddress, MacAddress p2pDeviceAddress,
+ uint8_t[8] primaryDeviceType, string deviceName,
+ bitfield<WpsConfigMethods> configMethods, uint8_t deviceCapabilities,
+ bitfield<P2pGroupCapabilityMask> groupCapabilities, uint8_t[8] wfdDeviceInfo);
+
+ /**
+ * Used to indicate that a P2P device has been lost.
+ *
+ * @param p2pDeviceAddress P2P device address.
+ */
+ oneway onDeviceLost(MacAddress p2pDeviceAddress);
+
+ /**
+ * Used to indicate the termination of P2P find operation.
+ */
+ oneway onFindStopped();
+
+ /**
+ * Used to indicate the reception of a P2P Group Owner negotiation request.
+ *
+ * @param srcAddress MAC address of the device that initiated the GO
+ * negotiation request.
+ * @param passwordId Type of password.
+ */
+ oneway onGoNegotiationRequest(
+ MacAddress srcAddress, WpsDevPasswordId passwordId);
+
+ /**
+ * Used to indicate the completion of a P2P Group Owner negotiation request.
+ *
+ * @param status Status of the GO negotiation.
+ */
+ oneway onGoNegotiationCompleted(P2pStatusCode status);
+
+ /**
+ * Used to indicate a successful formation of a P2P group.
+ */
+ oneway onGroupFormationSuccess();
+
+ /**
+ * Used to indicate a failure to form a P2P group.
+ *
+ * @param failureReason Failure reason string for debug purposes.
+ */
+ oneway onGroupFormationFailure(string failureReason);
+
+ /**
+ * Used to indicate the start of a P2P group.
+ *
+ * @param groupIfName Interface name of the group. (For ex: p2p-p2p0-1)
+ * @param isGo Whether this device is owner of the group.
+ * @param ssid SSID of the group.
+ * @param frequency Frequency on which this group is created.
+ * @param psk PSK used to secure the group.
+ * @param passphrase PSK passphrase used to secure the group.
+ * @param goDeviceAddress MAC Address of the owner of this group.
+ * @param isPersistent Whether this group is persisted or not.
+ */
+ oneway onGroupStarted(
+ string groupIfname, bool isGo, Ssid ssid, uint32_t frequency,
+ uint8_t[32] psk, string passphrase, MacAddress goDeviceAddress,
+ bool isPersistent);
+
+ /**
+ * Used to indicate the removal of a P2P group.
+ *
+ * @param groupIfName Interface name of the group. (For ex: p2p-p2p0-1)
+ * @param isGo Whether this device is owner of the group.
+ */
+ oneway onGroupRemoved(string groupIfname, bool isGo);
+
+ /**
+ * Used to indicate the reception of a P2P invitation.
+ *
+ * @param srcAddress MAC address of the device that sent the invitation.
+ * @param goDeviceAddress MAC Address of the owner of this group.
+ * @param Bssid Bssid of the group.
+ * @param persistentNetworkId Persistent network Id of the group.
+ * @param operatingFrequency Frequency on which the invitation was received.
+ */
+ oneway onInvitationReceived(
+ MacAddress srcAddress, MacAddress goDeviceAddress, Bssid bssid,
+ SupplicantNetworkId persistentNetworkId, uint32_t operatingFrequency);
+
+ /**
+ * Used to indicate the result of the P2P invitation request.
+ *
+ * @param Bssid Bssid of the group.
+ * @param status Status of the invitation.
+ */
+ oneway onInvitationResult(Bssid bssid, P2pStatusCode status);
+
+ /**
+ * Used to indicate a push-button request generated during provision discovery.
+ *
+ * @param p2pDeviceAddress P2P device address.
+ */
+ oneway onProvisionDiscoveryPbcRequest(MacAddress p2pDeviceAddress);
+
+ /**
+ * Used to indicate a push-button response generated during provision discovery.
+ *
+ * @param p2pDeviceAddress P2P device address.
+ */
+ oneway onProvisionDiscoveryPbcResponse(MacAddress p2pDeviceAddress);
+
+ /**
+ * Used to indicate the pin generated during provision discovery.
+ *
+ * @param p2pDeviceAddress P2P device address.
+ * @param generatedPin 8 digit pin generated.
+ */
+ oneway onProvisionDiscoveryShowPin(
+ MacAddress p2pDeviceAddress, string generatedPin);
+
+ /**
+ * Used to indicate that a pin needs to be entered during provision discovery.
+ *
+ * @param p2pDeviceAddress P2P device address.
+ */
+ oneway onProvisionDiscoveryEnterPin(MacAddress p2pDeviceAddress);
+
+ /**
+ * Used to indicate a provision discovery failure.
+ *
+ * @param p2pDeviceAddress P2P device address.
+ */
+ oneway onProvisionDiscoveryFailure(MacAddress p2pDeviceAddress);
+
+ /**
+ * Used to indicate the completion of a P2P provision discovery request.
+ *
+ * @param p2pDeviceAddress P2P device address.
+ * @param isRequest Whether we received or sent the provision discovery.
+ * @param status Status of the provision discovery.
+ * @param configMethods Mask of WPS configuration methods supported.
+ * @param generatedPin 8 digit pin generated.
+ */
+ oneway onProvisionDiscoveryCompleted(
+ MacAddress p2pDeviceAddress, bool isRequest, P2pProvDiscStatusCode status,
+ bitfield<WpsConfigMethods> configMethods, string generatedPin);
+
+ /**
+ * Used to indicate the reception of a P2P service discovery response.
+ *
+ * @param srcAddress MAC address of the device that sent the service discovery.
+ * @param updateIndicator Service update indicator. Refer to section 3.1.3 of
+ * Wifi P2P Technical specification v1.2.
+ * @parm tlvs Refer to section 3.1.3.1 of Wifi P2P Technical specification v1.2.
+ */
+ oneway onServiceDiscoveryResponse(
+ MacAddress srcAddress, uint16_t updateIndicator, vec<uint8_t> tlvs);
+
+ /**
+ * Used to indicate when a STA device is connected to this device.
+ *
+ * @param srcAddress MAC address of the device that was authorized.
+ * @param p2pDeviceAddress P2P device address.
+ */
+ oneway onStaAuthorized(MacAddress srcAddress, MacAddress p2pDeviceAddress);
+
+ /**
+ * Used to indicate when a STA device is disconnected from this device.
+ *
+ * @param srcAddress MAC address of the device that was deauthorized.
+ * @param p2pDeviceAddress P2P device address.
+ */
+ oneway onStaDeauthorized(MacAddress srcAddress, MacAddress p2pDeviceAddress);
};