Показаны сообщения с ярлыком rs-232. Показать все сообщения
Показаны сообщения с ярлыком rs-232. Показать все сообщения

понедельник, 19 декабря 2016 г.

Automatically respawning socat.

When user disconnects from socat the process terminates, so you have to restart it.
To automate this process, you can use /etc/inittab.


Here
2345 -- is enumeration of runlevels for which process is started,
s1 -- is a unique sequence of 1-4 characters which identifies an entry in inittab.

This socat configuration is used to provide access to serial port (UART / RS-485) over TCP/IP.

понедельник, 3 октября 2016 г.

How to enumerate serial ports using Setup API (win32)

For me using setupapi is the most strait-forward method to retrieve a list of serial ports on Windows.
I should note, that this code works well on XP and higher.



Example of output:

I'm going to offer this code to guys of node-serialport, because current method doesn't work well on some setups with antivir.


Update: The patch is ready https://github.com/Zensey/node-serialport/commit/b4c8e830d248c4f7e3be0fd0d2cd56a18159f2d9


References:
1. https://social.msdn.microsoft.com/Forums/vstudio/en-US/2555943e-0c69-4357-a85b-d6540bcaaf84/using-setupapi-to-return-all-guiddevclassdisplay?forum=vcgeneral
2. http://stackoverflow.com/a/3439805
3. https://gist.github.com/Zensey/7bd7781a28d6be306be5cdd70539dc65