C
C#3w ago
Greenboat

NetworkInformation.GetConnectionProfiles() when broadcasting mobile hotspot in Windows 11

So I'm currently trying to build an application where devices can communicate over mobile hotspot (can't be internet, has to be a local network because they haven't got internet where this app needs to be used). While debugging, I set my PC to broadcast mobile hotspot whilst using a wired ethernet connection, connect my phone to the hotspot to ensure it's working and then call NetworkInformation.GetConnectionProfiles();. I look at the collection, and it only shows me the ethernet adapter, and my PC's bluetooth adapter, but not the wifi adapter which I'm fairly sure is there. If I unplug the ethernet cable and instead run my internet on wifi, the network adapter shows up when I call that method. Am I doing something wrong? I just need to check if I'm running a hotspot so I know if my app can receive requests from other devices. Or, should I be using something else?
8 Replies
jcotton42
jcotton423w ago
Your app shouldn’t care at all. So long as it can discover the other devices, why does it matter?
Greenboat
GreenboatOP3w ago
But, how can I make it so it can discover the other devices without a network they're all on? I suppose I could use Bluetooth instead. I'll be honest I've never done anything like this before so I'm kinda grasping in the dark about what I need to do to get these devices to talk to eachother.
jcotton42
jcotton423w ago
What discovery mechanism are you currently using?
Greenboat
GreenboatOP3w ago
I'm not sure? My initial thoughts were if I could use the hotspot capability on the device and then connect using that, I might be able to achieve what I need. If there's a method I'm missing that will work on Android, iOS and Windows then I'd love to hear it, because again, I'm kinda in the dark and not even sure where to begin. In essence, I need multiple devices to be able to request JSON files from one device, alter them, and then send them back.
jcotton42
jcotton423w ago
All the hotspot does it make a wifi network that can be joined. It's going to be the same kind of as LAN made by a router.
Greenboat
GreenboatOP3w ago
Mhm, so would it then be possible to make requests over that network?
jcotton42
jcotton423w ago
Yes. But again, doesn't need to be a hotspot, could be a normal router.d
Greenboat
GreenboatOP3w ago
In this case, all I have access to is a single macbook and between 1 and 8 iPads.
Want results from more Discord servers?
Add your server