Is there any class or library for the Silverlight 4 print directly to parallel port (LPT1)?
Once you have an OOB Silverlight app with Elevated Trust that can access the local file system, you can make an attempt and dumping data to the parallel port with the file system apis. The name of the LPT device will be \\.\LPTx where x is the dos lpt port number that was mapped by windows. You can find this in the registry under HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\PARALLEL PORTS . On my machine it has the key
\Device\Parallel2 maped to \DosDevices\LPT3 so on I would use the file name "\\.\LPT3" to access the prallel port as if it was a file. Just to be clear that is 2 slashes, a dot then another slash before the port name.
Not unless your Silverlight app is a OOB with Elevated Trust and the client has installed on it some COM component that can manipulate the parallel port.
So basically: No.
Related
First off I have very very little experience with how USB functions let alone writing a driver; essentially trying to make this project a learning experience.
My setup consists of the SparkFun Pro Micro board and a Windows machine. I have a potentiometer wired up to the Pro Micro and my end goal is to send the value of the potentiometer to the host machine and use the value to change things like system volume etc...
The Arduino library came with a Serial library and I can send things over USB using that. I currently have a working Arduino program that sends 1 byte every 1 second, and a C program on the windows machine that "connects" to the COM port and reads the byte coming through (this part I have working fine).
The issue is that when the Pro Micro is connected to the computer it appears on a randomly selected COM port and I don't think you can tell which COM ports hold which device (not sure about this bit).
My end goal is when the Pro Micro is connected to the PC the host program should automatically recognize the Pro Micro and start processing the data that is coming from it. Setting it up as a HID device and making it appear in Device Manager as my own custom device is something I'd be interested in doing, especially for the learning experience but I feel that it might overcomplicate things.
Can anyone point me in the right direction as to what I should do/look into?
maybe use windows internal tools like the COM port database (https://msdn.microsoft.com/en-us/library/ff546481.aspx) or re-assign COM ports using windows registry, see
How does windows map the virtual com port to a device
https://superuser.com/questions/851192/change-com-port-number-programmatically
http://www.ftdichip.com/Support/Documents/AppNotes/AN_132_Re-Assigning_COM_Port_Numbers_Using_Registry.pdf
if you want to know the backgrounds: the arduino implements the USB CDC ACM class (Communication Device Class - Abstract Control Model https://en.wikipedia.org/wiki/USB_communications_device_class) and emulates a COM port. Windows recognizes this class and loads the apropriate driver which is usbser.sys (https://msdn.microsoft.com/de-de/library/windows/hardware/dn707976%28v=vs.85%29.aspx) when the driver is loaded the new (virtual) COM port is accessible
the best sources are How does windows map the virtual com port to a device, https://superuser.com/questions/851192/change-com-port-number-programmatically and http://www.ftdichip.com/Support/Documents/AppNotes/AN_132_Re-Assigning_COM_Port_Numbers_Using_Registry.pdf
I would suggest using libusbp, a C library that can be used to find the name of a COM port, given the USB vendor ID and product ID. There is even an example in the "examples" folder that does just that:
https://github.com/pololu/libusbp
Let's say I have iPhone, or Android or Embedded system and I want to use Socket programming to establish a connection between them, Mobile to embedded system.
Is it OK to use port 80 of mobile and embedded system to establish the connection?
Can I hardcode port 80 into the code for both Mobile and embedded system?
Generally, ports below 1024 are considered "privileged" on Unix-style systems, from which both Android and iOS inherit much of their basic under-the-covers functional design.
You will not be able to use port 80 on a secured (typical consumer, unhacked) Android device.
While I haven't tried it, I expect you will not be able to on an iphone either - iOS applications which I have seen which create a web server to expose selected data typically use higher port numbers in the unprivileged range.
You have two general options for picking the port number: guess a safe default (possibly already in customary use for the type of function you want - 8080 is a common choice for an unprivileged http server) and allow the user to change it if needed in some configuration menu, or pick a random free port and inform the user what it is so that they can enter that on the other end.
Also note that you will typically only be able to direct traffic to a phone when it is on a wifi network. Putting the two requirements together, access to your embedded server would probably be via a URL something like
http://192.168.0.111:8080/somepage.html
Where of course the ip address, port number, and remainder of the URL are correct for you actual run time situation.
I'm developing a program that sends a file from one computer to another between a RS232 serial port.
I can test it on the school computers just fine, but I would like to be able to test it at home. So I'm trying to connect 2 virtual machines between a virtual serial port in vmware fusion, but I don't understand how to configure it.
I've installed the 2 virtual machines and added a serial port to each one (in the settings). But the only available option is to name the file that the serial port will use. This name will be used how?
I'm working with the /dev/ttyS1 port, can I still use it normally, and somehow redirect the output to the file that was configured?
So, it was easy. You have to use the same file in each virtual machine. When you try to save the same file on the second vm it warns you that the file already exists, just say you want to replace it. Go into the share settings of each virtual machine and add the folder where the file is stored on your computer, and give it read and write permissions. In my case is the same folder where I keep the vm files. Now I just have to open the file and exchange info between the 2 vm's. I had to comment a few things in my code (it's not a real serial port)but at least I can simulate it well enough.
My company has developed a .net 4 WPF application that connects to our manufacturing devices over a local network and controls them, in addition to processing image data and outputting it to these devices from the windows desktop. I have been tasked with porting a bare bones version of this to mac. My options are mono for mac or a browser based SilverLight application.
What is the feasibility of a browser based app that will essentially
-scan the local network for our devices and send commands to the chosen device
-accept images from the local machine, uploading them to our server for processing. We would then send the processed data back for output to the local device and display the final image in the browser.
I'm aware that SilverLight 4 Elevated Privileges allow connection across a domain without port number limitations. However I am unsure about scanning a network from a silverlight app running in safari.
-accept images from the local machine, uploading them to our server for processing. We would then send the processed data back for output
to the local device and display the final image in the browser.
Silverlight app can't access files from local machine without user interaction. OpenFileDialog class can't be user initiated. you have to select files from local machine to upload to some service.
-scan the local network for our devices and send commands to the chosen device
as far as scaning local network is concerned, silverlight don't offer TCP ping. if your devices offer some interface using http you might be able to connection and send commands to devices using WebClient.
Further last but not the least silverlight is not full supported in MAC OS described by microsoft. so you might face weird issue that will remain unfixed. Check System Requirement here http://www.microsoft.com/getsilverlight/Get-Started/Install/Default.aspx
Regards.
I am using a combination of hardware and virtual serial ports in a ANSI C Windows 7 environment. In this project, there will be two applications: The first application is being developed and will be connected both to a hardware COM port and to a virtual COM port. The second is a legacy application (has already been developed and cannot be changed) It will be connected only to the same virtual COM port via a virtual NULL modem.
In the first application, COM event handlers can be used for listening to and handling messages generated from a serial message generator connected to the hardware COM port. However, virtual COM ports do not generate COM events, and so I am limited to using timing loops to periodically check the simulated in and out queues of the virtual port. This is fine for controlling COM traffic in the first application, but the second application will need to see a COM event to enable it to process incoming serial traffic.
Is there a way to generate Windows COM (RS232) events programmatically in one application such that a legacy application that is expecting COM events, can see them?
By events, I am referring to those recognized by a typical comcallback, such as:
LWRS_RXCHAR, LWRS_RXFLAG, LWRS_TXEMPTY, LWRS_CTS, etc.
I don't know if this will work, but you can try to make a loopback on the legacy COM interface? Then you can write to it and it will trigger COM events.
Just closing the loop here (a little late), Thanks for the attempt #Evert.
The solution was to select the right vendor. We needed a good kernel mode driver to produce the right configuration of virtual com port. Eltima (www.eltima.com) provided a product that did just that. Great product with a usable API. Problem solved