|
|
|
|
|
|
| Author |
Message |
ctloh *nix forums beginner
Joined: 21 Jul 2006
Posts: 1
|
Posted: Fri Jul 21, 2006 8:08 am Post subject:
Problem with Win32-SerialPort over bluetooth @ windows + active perl
|
|
|
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( ;
$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 |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sun Nov 23, 2008 2:27 pm | All times are GMT
|
|
Loans | Property for sale in Spain | Loans | Best Credit Cards | Loans
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|