Do I understand the mechanism of COM Port assignment for USB-Serial bridge (VCP) correctly? - windows

I have to base a critical Windows 7 software on virtual COM Port assignment. The software has to test devices in a production line. Each device is different and needs to be supplied with individual security keys.
There are 20 serial connections from an USB-Serial bridge (Silicon Lab CP2103). Each connection on a physical USB Port gets some virtual COM Port, which I can adapt by the device manager (e.g. to COM7).
If the serial number of the bridges are all the same, I was told, that Windows remembers the chosen COM Port for each USB Port. Can I rely on that to be "stable" under restarts and other USB activities, not related to my adapters?
What would be the difference, if each adapter has individual serial number: Is it true, that in this case Windows remembers the COM assignment, but is doesn't matter which physical USB port is used for connection?
Are there any recommendations to do it in one or an another way?

Related

What Windows 10 driver model is appropriate for implementing IP link layer?

I'm looking to write a simple Windows driver to enable running TCP/IP over a proprietary RF module. The module already provides Ethernet-style data packets with source/destination MAC, so I just need to layer IP packets (generated by the regular Microsoft IPv4 subsystem), set the MTU appropriately so they will be the right size, and then call the module's serial API. I'll need to be able to handle transmit statuses and implement an ARP protocol as well. I want the driver to expose a new interface similar to a wifi or ethernet card in Network Connections and use the normal Windows IP stack.
The module is UART and might be connected via FTDI chip, RS-232 converter, or native UART on an IoT Core board, so it will just be talking to a generic serial port. I am fine with only running on Windows 10, but I'm still not sure what to use. Can I use the UWP VPN provider? Do I need to write an NDIS miniport driver, or an interface provider? Also, how will I handle the driver needing complete control over the serial port at all times? I can't write a serial driver as it might be connected via many different types of serial ports.

How many physical channels SATA controller has?

