aboutsummaryrefslogtreecommitdiff
path: root/wpa_supplicant/aidl/p2p_iface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'wpa_supplicant/aidl/p2p_iface.cpp')
-rw-r--r--wpa_supplicant/aidl/p2p_iface.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/wpa_supplicant/aidl/p2p_iface.cpp b/wpa_supplicant/aidl/p2p_iface.cpp
index 33db802d..ec52b440 100644
--- a/wpa_supplicant/aidl/p2p_iface.cpp
+++ b/wpa_supplicant/aidl/p2p_iface.cpp
@@ -815,6 +815,21 @@ ndk::ScopedAStatus P2pIface::addGroup(
in_ipAddressGo, in_ipAddressMask, in_ipAddressStart, in_ipAddressEnd);
}
+::ndk::ScopedAStatus P2pIface::connectWithParams(
+ const P2pConnectInfo& in_connectInfo, std::string* _aidl_return)
+{
+ return validateAndCall(
+ this, SupplicantStatusCode::FAILURE_IFACE_INVALID,
+ &P2pIface::connectWithParamsInternal, _aidl_return, in_connectInfo);
+}
+
+::ndk::ScopedAStatus P2pIface::findWithParams(const P2pDiscoveryInfo& in_discoveryInfo)
+{
+ return validateAndCall(
+ this, SupplicantStatusCode::FAILURE_IFACE_INVALID,
+ &P2pIface::findWithParamsInternal, in_discoveryInfo);
+}
+
std::pair<std::string, ndk::ScopedAStatus> P2pIface::getNameInternal()
{
return {ifname_, ndk::ScopedAStatus::ok()};
@@ -1852,6 +1867,33 @@ ndk::ScopedAStatus P2pIface::configureEapolIpAddressAllocationParamsInternal(
return ndk::ScopedAStatus::ok();
}
+std::pair<std::string, ndk::ScopedAStatus> P2pIface::connectWithParamsInternal(
+ const P2pConnectInfo& connectInfo)
+{
+ std::vector<uint8_t> peerAddressVec {
+ connectInfo.peerAddress.begin(), connectInfo.peerAddress.end()};
+ return connectInternal(peerAddressVec, connectInfo.provisionMethod,
+ connectInfo.preSelectedPin, connectInfo.joinExistingGroup,
+ connectInfo.persistent, connectInfo.goIntent);
+}
+
+ndk::ScopedAStatus P2pIface::findWithParamsInternal(const P2pDiscoveryInfo& discoveryInfo)
+{
+ switch (discoveryInfo.scanType) {
+ case P2pScanType::FULL:
+ return findInternal(discoveryInfo.timeoutInSec);
+ case P2pScanType::SOCIAL:
+ return findOnSocialChannelsInternal(discoveryInfo.timeoutInSec);
+ case P2pScanType::SPECIFIC_FREQ:
+ return findOnSpecificFrequencyInternal(
+ discoveryInfo.frequencyMhz, discoveryInfo.timeoutInSec);
+ default:
+ wpa_printf(MSG_DEBUG,
+ "findWithParams received invalid scan type %d", discoveryInfo.scanType);
+ return createStatus(SupplicantStatusCode::FAILURE_ARGS_INVALID);
+ }
+}
+
/**
* Retrieve the underlying |wpa_supplicant| struct
* pointer for this iface.