niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » Perl
Problem with Win32-SerialPort over bluetooth @ windows + active perl
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
ctloh
*nix forums beginner


Joined: 21 Jul 2006
Posts: 1

PostPosted: Fri Jul 21, 2006 8:08 am    Post subject: Problem with Win32-SerialPort over bluetooth @ windows + active perl Reply with quote

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(Cool;
$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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
The time now is Sun Nov 23, 2008 2:27 pm | All times are GMT
navigation Forum index » Programming » Perl
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Unknown in header problem -SOLVED- Light Speed Postfix 0 Thu Jul 03, 2008 10:40 am
No new posts problem with sending mail nuxia Postfix 0 Mon Apr 21, 2008 3:58 am
No new posts Postfix 2.3.8 Virtual problem Blotto Postfix 0 Fri Apr 04, 2008 6:11 am
No new posts Postfix sending problem for local domain remote email monkey_magix Postfix 0 Mon Sep 10, 2007 10:17 am
No new posts bounce problem murkis Postfix 0 Sun Oct 08, 2006 3:45 pm

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
[ Time: 0.2506s ][ Queries: 16 (0.1816s) ][ GZIP on - Debug on ]