473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Port programming

How do you programm the ports of a computer?

Say I want to send a signal thru COM1 or an USB port?

Thanks

Oct 19 '06 #1
3 2022
Gaijinco wrote:
How do you programm the ports of a computer?

Say I want to send a signal thru COM1 or an USB port?
Off-topic. Please see:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Regards,
Sumit.
Oct 19 '06 #2
Gaijinco wrote:
How do you programm the ports of a computer?

Say I want to send a signal thru COM1 or an USB port?

Thanks
You question is a little offtopic,
but here is a small hint:

Reading from a comport (windows):

ifstream InputFile("COM1");
InputFile.read(Buffer, NumberOfBytes);
InputFile.close();

On Unix, the names of the comports are like
"/dev/ttyS0" (don't know the exact name).

-Martin

Oct 20 '06 #3
Martin Steen wrote:
Gaijinco wrote:
>How do you programm the ports of a computer?

Say I want to send a signal thru COM1 or an USB port?

Thanks

You question is a little offtopic,
but here is a small hint:

Reading from a comport (windows):

ifstream InputFile("COM1");
InputFile.read(Buffer, NumberOfBytes);
InputFile.close();

On Unix, the names of the comports are like
"/dev/ttyS0" (don't know the exact name).

-Martin
A good reference for serial port programming in UNIX systems is here:

http://www.easysw.com/~mike/serial/

Vilas
Oct 21 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: rusttree | last post by:
Many moons ago, I took a class in embedded control at school. The course focused on a micro-controller mounted on a small electric car that was programmed using simple C code. The...
9
by: MNQ | last post by:
Hi All I want to use my parallel port of my PC to control some external devices. I am writing a program in ANSI C using the PacificC compiler. What I need to know is how to access the parallel...
3
by: collinm | last post by:
hi i send a command to a led display, the led display is suppose to return me some character i write a string on a serial port void ledDisplayExist() { char msg={'\0', '\0', '\0', '\0',...
13
by: Al the programmer | last post by:
I need to access the serial ports on my webserver from an asp.net page. I have no problem accessing the serial ports from a windows form application, but the code doesn't work in asp.net. I have...
5
by: Fiesta | last post by:
Hi All, I am working on a project regarding the serial COM port. I have to design my own protocol for the serial communication. In the protocol there are some bits for Read/Write, address(bank,...
23
by: Marco | last post by:
Could anyone please tell me why the program has the following error? I copy the program from http://www.beyondlogic.org/parlcd/parlcd.htm ...
38
by: shussai2 | last post by:
Hi, I am trying to access Serial Port in XP. I am using Dev-C++ IDE that uses Mingw as a compiler. I just want to know how I can open up serial port on COM1 and write some data. I have searched...
1
by: rajat varshney | last post by:
I am doing a project on controlling a stepper motor through computer parallel port over a network. I have also done parallel port programming in C but I need some help on how to send output on...
9
by: xparrot1 | last post by:
I know that I can get the SERVER port number like this: HttpContext.Current.Request.ServerVariables My question is how do I get the remote CLIENT port number? Thanks Derek
13
by: Rob | last post by:
Hi all, I am fairly new to python, but not programming and embedded. I am having an issue which I believe is related to the hardware, triggered by the software read I am doing in pySerial. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.