Highlighted

NetConnection on Wifi-Direct network - possible bug?

Explorer ,
Dec 02, 2015

Copy link to clipboard

Copied

Hi,

I have a simple goal that seems to be impossible - to establish a NetGroup without a need of a router (so it can be established anywhere) by creating AP by one of devices.
A device with HotSpot feature enabled doesn't seem to be able to communicate other way than via Sockets so I am trying a Wifi-Direct Group now because it can work in some cases I am going to describe here.

So I have a device that creates a Wifi Direct Group (= it acts like an AP) and I want to join a NetGroup with other clients on it's network. Looks simple but there are strange issues.

If I call NetConnection.connect on the Wifi-Direct device and it is not connected to any other wireless network then AIR does not seem to use the P2P interface with NetConnection because the NetGroup established on it's network is not seen by any other device (tried every possible combination of IP addresses). Also there is no active network interface listed by NetWorkInterface class. Other devices can see each other when they have the same multicast address assigned (by addIPMultiCastAddress) and join to a common NetGroup successfully.

In this mode I used ADB and noticed that wlan0 is down (0.0.0.0) and p2p0 is UP on 192.168.49.1/24 but I can't invite it to a NetGroup by addIPMulticastAddress(192.168.49.1 or such). I know it is not a multicast address but this works for the second case though:

If I call connect() while the Wifi-Direct Group owner is already connected to some wifi network then it's wlan0 interface is set as active, broadcasting on 192.168.49.255 and the device can be "invited" to a NetGroup if one of devices has addIPMulticastAdress set to 192.168.49.1 or 192.168.49.255 (looks like device in Wifi-Direct / Hotspot mode can't communicate on multicast address at all). Then all devices are in the NetGroup and this group still keeps working even if Wifi-Direct device disconnects from that router. Even then all clients that connect to its network will join the NetGroup.

So for me it looks like an issue with AIR itself that it doesn't know "how to behave" on Wifi Direct AP / Hotspot device(?) Or has some problem with recognizing and assigning network interfaces?

Anyone was dealing with this and found a solution?

Note that I can use Sockets without any problem but I badly need to establish a NetGroup.

Testing Android 4.3.1, Samsung Galaxy S4 Mini LTE

I am capable of creating a Native Extension / make any tests if anyone has an idea how to figure this out.

Thanks for any tips!

TOPICS
Development

Views

651

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

NetConnection on Wifi-Direct network - possible bug?

Explorer ,
Dec 02, 2015

Copy link to clipboard

Copied

Hi,

I have a simple goal that seems to be impossible - to establish a NetGroup without a need of a router (so it can be established anywhere) by creating AP by one of devices.
A device with HotSpot feature enabled doesn't seem to be able to communicate other way than via Sockets so I am trying a Wifi-Direct Group now because it can work in some cases I am going to describe here.

So I have a device that creates a Wifi Direct Group (= it acts like an AP) and I want to join a NetGroup with other clients on it's network. Looks simple but there are strange issues.

If I call NetConnection.connect on the Wifi-Direct device and it is not connected to any other wireless network then AIR does not seem to use the P2P interface with NetConnection because the NetGroup established on it's network is not seen by any other device (tried every possible combination of IP addresses). Also there is no active network interface listed by NetWorkInterface class. Other devices can see each other when they have the same multicast address assigned (by addIPMultiCastAddress) and join to a common NetGroup successfully.

In this mode I used ADB and noticed that wlan0 is down (0.0.0.0) and p2p0 is UP on 192.168.49.1/24 but I can't invite it to a NetGroup by addIPMulticastAddress(192.168.49.1 or such). I know it is not a multicast address but this works for the second case though:

If I call connect() while the Wifi-Direct Group owner is already connected to some wifi network then it's wlan0 interface is set as active, broadcasting on 192.168.49.255 and the device can be "invited" to a NetGroup if one of devices has addIPMulticastAdress set to 192.168.49.1 or 192.168.49.255 (looks like device in Wifi-Direct / Hotspot mode can't communicate on multicast address at all). Then all devices are in the NetGroup and this group still keeps working even if Wifi-Direct device disconnects from that router. Even then all clients that connect to its network will join the NetGroup.

So for me it looks like an issue with AIR itself that it doesn't know "how to behave" on Wifi Direct AP / Hotspot device(?) Or has some problem with recognizing and assigning network interfaces?

Anyone was dealing with this and found a solution?

Note that I can use Sockets without any problem but I badly need to establish a NetGroup.

Testing Android 4.3.1, Samsung Galaxy S4 Mini LTE

I am capable of creating a Native Extension / make any tests if anyone has an idea how to figure this out.

Thanks for any tips!

TOPICS
Development

Views

652

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 02, 2015 0

Have something to add?

Join the conversation