Virtual COM port in C

Status
Not open for further replies.

jossion

Member level 3
Joined
Oct 19, 2005
Messages
60
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,288
Location
India
Activity points
1,658
Hi,

I need to get some very valuable help from experts in this group. I have installed a Bluetooth dongle in two of my PC's and i would like to transfer file from one PC to another. I thought of doing this way

first do all necessary connections and formalities using available bluetooth stack(like bluesoleil or Toshiba). now using a simple C program using outportb() and inportb() i will try to send some charachters via the dongle. Is this possible?

If i have to do this I will need to know the port address of the virtual COM ports created by the bluetooth stacks. Also will this virtual device behave the same way as an RS-232 port?
Thanking in advance for any help provided. Bye
 

You can find the virtual COM port number in ports section of device manager.

Yes, these ports behaves exactly like normal RS-232 ports but as per my knowledge you can't use inportb() and outportb() in windows instead you need to use communication control in Visual Basic or you need to use some third party IO libraries such as PortIO.

If your Bluetooth driver supports LAN or ftp profile you can use that as well to transfer files.
 

    jossion

    Points: 2
    Helpful Answer Positive Rating
thanks for the information. I have the software for file transfer. But I am trying to make my application work on it. Thats why I need this information. I am not familiar with Visual Basic. May I know whether there are some functions which will access the ports with their informations available in the registry. Also can i get those RS-232 sort of registers such as LSR,MCR,IER etc. in Virtual COM ports also.
 

Visual Basic communication control works at quite high level so you will not be able to access and you don't need to access any registers. There is lot of material available on web for using Comm Control in Visual baisc. Just search for MSComm in google.

If you want more control then visual basic refer to this link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp

some more resources are available on **broken link removed** as well.
 

    jossion

    Points: 2
    Helpful Answer Positive Rating
thanks for the valuable information
 

you can't use inportb() and outportb() in windows,but you can try to access vitural COMM by windows API.
check microsoft MSDN for more information.
or Search www.google.com by keyword:CreateFile CloseHandle ReadFile WriteFile
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…