Imagine a system with one SATA controller. If controller operates in IDE mode it will show up in device manager like this:
Windows XP:
IDE controller's name
Primary IDE Channel
Secondary IDE Channel
Windows >= Vista:
IDE controller's name
ATA Channel 0
ATA Channel 1
And if controller operates in AHCI mode it will show up like "SATA AHCI controller" on both XP and >= Vista.
SATA controller in AHCI mode supports up to 32 devices (32 bit mask indicates device connection). I think it is just software limitation, given that each device requires separate channel, it is unlikely that such system exist where SATA controller is "wired" with all 32 channels. But I think 32 is a number that implies that controller can deal with more than two devices and thus has more than two channels. So, I want to ask how many channels SATA controller often has in practice. ATA controller has two channels, so does it mean that SATA controller has the same number of channels for software compatibility in IDE mode? Or maybe it has more than two channels, but in IDE mode only first two channels will be available? (at least on XP because "primary" channel and "secondary" channel greatly reduce the possibility of "third" channel which is not the case with "0" channel, "1" channel, "2" channel and so on)
A bit later but maybe would be useful for others.
Let's add some clarifications. There is SATA Host Controller with AHCI interface (Advanced Host Controller Interface). And there is SATA drive (or any other device with AHCI interface).
SATA Host Controller (HC) has a number of ports. Theoretically there could be up to 32 SATA ports but not less than 1 (well w/o any port HC itself doesn't make any sense). The number of actual ports depends on implementation. General HC chips used in PC more likely to have 1 or 2 ports. SATA drives are connected to ports. So if SATA HC has 2 ports than up to 2 SATA drives/devices could be attached.
In real life everything is even more interesting. As #Ross Ridge mentioned in comments, port multipliers could be used. Port Multiplier is to increase the number of devices that can be attached. Again port multiplier is device connected to SATA HC port (not to Host Controller itself). One multiplier to one port. Second multiplier could be connected to other port, etc. The support of multipliers is implementation defined. Some HC could work with them, some might not. Multipliers have 16 ports. Port '0xF' is special control port of multiplier. So up to 15 devices could be connected.
So all above is about SATA specification. Considering the listed questions itself:
OS drivers could enumerate and name drives by it's own way. Like you mentioned Secondary IDE Channel or ATA Channel 1. First name more likely is legacy from drives w/ parallel interfaces. In fact the word 'channel' even is not in SATA AHCI specification. There are ports :)
Some fu... drivers could imply "software limitations" like do not support multipliers or work only with one port. Regularly update drivers.
thus providing Windows with a way to change such options like enable/disable DMA mode. Windows DMA mode has nothing to do with SATA drive. SATA Host Controller use special buffers to allocate data received from drives. DMA mode in this case more like how OS get access to these buffers but not how HC communicate with attached drives.
Also can you tell me what is the maximum number of ATA Channels that SATA controller can have?. There are ports. The number of ports is implementation defined. If you know the address of SATA Host Controller on your motherboard read CAP register, 4 low bits are Number of Ports - 1. PS: you will need a driver to get direct access to physical memory so...

snmp network discovery identify mac address of device connected to a router

i am working on a network discovery program which employs snmp to discover devices in the network. My program takes the router-ip as input, scans the iprotetable(iprouttenext hop),to determine if any other routers are connected to it. for non router devices (like switch) the algorithm scans the arptable (ipnettomediatable) of the router, but cant find the connected switch unless i ping from the switch to the router. is there any way where i can determine the device connected directly to the router ..?
Getting the devices connected to a router or switch is not that easy. Switches usually maintain a MAC forwarding database where it stores which MAC address has been seen on which switch port. This table can be easily read by using the bridge MIB. Unfortunately, there are several issues to take care of:
Those entries disappear again, when a device to the switch has been switched off or is simply not communicating. Usually, the entries in the MAC forwarding tables age out after 5 minutes or so.
The fact that a MAC address has been seen on a switch port doesn't mean that the device having the mac address is directly connected to the port. There might be any number of other switches, routers or hubs inbetween.
Some manufacturers like Cisco or HP use their own protocols to determine the network topology. There are several protocols (that area usually also available through a SNMP MIB):
CDP (Cisco Discovery Protocol): This is a proprietary protocol developed by Cisco to expose network topology information. Some vendors licensed this technology and implement that protocol in their products.
LLDP (Link Layer Discovery Protocol): A standard similar to CDP, but without paying Cisco license fees :-)
And many more. I know kthat Extreme Networks has their own protocols and I am pretty sure that other vendors have them as well.
The problem with those protocols is when you have a mixed environment. Cisco switches talking CDP do not understand Extremen Network's protocol and vica versa.
If your goal is to find IP addresses to discover, then you might use the ARP caches for routers. Scanning the ARP caches for switches makes no real sense, because they're operating on layer 2.
I was using broadcast message for my java snmp agent

how to convert RS232 communication to TCP/IP communication

I have a created hardware communicating application using RS232 protocol in MFC. But as there is problem regarding voltage signal strength, i would like to shift from RS232 to TCP/IP.
Can anyone help me on this topic...?
The solution is to extend the microcontroller board with a serial device server.
Known brands are Lantronix or Moxa, but there are many other options and manufacturers. For an "embedded" solution that is integrated on your board, the "Lantronix XPort" is a typical product.
http://www.lantronix.com/device-networking/embedded-device-servers/xport.html
(I'm not affiliated with the Lantronix company.)
The Serial Device Server will connect to your RS232 on one end, and on its TCP/Ethernet side it offers usually a TCP server. It is usually configurable via network, through a built-in web interface, much like an Internet router.
Your PC application then needs to be changed as follows: Instead of opening a Windows COM port, you need to make a TCP client connection to that server, on a preconfigured TCP port. (Lantronix has 10001 as the default TCP port for this.)
But there is also special Windows driver software that lets you talk to your Serial Device Server / your microcontroller through a "virtual COM port". This is sometimes the best solution for legacy PC applications, where you cannot change the original code and have to use a Windows COM port. For a MFC application this might be a good choice.

LAN Port as controller

i need only to get any voltage out from my laptop to control a relay
how to get a signal from a LAN port from any pin ?
in my laptop there is no com Port or lpt Port
also the usb port needs interfacing circuits which is not nessesary
in my simple project
thats why i choosed the LAN Port
i use (visual basic 6)
any help would much appriciated .
While such things as PoE exist, normal ports do not provide any power to external devices. The USB ports are far more likely candidates since they are designed to support powering external devices, though the amount of current supported varies by adapter/hub (most "ports" are actually internal hub ports).

Resources