944,148 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2564
  • C++ RSS
Dec 27th, 2006
0

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

Expand Post »
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.
Similar Threads
Reputation Points: 8
Solved Threads: 0
Newbie Poster
nuwan243 is offline Offline
15 posts
since Dec 2006
Dec 27th, 2006
0

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

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Dec 13th, 2007
0

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

Quote ...
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.

Quote ...
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() .
Reputation Points: 193
Solved Threads: 25
Posting Pro
Jishnu is offline Offline
518 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: How to delete all files in a directory
Next Thread in C++ Forum Timeline: Difference between back() & end()





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC