Virtual serial port-note, serial port-Note

Source: Internet
Author: User

Virtual serial port-note, serial port-Note

Virtual serial port is occupied, software available Serial Port Limited COM1-COM4, how to release and delete the occupied serial port


A: You can delete A numeric entry in the Registry to clear these configurations: Enter regedit in the "run" dialog box to enter the registry; then go to HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ COM Name Arbiter. Then we can find this value: ComDB. Its value indicates the serial port number currently in use. For example, for 1d, the binary value is 0001 1101, And the number from right to left indicates ports, and 5 are occupied. In this way, we only need to delete the ComDB data item and disable the Registry (without restarting the computer.


How to connect with symbols?

Modify the Registry: HKEY_LOCAL_MACHINE \ HARDWARE \ DEVICEMAP \ SERIALCOMM, create a project, name myWDMDevice, type REG_SZ, content COM7. Open the serial port monitoring, you can see.

/*************************************** *********************************
* Function name: HelloWDMAddDevice
* Function Description: Add a new device.
* Parameter list:
DriverObject: The driver object that comes in from the I/O manager.
PhysicalDeviceObject: The physical device object that comes in from the I/O manager.
* Return value: the status of the added device is returned.
**************************************** *********************************/
# Pragma PAGEDCODE
NTSTATUS HelloWDMAddDevice (IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT PhysicalDeviceObject)
{
PAGED_CODE ();
KdPrint ("Enter HelloWDMAddDevice \ n "));


NTSTATUS status;
PDEVICE_OBJECT fdo;
UNICODE_STRING devName;
RtlInitUnicodeString (& devName, L "\ Device \ MyWDMDevice ");
Status = IoCreateDevice (
DriverObject,
Sizeof (DEVICE_EXTENSION ),
& (UNICODE_STRING) devName,
FILE_DEVICE_UNKNOWN,
0,
FALSE,
& Fdo );
If (! NT_SUCCESS (status ))
Return status;
PDEVICE_EXTENSION pdx = (PDEVICE_EXTENSION) fdo-> DeviceExtension;
Pdx-> fdo = fdo;
Pdx-> NextStackDevice = IoAttachDeviceToDeviceStack (fdo, PhysicalDeviceObject );
UNICODE_STRING symLinkName;
RtlInitUnicodeString (& symLinkName, L "\ DosDevices \ COM7 ");


Pdx-> ustrDeviceName = devName;
Pdx-> ustrSymLinkName = symLinkName;
Status = IoCreateSymbolicLink (& (UNICODE_STRING) symLinkName, & (UNICODE_STRING) devName );


If (! NT_SUCCESS (status ))
{
IoDeleteSymbolicLink (& pdx-> ustrSymLinkName );
Status = IoCreateSymbolicLink (& symLinkName, & devName );
If (! NT_SUCCESS (status ))
{
Return status;
}
}


Fdo-> Flags | = DO_BUFFERED_IO | DO_POWER_PAGABLE;
Fdo-> Flags & = ~ DO_DEVICE_INITIALIZING;


KdPrint ("Leave HelloWDMAddDevice \ n "));
Return STATUS_SUCCESS;
}

Serial Port I/O control code

# Include <ntddser. h>

# Define IOCTL_SERIAL_SET_BAUD_RATE CTL_CODE (FILE_DEVICE_SERIAL_PORT, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
# Define IOCTL_SERIAL_SET_QUEUE_SIZE CTL_CODE (FILE_DEVICE_SERIAL_PORT, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)

How to Implement Virtual serial port driver? I used driverstudio to automatically generate a driver without any changes.
I put
Change class and classguid

Class = Ports
ClassGUID = {4d36e978-e325-11ce-bfc1-08002be10318}

Then you can see my driver in the Device Manager, and there is com4 in the brackets.

