I would like to connect to a wireless miracast display which is already paired with the host. I am able to use EnumDisplayDevices to list the wireless display device. I have tried to use ChangeDisplaySettingsEx but it didn't work, I used CDS_SET_PRIMARY on the miracast display device hoping that it would automatically connect to it and set it as the primary display.
It looks like ChangeDisplaySettingsEx cannot establish a connection on it's own. There should be some kind of API which can connect to the display. I have also tried SetDisplayConfig with SDC_TOPOLOGY_CLONE to change the display configuration to "clone" thinking that it would automatically connect to the display.
Question: What is the proper way to connect to a wireless display device using Windows API?
Related
I have an issue where WiFi is not available on an Android device. We want to stream image data from the device using a websocket server (written using WebSocket++) through to the PC. However, I'm not sure if this is possible without operational WiFi. So, the position we are in is that we may only have the USB link available.
Someone today suggested we might be able to get Websockets working using adb port forwarding (see https://developer.android.com/studio/command-line/adb#forwardports), but I'm not sure if that's correct. Could this work, and what would that solution look like?
Are there any other reasonable options. I'm not certain if tethering is available on the device and if that could be another solution?
I am developing an PC interface that connect to an embedded device. From this interface I can modify some parameters, and I can both load data and dump data. Also I can upgrade the firmware.
How should I call the buttons on my interface?
Download data or Upload data when the goal is to send data from my PC where the interface is running, to the embedded device on which the interface is connected.
The exact same question about the button "Download firmware" or "Upload firmware"
Of course during the transfer, a message should display "Downloading" or "Uploading".
I am confused between the choice of Download/Upload which is perfectly clear between a PC and Internet.
Where there is also the notion of the interface which is running on the PC, but which remote control the embedded target by sending commands to it. So should I see the problem from the target remote controlled through the interface running on the PC or from the PC?
This is confusing....
This is confusing....
It is; so whatever you call it how would you expect your users to know what it means!? The solution is to use less ambiguous terms that do not depend on the point-of-view. Just be clear:
Update firmware.
Write device parameters.
Read device parameters.
I am using the 32feet bluetooth library to connect to a device that supports Serial Port Profile (SPP). I try to connect like this:
using (BluetoothClient client = new BluetoothClient())
{
var address = new BluetoothAddress(0xecfe7e11c3af);
BluetoothEndPoint endPoint = new BluetoothEndPoint(address, BluetoothService.SerialPort);
client.Connect(endPoint);
var stream = client.GetStream();
System.Threading.Thread.Sleep(10000);
}
Everything is great until the Connect method is called. At this point, Windows interrupts the program flow with a bubble alert that says
"A bluetooth device is trying to connect -- click to allow this"
At which point the user is led through a wizard that ends up installing drivers and a Bluetooth virtual COM port shows up in Device Manager. I don't want this to happen -- I want to simply access the stream and communicate directly with the device without windows intervening. Is this possible? What can be done to tell Windows to keep out of my business?
I'm attempting to connect to a Bluetooth 4.0 device. I've done something similar in the past with a 2.0 device and Windows does not interfere in this case.
Have a look at http://SimpleBluetooth4Win.SourceForge.net
It's a small wrapper library that uses the windows bluetooth networking API that could help you.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa362932%28v=vs.85%29.aspx
In particular if your bluetooth USB dongle or bluetooth device has been correctly recognized by the appropriate drivers and the remote bluetooth device is already paired with the PC, you don't need to install a bluetooth virtual COM port that shows up in Device Manager but you simply use the write or read calls to access directly the stream for communicating with the paired device.
I would like to know whether the following are possible in the current windows phone 7 SDK:
Getting the device's OS version
programmatically.
Detecting programmatically
whether the data connection is
available in the device or not
Programmatically getting the type of network
connection that the device is
currently having either wifi or LAN
You can get the OS version by doing using System.Environment.OSVersion. The numbers at the end will be the current running version. You can confirm this on your phone by going to Settings...About and seeing if the numbers match.
You can use the NetworkInterface.GetIsNetworkAvailable method to determine if there is any data connection available.
To determine the type of connection, you can use NetworkInterface.GetInternetInterfaceType. This will return a valume of enum NetworkInterfaceType. If the value is Ethernet, the user is plugged into the computer and using its data connection. (Of course, you should test the values returned to confirm that they're what you expected them to be).
So I have a bluetooth device, this device uses SPP to transfer data between the PC and itself. It connects fine through Windows as a bluetooth device. I can find it, enter the paring code and assign it to a COM port. Now I want to be able to send data through the com port using Windows API but it is refusing to do so.
I suspect that I need to setup the COMMCONFIG Structure correctly (see below)
http://msdn.microsoft.com/en-us/library/aa363188(VS.85).aspx
Unfortunately I have no idea what is the proper setting. I know SPP is supposed to emulate the RS-232 communication... so maybe I have to study up on that to figure out the right setting? Or is there some automatic way to set the COMMCONFIG structure.
I seriously doubt it. If it would be used then you'll have no chance at guessing at the custom provider data without docs from the driver author. Pay attention to the handshake signals, serial port devices routinely ignore anything sent to them when the DTR signal is turned off. And not send anything back with DTR off. A driver would emulate that. Use EscapeCommFunction() to turn them on. Also try a serial comm program like HyperTerminal or Putty to test this so you can isolate the source of the problem.
Why not use the Bluetooth sockets API? No need for troublesome (virtual) COM ports then.
If you're using managed code then see my library 32feet.NET
If using native code, use SOCKADDR_BTH with Winsock connect etc, see e.g. Bluetooth and connect (Windows) Then you can use the standard Winsock send/recv API
Ok, I found that you can use the
GetCommConfig and GetCommState functions to figure out the settings.