Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

the infraredport

injektiloinjektilo Member Posts: 113
i want to send some AT commands to my nokia mobile through the infraredport. but how to begin?

do i have to use winsock?
is it just a comm-port?
do i need drivers?
what about the nokia connection/protocol?
etc...

thanks for any help.



Comments

  • dj_sanniedj_sannie Member Posts: 92
    : i want to send some AT commands to my nokia mobile through the infraredport. but how to begin?
    :
    : do i have to use winsock?
    : is it just a comm-port?
    : do i need drivers?
    : what about the nokia connection/protocol?
    : etc...
    :
    : thanks for any help.
    :
    Hi,

    Normaly a infrared poort is a basic com poort u must be able to find this in you're settings. And the windows api has functions to read/write to a com poort.

    Opening a Com Poort,
    [code]
    // Asking a handle to com1.
    ComHandle := CreateFile( PChar( 'COM1' ),
    GENERIC_READ or GENERIC_WRITE,
    0,
    Nil,
    OPEN_EXISTING,
    0,
    0);

    // Check if windows returned a valid Handle.
    If ( ComHandle = INVALID_HANDLE_VALUE ) then
    begin
    ComHandle := 0;
    Exit;
    End;
    [/code]

    Writing to a com poort,
    [code]
    procedure WriteSomeThingToTheComPoort;
    var
    Buffer: String;
    BytesWritten: Cardinal;
    begin
    Buffer := 'Hello World';
    WriteFile( ComHandle, Buffer, Length( Buffer ), BytesWritten, nil );
    end;
    [/code]

    I hope this helps u,

    Greetz DJ Sannie.
Sign In or Register to comment.