I'm using code similar to what is specified at WifiDirectSample to connect devices over Wifi Direct using legacy mode.
Connection/Disconnection works fine. However I want to show the name of the device being connected i.e. MyComputer or SamsungS20, something like that and detect if the device being connected is either of Windows or android or iOS type.
So far I have somehow managed to get the name of the device using the machine name as below
var EndpointPairs = wfdDevice.GetConnectionEndpointPairs();
EndpointPair connectionEndPointPair = EndpointPairs[0];
HostName remoteHostName = connectionEndPointPair.RemoteHostName;
IPHostEntry iPHostEntry = Dns.GetHostEntry(remoteHostName.ToString());
string machineName = iPHostEntry.HostName;
Which gives name of the device in case of Windows something like MyComputer.local and incase of android somthing like SamsungS20.mshome.net !?
is there some method/API or anything which can acomplish this?
Edit:
The application being developed of WinUI App.
Related
I have a xamarin.MAC application built using Xamarin.MAC. Now I need to find a way to get the connected Wifi SSID in MAC application. I see lot of solution for xamarin.ios.But couldn't see the solution for MAC Application. Do any one know how can I detect SSID in the Xamarin.MAC application?
Thanks in Advance
Roshil
Use the CoreWLan framework, something like this will get you started:
var client = CWWiFiClient.SharedWiFiClient;
foreach (var #interface in client.Interfaces) // you can have multiple wifi devices connected at once
{
if (#interface.DeviceAttached)
{
Console.WriteLine(#interface.Ssid);
}
}
re: https://developer.apple.com/documentation/corewlan/cwwificlient
I need to create a service that starts a mobile hotspot using bluetooth. I've found the code to create a hotspot service, but this creates a hotspot with the Ethernet adapter.
I've read the documentation and can't find anything to specify bluetooth like in the settings UI.
This is the code to initialize the hotspot with the Ethernet adapter.
var connectionProfile = Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile();
var tetheringManager = Windows.Networking.NetworkOperators.NetworkOperatorTetheringManager.CreateFromConnectionProfile(connectionProfile);
The problem with this is that the network is shared through WiFi, and not Bluetooth.
Here are my current connections:
My OS were unfortiunately installed in Norwegian, but the display should look familiar in English.
GetConnectionProfiles returns a IReadOnlyList of ConnectionProfile. You can then try to select a specific profile from the list to operate on, instead of using the default one you have in your snippet.
I'm trying to get a serial communication over USB between an Arduino Nano and the Raspberry Pi 3. On the Raspberry is Windows IoT installed with a Background App that should read the incomming data.
My problem is that i can't find the connected Arduino. I wrote a simple app to iterate through all devices but i don't get a DeviceInformation for the connected Arduino.
public sealed class StartupTask : IBackgroundTask
{
public void Run(IBackgroundTaskInstance taskInstance)
{
while (true)
{
var devices = DeviceInformation.FindAllAsync(SerialDevice.GetDeviceSelector()).AsTask();
devices.Wait();
foreach (var dev in devices.Result)
{
Debug.WriteLine(dev.Name);
}
}
}
}
Has anyone an idea what is wrong? Maybe i have to install drivers manually?
Note: I can also find no device in the webinterface
List of connected Device on Webinterface
Thanks in advance.
EDIT:
I found out that the Name is always the same, so i changed it to print the ID.
I inserted the DeviceCapability Node and now i getting a bunch of informations. I'll guess the Id's starting with USB are interessting. But i'm getting always the same, regardles if the arduino is pluged in or not.
Here is one Example: \?\USB#VID_0424&PID_EC00#5&3753427a&0&1#{ad498944-762f-11d0-8dcb-00c04fc3358c}{2697A3B2-2715-443C-8A9F-B050D699B775}
Current OS Version: 10.0.14393.448
Arduino Nano use FTDI USB-To-Serial chip FT232RL to communicate with Host PC, and in your case Raspberry Pi with Windows IoT Core.
My experience with FT232RL chip on windows IoT is it's native supported with some latest versions(probably 10.0.10586 and above), so first make sure you have OS version above that. And use "devcon status xxxxxxx" command to verify the device driver is working properly.
If you're not sure what the device id looks like, plug the arduino nano into PC, and in the device property, check on the Hardware Ids. For example, mine shows
Second, check if you have the com port communication capability declared in your project manifest file, it should be something like below,
<DeviceCapability Name="serialcommunication">
<Device Id="any">
<Function Type="name:serialPort" />
</Device>
</DeviceCapability>
Last, make sure the USB port of your RP3 has enough power supply for Arduino nano, I don't think it should be a problem, but better have that checked as well.
Maybe you can try installing the Arduino IDE on the Windows installation, as it includes the Arduino USB drivers:
I'll try to keep it short. I've been running in Windows 10 (10130) Microsoft's WiFi Direct Services example available on GitHub , the C# one in Visual Studio 2015 RC. Now, in their Build conference they said you can run in CMD a command to know if your WiFi adapter is compatible with WiFi Direct
netsh wlan show wirelesscap
Which gives me a big YES, your wireless adapter is compatible.
Wi-Fi Direct Device : Supported
Wi-Fi Direct GO : Supported
Wi-Fi Direct Client : Supported
But when I run the mentioned sample, everything goes OK until the WiFiDirectServiceWrapper.OnAdvertisementStatusChanged(. . .) is triggered, almost inmediatly after creating the advertiser. While running the sample with the profiler attached I get this:
private void OnAdvertisementStatusChanged(WiFiDrectServiceAdvertiser sender, object args)
--
sender | {Windows.Devices.WiFiDirect.Services.WiFiDirectServiceAdvertiser}
AdvertisementStatus: Aborted
AutoAcceptSession: true
CustomServiceStatusCode: 0
DeferredSessionInfo: null
PreferGroupOwnerMode: true
PreferredConfigurationMethods : _native, can't see_
ServiceError: UnsupportedHardware
ServiceInfo: null
ServiceName: "myservice"
ServiceNamePrefixes: {System.__comObject}
ServiceStatus: Available
I really don't know how I'm supposed to depurate this, as I can't find where this Event is raised (the only references to that method are
this.advertiser.AdversitementStatusChanged += OnAdvertisementStatusChanged
this.advertiser.AdversitementStatusChanged -= OnAdvertisementStatusChanged
^ those), and I can't see the WifiDirectServiceAdvertiser implementation.
My WiFi Card is a Qualcomm Atheros AR9485, and I'm using the latest drivers available through Windows Update. In the device manager I get two Wi-Fi Direct Virtual adapters:
Microsoft Wi-Fi Direct Virtual Adapter
Microsoft Wi-Fi Direct Virtual Adapter #2
The second one is disabled sometimes (the UnsupportedHardware event is the same, enabled or disabled). For all of them I've disabled the "Allow the PC to shut down this device to save energy" option.
I've tried to compile the code to x86 and x64, but I get the same result at the same point. I've tried another two generic wireless thumbs (those USB WiFi adapters) which Windows says yes, they're compatible too with no luck.
I know Windows 10 is not final, but any help is appreciated.
It seems that the WiFiDirect capabilities are not the only ones you need to look at if the thing you want to do is advertise a service (which is actually the "new in Windows 10 thing" concerning Direct).
The command you must execute is exactly the same as before:
netsh wlan show wirelesscap
but if you want to advertise a service, the relevant capabilities are the following:
P2P Device Discovery : Supported
P2P Service Name Discovery : Supported
P2P Service Info Discovery : Supported
P2P Background Discovery : Supported
What WiFiDirect does in Windows since 8 and 8.1 is advertising the whole computer, but since 10, WiFiDirectServices advertises one or more services running simultaneously in your machine.
Lets say you are the developer of com.boardgames. If you want to host a board games competition somewhere without a WiFi hard AP, that could be the prefix of the name of all your services, so each client connects only to the one they want: for example, com.boardgames.solitaire or com.boardgames.chess instead of connecting to your machine.
Sadly, none of the computers nor WiFi antennas I've tried are compatible with P2P discoveries.
Story : I've implemented video streaming application using AFORGE.net, in c# from my laptop camera, using TCP protocol.And it worked excellent.I tested the application on multiple pc's using lan cable and it worked good. I've never worked with IP-Cameras but i read this forum ( http://www.aforgenet.com/forum/viewtopic.php?f=4&t=36 ) and it says that every ip-cam needs a source string that is a URL in order to connect with AFORGE.net's MJPEGStream class:
MJPEGStream mpeg = new MJPEGStream();
mpeg.Login = "username";
mpeg.Password = "pass";
mpeg.Source = "http://ip:port/img/mjpeg.cgi";
mpeg.Start();
Problem : Now i want to use my android phone as an ip-camera for video streaming. I've also created an android application that send images continuously to an address using TCP.
All i want to know that if its possible to use android device as ip-camera? And if yes then what source string i should use with MJPEGStream class.?
Thanks in advance for suggestions and guides.