We do have some service discovery extensions to the demo app that will go as part of the training tutorials on the developer site.There is also service discovery code as part of CtsVerifier appOn Thu, Jul 19, 2012 at 1:26 AM, kh <android....@gmail.com> wrote:Hi,
Android 4.1 supports service discovery and to register service.
But the APIs are not clear to me. Please clarify. Is there any example code like Wifidemo in the previous Android versions ?public void addLocalService (WifiP2pManager.Channel c, WifiP2pServiceInfo servInfo, WifiP2pManager.ActionListener listener)
==> not clear how to set servInfo variable.public void addServiceRequest (WifiP2pManager.Channel c, WifiP2pServiceRequest req, WifiP2pManager.ActionListener listener)
===> WifP2pServiceRequest talks about "String queryData". How do we use this in conjunction with addLocalService ?
An example code for service discovery and service advertisement will help. I was looking for vendor specific service.
thanks.
On Sunday, February 12, 2012 3:20:16 PM UTC+9, Irfan Sheriff wrote:On Tue, Jan 31, 2012 at 3:51 PM, Prem Kumar <prem...@gmail.com> wrote:Hi,
I have the WFD demo program working with a couple retail Galaxy
Nexus's running 4.0.2. I started playing around with a few new API's
and have a few basic questions at the end of this mail.
I created a group owner using WifiP2pManager.createGroup(). After the
group was successfully created, I requested for group info using
requestGroupInfo(channel, groupInfoListener). After the
GroupInfoListener method onGroupInfoAvailable(WifiP2pGroup group) was
called, I printed out all the group and device info per the source
code below:
private class WfDGroupInfoListener implements GroupInfoListener {
@Override
public void onGroupInfoAvailable(WifiP2pGroup group) {
if (group != null) {
Log.d(TAG, "-----Group Info-----");
Log.d(TAG, "SSID: " + group.getNetworkName());
Log.d(TAG, "Address: " + group.getInterface());
Log.d(TAG, "Passphrase: " + group.getPassphrase());
WifiP2pDevice p2pDevice = group.getOwner();
Log.d(TAG, "serviceDiscoveryCapable: " +
((p2pDevice.isServiceDiscoveryCapable()) ? true : false));
Log.d(TAG, "wpsDisplaySupported: " +
((p2pDevice.wpsDisplaySupported()) ? true : false));
Log.d(TAG, "wpsKeypadSupported: " +
((p2pDevice.wpsKeypadSupported()) ? true : false));
Log.d(TAG, "wpsPbcSupported: " +
((p2pDevice.wpsPbcSupported()) ? true : false));
} else {
Log.d(TAG, "group is NULL");
}
}
}
My debug log contains:
01-30 15:59:37.879: D/WfdTest(1913): -----Group Info-----
01-30 15:59:37.879: D/WfdTest(1913): SSID: "DIRECT-fd"
01-30 15:59:37.879: D/WfdTest(1913): Address: p2p-wlan0-0
01-30 15:59:37.879: D/WfdTest(1913): Passphrase: "KhHm7U0w"
01-30 15:59:37.879: D/WfdTest(1913): serviceDiscoveryCapable: false
01-30 15:59:37.879: D/WfdTest(1913): wpsDisplaySupported: false
01-30 15:59:37.879: D/WfdTest(1913): wpsKeypadSupported: false
01-30 15:59:37.879: D/WfdTest(1913): wpsPbcSupported: false
My basic questions are:
1. Why do all the WPS and Service Discovery options return false?
2. How can service discovery be initiated by an application? The
Android WFD API doc has a vague mention of "Android has no platform
support for service discovery yet, so applications could run a service
discovery protocol to discover services on the peer-to-peer
network.". The Wifi P2P spec allows for (optional) Service Discovery
using GAS frames but not sure how they can be initiated using the SDK
prior to getting an IP?
3. How can a specific WPS configuration like PIN or PBC be configured
for the group owner (acting as a standalone registrar)?Pre-association service discovery is not supported yet. As for WPS settings onthe GO, it should support all forms and there is no way to restrict it to be PIN orPBC alone.
4. How can a WFD client/enrollee be configured to use PIN or PBC to
connect to the GO?The WifiP2pManager connect() API accepts a WifiP2pConfig which allows you to specify WPS5. Is there a way to force the GO to be on a specific Wifi Channel
(P2P spec v1.1 section 3.1.4.2.1 allows for a "preferred Operating
Channel"?Not supported yet
6. Is there a way to chose a specific SSID (P2P spec v1.2 section
3.2.1 says "Any byte values allowed for an SSID according to
IEEE802.11-2007 [1] may be included after the string --DIRECT-xy||
(including none)")?No
--
You received this message because you are subscribed to the Google Groups "android-platform" group.To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
--To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/G-8wk8YHBzoJ.
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
Hi,
I have a similar question.
When two devices try to connect through Wi Fi, we get a popup with Accept/Decline.
Is it possible to remove this pop up so that the 2 devices connect automatically ?
thanks.
4. How can a WFD client/enrollee be configured to use PIN or PBC to
connect to the GO?
5. Is there a way to force the GO to be on a specific Wifi Channel
(P2P spec v1.1 section 3.1.4.2.1 allows for a "preferred Operating
Channel"?
6. Is there a way to chose a specific SSID (P2P spec v1.2 section
3.2.1 says "Any byte values allowed for an SSID according to
IEEE802.11-2007 [1] may be included after the string --DIRECT-xy||
(including none)")?
6. Is there a way to chose a specific SSID (P2P spec v1.2 section
3.2.1 says "Any byte values allowed for an SSID according to
IEEE802.11-2007 [1] may be included after the string --DIRECT-xy||
(including none)")?No
To post to this group, send email to android-platform@googlegroups.com.
To unsubscribe from this group, send email to android-platform+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-platform@googlegroups.com.
To unsubscribe from this group, send email to android-platform+unsubscribe@googlegroups.com.
To post to this group, send email to android-platform@googlegroups.com.
To unsubscribe from this group, send email to android-platform+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-platform@googlegroups.com.
To unsubscribe from this group, send email to android-platform+unsubscribe@googlegroups.com.
To post to this group, send email to android-platform@googlegroups.com.
To unsubscribe from this group, send email to android-platform+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-platform@googlegroups.com.
To unsubscribe from this group, send email to android-platform+unsubscribe@googlegroups.com.
To post to this group, send email to android-platform@googlegroups.com.
To unsubscribe from this group, send email to android-platform+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-platform@googlegroups.com.
To unsubscribe from this group, send email to android-platform+unsubscribe@googlegroups.com.
I also have been playing with wifi direct but it crashed my phone
really often so I stopped trying. It crashed the Galaxy Nexus with
4.0.1, 4.0.2 and AOSP 4.0.3.
Were there changes in 4.0.4? Should I try again with 4.0.4?
Regards,
Dirk
> --
> You received this message because you are subscribed to the Google Groups "android-platform" group.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
>
--
Narseo
Hi,
I have a similar question.
When two devices try to connect through Wi Fi, we get a popup with Accept/Decline.
Is it possible to remove this pop up so that the 2 devices connect automatically ?
thanks.
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/ECBT0pXHmEkJ.
To post to this group, send email to android-platform@googlegroups.com.
To unsubscribe from this group, send email to android-platform+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/G-8wk8YHBzoJ.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
I am trying to develop an app which connects two android devices using wi-fi direct. I am referring the sample project in the Android SDK 17 called "WiFiDirectDemo". It establishes a Wi-Fi Direct connection but it does not have PIN authentication. I don't know how to configure the config.wps.setup in the class DeviceDetailFragment. How can I find out the connection request on the other device, is there any callback for that ? I tried adding following lines in the demo code (inside DeviceDetailFragment.java file) but still it connects without showing any dialog : Do i need to modify any thing else apart from these two line ? config.wps.setup = WpsInfo.DISPLAY; config.wps.pin = "0000"; or config.wps.setup = WpsInfo.KEYPAD; config.wps.pin = "0000"; Thanks for any leads. |
/**
* Initiates a connection to a service
* @param service The service to connect to
*/
public void initiateConnectToService(DnsSdService service) {
// Device info of peer to connect to
WifiP2pConfig wifiP2pConfig = new WifiP2pConfig();
wifiP2pConfig.deviceAddress = service.getSrcDevice().deviceAddress;
wifiP2pConfig.wps.setup = WpsInfo.PBC;
// Starts a peer-to-peer connection with a device with the specified configuration
wifiP2pManager.connect(channel, wifiP2pConfig, new WifiP2pManager.ActionListener() {
// The ActionListener only notifies that initiation of connection has succeeded or failed
@Override
public void onSuccess() {
Log.i(TAG, "Initiating connection to service");
}
@Override
public void onFailure(int reason) {
Log.e(TAG, "Failure initiating connection to service: " + FailureReason.fromInteger(reason).toString());
}
});
}