954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

Hi Everybody,
Im a new programmer.........
i had used the following code to output data to com port.....
#include
#include
#include
#include

#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 okk

nuwan243
Newbie Poster
15 posts since Dec 2006
Reputation Points: 8
Solved Threads: 0
 

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.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 
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() ;).

Jishnu
Posting Pro
518 posts since Oct 2006
Reputation Points: 193
Solved Threads: 25
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You