int value of COM11? [closed] - c++

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a RFID Reader that connect to my computer via COM.
1> When the reader connect to my computer via COM3
C++: OpenComm(3) --> OK
2> When the reader connect to my computer via COM9
C++: OpenComm(9) --> OK
3> When the reader connect to my computer via COM11
C++: OpenComm(11) --> Not work
I don't know why it not work.
OpenComm(int com) is a attached library for my RFID Reader. So, I need int value of COM11.

Assuming that you're using Windows - from the CreateFile documentation:
To specify a COM port number greater than 9, use the following syntax:
"\.\COM10". This syntax works for all port numbers and hardware that
allows COM port numbers to be specified

Related

Reading input on c++ server in real time [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want to write a server in C++, I would connect to this server via Netcat or Telnet. Server would send a menu to a client and client would navigate using the arrows to choose an option. My question is: how can I get char-messages in real time (not after clicking Enter) from client?
C++ standard library has no API for keyboard input. There is only API for streams, which do require pressing enter (or EOT).
Implementing direct keyboard input on POSIX shell is quite tricky, and I would instead recommend using an existing library.
In particular, an implementation of the curses library will have a getch function that you can poll in a loop.

How to check if a server port is open and connect from MFC [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need my CASyncSocket to check on a certain port on a host and connect to it as soon as it is available.
I am a java guy and is new to C++, I know that I can do error handling and try connecting again and again. But I am unsure how to implement this in MFC.
Any help will be highly appreciated.
As far as I know the only way to check if a server port is open is to try and connect. Use the CAsyncSocket Connect function. You get a callback (OnConnect) letting you know whether the connection attempt worked or not. If it did not work use a timer (SetTimer/WM_TIMER) to try again.
There are several CAsyncSocket example apps in MSDN.

"How To" : Listen for data coming in via RS232 to USB [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Language: C++
IDE: Microsoft Visual Studio 2010
Hardware setup:
Machine[rs232]---> [rs232 to usb] ---> [usb]Computer
Data being sent:
Result information as ascii text.
I am trying to access the ascii data that is coming in from the machine's rs232 port into the computer's usb port.
How do I open the connection and start listening for this data?
I have some experience with network programming, which was as simple as listening on the correct port# for packets from the server. But, I'm unsure what to do to listen for data coming in on usb or from rs232 for that matter... Very new to receiving data in this fashion.
The CreateFile and ReadFile APIs are used to open and read a serial port (even if it comes from USB). See the MSDN article titled "Serial Communications in Win32"

How to know if a port is open or not in Linux system [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I need to find whether a port Ex. port 8080 is opened on a Linux system. I'm looking for a C or C++ API call that will return true or false or the equivalent when given a port number. This only needs to run locally. I don't want to know if there is a process listening on the port, only that is not blocked by the firewall.
I want to do the equivalent of
if( ! IsPortOpen(8080))
cout << "please request IT to open port 8080 before running this tool";
exit(1);
}
I assume you are looking for open ports on the local machine. There are a lot of tools to do this.
One of the easier to use and understand is
lsof -i
For remote machines, try nmapor even easier and more basic netcat. For example
netcat targetHost 8080

how to write a virtual com port to TCP driver? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Hi I am trying to write a windows virtual com port driver which will divert the data to a IP address. any pointers, best practice will be of help?
I know of a Open source project called com0com which is virtual com port redirector. there is a subproject called com2tcp in that which you can look atcom0com. otherwise for windows I am not sure you have any open source available
Between there are commercially available software such as the one from Eltima and tactical software. there are few freewares too, you can search by the name comport redirector.
Check out this example of a User Mode Driver from Microsoft:
Archive.org -> Microsoft.com: Virtual serial driver sample (FakeModem)
Github.com/Microsoft : Virtual serial driver sample (FakeModem)
You can take a look at the open source project Null-modem emulator (com0com) which includes a COM port to TCP redirector.
you can look at the software development kit from Constellation Data Systems, Inc.