<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Arend,<div>first of all thank you for your time.</div><div>I' m going to try to give you a summary of what I want to do.</div><div><br></div><div>I want to develop an app which implements WiFi Direct Protocol.</div><div>In particular I need to be sure that it performs GO Negotiation procedure correctly.</div><div>According to what android guide says, if I want that a device (D1) starts a connection with another device (D2), </div><div>D1 has to call connect() method.</div><div>This method admits as parameter an object called config.</div><div>config contains 3 fields:</div><div><ul><li><span style="color: rgb(34, 34, 34); line-height: 19px; background-color: rgb(247, 247, 247);"><font face="Calibri" style="font-size: 12pt;" size="3">The device MAC address that uniquely identifies a Wi-Fi p2p device to connect to (in my example it will be MAC of D2)</font></span></li><li>groupOwnerIntent of D1 (since it is starting the connection)</li><li>wps info of D1 (since it is starting the connection)</li></ul>After that android will use WifiNative class to send the command to wpa_supplicant.</div><div>Now, wpa_supplicant takes charge of building the GO negotiation request to send it to D2. </div><div><br></div><div>Which is the behaviour of D2 after receiving D1 GO negotiation request?</div><div><br></div><div>In my app I've tried to instantiate a <span style="font-size: 12pt;">config</span><span style="font-size: 12pt;"> object containing GO intent of D2, but D1 becames always GO, even if GO intent of D2 is greater than D1 one.</span></div><div><span style="font-size: 12pt;"><br></span></div><div><span style="font-size: 12pt;"><br></span></div><div>Thanks </div><div>Andrea</div><div><br><div>> Date: Thu, 15 May 2014 21:27:28 +0200<br>> From: arend@broadcom.com<br>> To: andrea.chittano@hotmail.it<br>> CC: moon.linux@yahoo.com; hostap@lists.shmoo.com<br>> Subject: Re: Wifi Direct GO Negotiation<br>> <br>> On 05/15/14 18:25, Andrea Chittano wrote:<br>> > Sorry guys for my inexperience, but this thing are driving me mad.<br>> ><br>> > Tell me if i'm wrong.<br>> > Does the function at line 525 of the following link<br>> ><br>> > http://code.metager.de/source/xref/hostapd-wpa_supplicant/src/p2p/p2p_go_neg.c?r=0e0e1e564f3dd8d2a6b645d079b46eba0acc7f83<br>> ><br>> > that is<br>> ><br>> > *void* p2p_process_go_neg_req <http://code.metager.de/source/s?defs=p2p_process_go_neg_req&project=hostapd-wpa_supplicant>(*struct* p2p_data <http://code.metager.de/source/s?defs=p2p_data&project=hostapd-wpa_supplicant> *p2p <http://code.metager.de/source/s?defs=p2p&project=hostapd-wpa_supplicant>,*const* u8 <http://code.metager.de/source/s?defs=u8&project=hostapd-wpa_supplicant> *sa <http://code.metager.de/source/s?defs=sa&project=hostapd-wpa_supplicant>,<br>> >                         *const* u8 <http://code.metager.de/source/s?defs=u8&project=hostapd-wpa_supplicant> *data <http://code.metager.de/source/s?defs=data&project=hostapd-wpa_supplicant>,size_t <http://code.metager.de/source/s?defs=size_t&project=hostapd-wpa_supplicant> len <http://code.metager.de/source/s?defs=len&project=hostapd-wpa_supplicant>,*int* rx_freq <http://code.metager.de/source/s?defs=rx_freq&project=hostapd-wpa_supplicant>)<br>> ><br>> ><br>> > represent the processing (performed by Device2) of the GO negotiation<br>> > request that Device1 sent Device2?<br>> ><br>> > This function performs at line 687<br>> ><br>> > p2p_go_det <http://code.metager.de/source/s?refs=p2p_go_det&project=hostapd-wpa_supplicant>(p2p <http://code.metager.de/source/s?defs=p2p&project=hostapd-wpa_supplicant>->go_intent <http://code.metager.de/source/s?defs=go_intent&project=hostapd-wpa_supplicant>, *msg <http://code.metager.de/source/s?defs=msg&project=hostapd-wpa_supplicant>.go_inten <http://code.metager.de/source/s?defs=go_intent&project=hostapd-wpa_supplicant>t)<br>> ><br>> ><br>> > which returns the highest GO intent between local GO intent and received<br>> > one.<br>> > If I'm not wrong, according to what Arend told me Device2 get local GO<br>> > intent from wpa_supplicant configuration file. But I've found only one<br>> > way to set the local GO intent and it is here :<br>> ><br>> > http://code.metager.de/source/xref/hostapd-wpa_supplicant/src/p2p/p2p.c<br>> ><br>> > at line 1387, into the function<br>> ><br>> > *int* p2p_connect <http://code.metager.de/source/s?refs=p2p_connect&project=hostapd-wpa_supplicant>(*struct* p2p_data <http://code.metager.de/source/s?defs=p2p_data&project=hostapd-wpa_supplicant> *p2p <http://code.metager.de/source/s?refs=p2p&project=hostapd-wpa_supplicant>,*const* u8 <http://code.metager.de/source/s?defs=u8&project=hostapd-wpa_supplicant> *peer_addr <http://code.metager.de/source/s?refs=peer_addr&project=hostapd-wpa_supplicant>,<br>> >                 *enum* p2p_wps_method <http://code.metager.de/source/s?defs=p2p_wps_method&project=hostapd-wpa_supplicant> wps_method <http://code.metager.de/source/s?defs=wps_method&project=hostapd-wpa_supplicant>,<br>> >                 *int* go_intent <http://code.metager.de/source/s?defs=go_intent&project=hostapd-wpa_supplicant>,*const* u8 <http://code.metager.de/source/s?defs=u8&project=hostapd-wpa_supplicant> *own_interface_addr <http://code.metager.de/source/s?defs=own_interface_addr&project=hostapd-wpa_supplicant>,<br>> >                 *unsigned* *int* force_freq <http://code.metager.de/source/s?defs=force_freq&project=hostapd-wpa_supplicant>,*int* persistent_group <http://code.metager.de/source/s?defs=persistent_group&project=hostapd-wpa_supplicant>,<br>> >                 *const* u8 <http://code.metager.de/source/s?defs=u8&project=hostapd-wpa_supplicant> *force_ssid <http://code.metager.de/source/s?defs=force_ssid&project=hostapd-wpa_supplicant>,size_t <http://code.metager.de/source/s?defs=size_t&project=hostapd-wpa_supplicant> force_ssid_len <http://code.metager.de/source/s?defs=force_ssid_len&project=hostapd-wpa_supplicant>,<br>> >                 *int* pd_before_go_neg <http://code.metager.de/source/xref/hostapd-wpa_supplicant/src/p2p/p2p.c#pd_before_go_neg>,*unsigned* *int* pref_freq <http://code.metager.de/source/s?defs=pref_freq&project=hostapd-wpa_supplicant>,u16 <http://code.metager.de/source/s?defs=u16&project=hostapd-wpa_supplicant> oob_pw_id <http://code.metager.de/source/s?defs=oob_pw_id&project=hostapd-wpa_supplicant>)<br>> ><br>> ><br>> ><br>> ><br>> ><br>> > According to what specifications say, it is used to start a GO negotiation.<br>> > So my question is, how can I set the local GO intent for Device2 without<br>> > using p2p_connect() function?<br>> > I would make it by means of an android application. Can I do this?<br>> <br>> Maybe it would help to give some high-level information on what you are <br>> trying to do. I am not familiar with Android solution, but most likely <br>> Android provides an API for applications that is handled by their <br>> framework/middleware to get it in wpa_supplicant (see [1]).<br>> <br>> Regards,<br>> Arend<br>> <br>> [1] http://developer.android.com/guide/topics/connectivity/wifip2p.html<br>> <br>> > Thanks for your help.<br>> > Andrea<br>> ><br>> ><br>> > > Date: Wed, 14 May 2014 10:21:56 -0700<br>> > > From: moon.linux@yahoo.com<br>> > > Subject: Re: Wifi Direct GO Negotiation<br>> > > To: arend@broadcom.com; andrea.chittano@hotmail.it<br>> > > CC: hostap@lists.shmoo.com<br>> > ><br>> > > Hi Arend,<br>> > ><br>> > > I agree with what you said regarding the AP.<br>> > ><br>> > > One more question: Any device with WPS capabilty can join a P2P network.<br>> > ><br>> > > Thanks.<br>> > > -Anand Moon<br>> > ><br>> > ><br>> > ><br>> > > On Wednesday, May 14, 2014 2:56 PM, Arend van Spriel<br>> > <arend@broadcom.com> wrote:<br>> > > On 14-05-14 05:03, Anand Moon wrote:<br>> > > > Hi All,<br>> > > ><br>> > > > I would like to add new question to this thread.<br>> > > ><br>> > > > If the AP has the capability to support p2p and wps, how will<br>> > > > these two devices communicate with the AP.<br>> > > > Will this AP become P2P group owner (P2P Go) and the other devices<br>> > P2P Clients ?<br>> > ><br>> > > I am not sure whether this scenario makes sense. P2P typically involves<br>> > > two STAs. They may be connected to some AP, but if both are connected to<br>> > > the same AP there may be not so much need to setup a P2P connection.<br>> > ><br>> > > > I would like to know how to judge if the wireless interface<br>> > supports P2P<br>> > > > is it with the "Supported interface modes" or "Supported RX frame<br>> > types" ?<br>> > > ><br>> > > > If the device support following p2p mode then how do we need to<br>> > configure them.<br>> > > ><br>> > > > Supported interface modes:<br>> > > > * IBSS<br>> > > > * managed<br>> > > > * AP * AP/VLAN<br>> > > > * monitor<br>> > > > * mesh point<br>> > > > * P2P-client<br>> > > > * P2P-GO<br>> > > ><br>> > > > How do we configure these P2P modes for interface?<br>> > > > Please share your thoughts.<br>> > ><br>> > > Just use nl80211 API, ie. NL80211_CMD_SET_INTERFACE. wpa_supplicant is<br>> > > doing that in src/drivers/driver_nl80211.c<br>> > ><br>> > > Regards,<br>> > > Arend<br>> > ><br>> > ><br>> > > > -Anand Moon<br>> > > ><br>> > > ><br>> > > > On Tuesday, May 13, 2014 6:31 PM, Arend van Spriel<br>> > <arend@broadcom.com> wrote:<br>> > > > On 05/13/14 14:03, Andrea Chittano wrote:<br>> > > >> Hi, my name is Andrea.<br>> > > >> I'm working on WiFi Direct and I found a thread about it.<br>> > > >> I've some doubts about it.<br>> > > >> Let's suppose we have 2 devices. Let's call D1 and D2.<br>> > > >> Let's suppose D1 sends a request of connection to D2 (D1 doesn't known<br>> > > >> D2 so no persistent connection there exist).<br>> > > >> The first step that wpa_supplicant on D1 is to send a GO negotiation<br>> > > >> request containing, among all,GO intent (of D1).<br>> > > >> I want to understand how wpa_supplicant on D2 acquires the GO<br>> > intent of<br>> > > >> D2 in order to compare it with whichone sent by D1.<br>> > > >> Can someone explain me this?<br>> > > ><br>> > > > Both devices have their own go intent configuration in wpa_supplicant<br>> > > > configuration file. D2 sends own go intent value in the GO negotiation<br>> > > > response. The device with the highest GO intent will become GO.<br>> > > ><br>> > > > Regards,<br>> > > > Arend<br>> > > ><br>> > > >> Thanks,<br>> > > >> Andrea<br>> > > >><br>> > > >><br>> > > >><br>> > > >> _______________________________________________<br>> > > >> HostAP mailing list<br>> > > >> HostAP@lists.shmoo.com<br>> > > >> http://lists.shmoo.com/mailman/listinfo/hostap<br>> > > ><br>> > > ><br>> > > > _______________________________________________<br>> > > > HostAP mailing list<br>> > > > HostAP@lists.shmoo.com<br>> > > > http://lists.shmoo.com/mailman/listinfo/hostap<br>> > > ><br>> > ><br>> <br></div></div>                                            </div></body>
</html>