Link to home
Start Free TrialLog in
Avatar of llanos
llanos

asked on

send and recieve info over a com port

I am looking for C++ (or dos)source code to send and receive info over a com port. How do I acces and turn on the com port and set the baud rate? Specifically on an HP200lx palmtop computer. I am trying to download information to the palmtop, the program is very low level and the dos interupt is not working. It is intended for a CMT datalogger but I am trying to adapt it to the HP, and it needs the COM port address.

Thanks,
Antonio Llanos  
Avatar of viktornet
viktornet
Flag of United States of America image

I'm not sure if this is what you are looking for but still....i hope it's a bit helpful
To read a port...
//This is assembler for Delphi
function ReadPortB( wPort : Word ) : Byte;
begin
  asm
    mov dx, wPort
    in al, dx
    mov result, al
   end;
end;
//To write to a Port
//This one is assembler for Delphi too..I mean the function is implemented with Delphi code
procedure WritePortB( wPort : Word; bValue : Byte );
begin
  asm
    mov dx, wPort
    mov al, bValue
    out dx, al
  end;
end;

Hope this helps ;-)

Regards,
Viktor Ivanov
ASKER CERTIFIED SOLUTION
Avatar of ZifNab
ZifNab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of llanos
llanos

ASKER

Thanks, I will check the URLs, I am really looking for something in C++ but that was my
mistake for posting on the Delphi area, I am new at this.