You only need to use pDevice-> createlink (\ "com4 \") in adddevice.


The Super Terminal and serial port debugging assistant of windows adopt two different mechanisms.
The Super Terminal uses the query method. The serial port debugging assistant and other serial port applications using the MSComm class use the event notification method.

Super Terminal Mode:
Keep trying to read 1 byte.

Event method: not actively read
Call IOCTL_SERIAL_SET_WAIT_MASK to set some flag
This is equivalent to setting the hardware interrupt enabling and interrupt blocking.

Call IOCTL_SERIAL_WAIT_ON_MASK to send an IRP request, which is sent to you for processing. The real serial port is that when the specified MASK event occurs, the interrupt handler completes this IRP.

When the IO manager finds that this IRP is returned, it first checks IOCTL_GET_WAIT_MASK for the flag it has just set. If the SERIAL_EV_RXCHAR flag in the completed IRP
When it is set, the IO manager will IOCTL_GET_COMMSTATUS


Is there a virtual online game helmet? How nice it is to wear a helmet to play games'

British scientists developed the first virtual reality helmet (15:22:17) reprinted label: Brain perception in the virtual reality cylinder of Cognitive Science Mind philosophy true unreal education classification: note: Virtual Reality helmet-virtual cocoon [Image Source: google] According to the scientific Times report on April 9, June 22, british scientists believe they have initially developed the first virtual reality head-mounted device that can simulate the facial features and reflect the natural experience.

By incorporating these feelings into a revolving head-mounted device, a British research group is now moving towards what they call "real virtual, that is, to provide users with a vivid and realistic experience, making it difficult to distinguish between true and false.

David Howard, an electronics engineer at York University, and Alan Chalmers, a high-fidelity Graphics Expert at Warwick University, recently invented a method to generate electronic smells-to work together on this project. Users wearing this new Virtual Reality (VR) helmet can smell the flowers in the Japanese Garden, the researchers said, when watching a VR hunt, you can hear the roar of lions and other beasts, or feel the warmth of tropical sunshine on their faces, people can feel it safe and comfortable sitting in a chair at home.

Howard said: "VR projects generally focus only on one or two of the five senses-usually visual and auditory ." In the future, using a device that connects your tongue and skin can simulate taste and touch in an approximate way, he said. The researchers claim that all facial features can be optimized to provide a real user experience.

This head-mounted device, known as "virtual cocoon", was developed by multiple UK universities. Chalmers said the head-mounted device will eventually be developed within five years. He believes that this device can be used for remote commercial or family meetings, while at school it can be used for students to review history, or to give users a taste of exotic scenery. It may also be sought after by computer game players, especially those who enjoy virtual role playing.

For users, the virtual cocoon will include a specially developed head-mounted device with electronic and computing capabilities. People can also use it to explore the feeling of living in ancient Greece, ancient Egypt and ancient Rome, and the actual appearance, sound, and smell of the streets there.

Howard added: "Smells will be produced by electronics through a new technology, pioneered by Chalmers and its team, which will provide pre-fabricated odor prescriptions as needed ." Taste and smell are closely related, but they want to provide a texture related to the oral material. The tactile device will provide a tactile sensation. He said that VR has long provided such hope for decades. One day, we will visit all places and times like virtual tourists. But it has not broken through the limitations it faces in its early stages-cost, weight, and lack of authentic sensory stimulation are all limiting factors.

Chalmers said: "This idea is not to replace the truth, but to supplement it ." He believes that it will also be possible to explore other parts of the world in real time. For example, during a trip, you attach a device to a car to record the scenery, smells, sounds, and temperatures along the way, and pass these feelings over the Internet to a virtual cocoon at the other end of the world.

According to the researchers, a pipe connected to a box containing chemicals can release the smell under the user's nose, and a similar device can spray the taste directly in the mouth and provide texture. The temperature and humidity can be changed through the fan and heater, and the surround sound speaker can recreate the surrounding noise. Preliminary estimates show that the helmet is worth about 1500
 
How can I open a virtual online shop and automatically recharge the software? How can I act as a proxy?

For example, Zhou Zuoren's "miscellaneous in the mountains", no matter from the materials or from the perspective of writing, reading at first glance gives people a feeling of being fragmented and complicated, but read it carefully, it will be found that there is "excellent" in its "Miscellaneous", which seems to be diffuse but not uncompleted.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.