How to use a serial port to transmit a given file From one computer to another.......

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2006
Posts: 15
Reputation: nuwan243 is an unknown quantity at this point 
Solved Threads: 0
nuwan243 nuwan243 is offline Offline
Newbie Poster

How to use a serial port to transmit a given file From one computer to another.......

 
0
  #1
Dec 27th, 2006
Hi Everybody,
Im a new programmer.........
i had used the following code to output data to com port.....
#include<iostream.h>
#include<conio.h>
#include<dos.h>
#include<bios.h>

#define SETTINGS (_COM110|_COM_CHR7|_COM_STOP1|_COM_NOPARITY)
void main()
{
clrscr();
_bios_serialcom(_COM_INIT,0,SETTINGS);
outportb(0x03f8,0);
getch();
}

when i run the programme,when i connect pin 3(tx pinn) to a LED it blinks one tym..........

so how can i tx a file..............

how can transmit relevent characters in binary....(how to convert it to binary........)

how i can use inportb() methord?

Please help me.............................

if u know more details please tell me........
if u got more teaching meterials please mail to <email address snipped> okk
Last edited by ~s.o.s~; Dec 27th, 2006 at 1:12 pm. Reason: Posting email address in your posts is against the forum policy.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: How to use a serial port to transmit a given file From one computer to another.......

 
0
  #2
Dec 27th, 2006
There are many libraries that will do all the hard work for you, requiring just a stream of bytes as input and producing a stream of bytes as output on the other end.

But you can indeed do it all yourself, by taking each byte, pulling it apart into bits, and pumping it over the connection like you did that single blip.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 514
Reputation: Jishnu will become famous soon enough Jishnu will become famous soon enough 
Solved Threads: 26
Jishnu's Avatar
Jishnu Jishnu is offline Offline
Posting Pro

Re: How to use a serial port to transmit a given file From one computer to another.......

 
0
  #3
Dec 13th, 2007
how i can use inportb() methord?
See in the help section. It needs the port id as the argument and returns the byte received at that port.

But, it would definitely be easier to use the libraries as jwenting suggested.

If your purpose is just to transmit or receive a file, use hyperterminal instead. It will do all the low-level stuff on its own.

this program cannot use in Microsoft visual c++
Specify the errors you encounter.

Don't use old style header files. And yes, void main() must be replaced by int main() .
"You know you're a computer geek when you try to shoo a fly away from the monitor screen with your cursor. That just happened to me. It was scary." - Juuso Heimonen.

"The only truly secure computer is one buried in concrete, with the power turned off and the network cable cut." - Anonymous.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2209 | Replies: 2
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC