Problem with Win32-SerialPort over bluetooth @ windows + active perl

Discussion in 'Perl Misc' started by ctloh, Jul 21, 2006.

  1. ctloh

    ctloh Guest

    Hello guys,

    I encounter some problems with Wini32-SerialPort module. Not sure is
    this is the correct place to ask....

    Anyway...

    What I want is to setup my mobile phone as a GSM modem and connect from
    my laption using either IR or bluetooth.

    In order to do that, I need to create a "config" file for different
    comm port. However, setup the config which utilise IR did not give me
    any problem. But the bluetooth is complaining about the Baud Rate.

    Have anyone encounter this before ?

    Here is the program that actually generate the config file.

    __Start__
    use Win32::SerialPort 0.14;

    if (@ARGV ne 2) {
    print "\n\nUsage : $0 <COMM PORT> <outputfile>\nE.g $0 COM1
    abc.cfg\n";
    exit(0);
    }


    my $PortObj = new Win32::SerialPort ("$ARGV[0]" )
    || die "$0: Can't open COMM Port $ARGV[0] !\n$0: $!\n"; #
    $quiet is optional

    print "$0: Connected to $ARGV[0]...\n";
    $PortObj->user_msg(ON);

    $PortObj->databits(8);
    $PortObj->baudrate(9600);
    $PortObj->parity("none");
    $PortObj->stopbits(1);
    $PortObj->handshake("rts");
    $PortObj->buffers(4096, 4096);

    $PortObj->write_settings || undef $PortObj;


    $PortObj->save("./$ARGV[1]");


    $PortObj->baudrate(300);
    $PortObj->restart("./$ARGV[1]"); # back to 9600 baud


    $PortObj->close || die "$0: Failed to close !";
    undef $PortObj; # frees memory back to
    perl

    print "\n\n$0: Config file created in $ARGV[1].\n";

    exit(0);

    __Stop__

    Here is the error message with I try to setup a bluetooth config.

    D:\MyPerl\>perl createCommPortCfg.pl COM9 z1010-bluetooth-com9.cfg

    - Connected to COM9...
    Could not set baudrate on COM9 at createCommPortCfg.pl line 17
    Missing REQUIRED setting for BAUD at createCommPortCfg.pl line 23
    write_settings failed, closing port at createCommPortCfg.pl line 23
    Can't call method "save" on an undefined value at createCommPortCfg.pl
    line 26.


    Appreciate if anyone can help.

    Best Regards
    Chi Tsung
    ctloh, Jul 21, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. izzahmeor
    Replies:
    0
    Views:
    784
    izzahmeor
    Feb 3, 2010
  2. Stephan Kämper

    ruby-serialport on Win32

    Stephan Kämper, Feb 3, 2004, in forum: Ruby
    Replies:
    9
    Views:
    192
    Stephan Kämper
    Feb 6, 2004
  3. Stephan Kämper

    Usability of Ruby/SerialPort on Win32

    Stephan Kämper, Feb 10, 2004, in forum: Ruby
    Replies:
    0
    Views:
    115
    Stephan Kämper
    Feb 10, 2004
  4. Richard S Beckett

    Problem installing Win32::SerialPort

    Richard S Beckett, Jul 7, 2003, in forum: Perl Misc
    Replies:
    0
    Views:
    386
    Richard S Beckett
    Jul 7, 2003
  5. Schmigz

    win32::SerialPort; Sending Raw Data

    Schmigz, Jan 26, 2004, in forum: Perl Misc
    Replies:
    2
    Views:
    292
    Schmigz
    Jan 26, 2004
Loading...

Share This Page