4 # Copyright (C) 2008, Andy Herkey <a.herkey@comcast.net>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 # See the GNU General Public License in the COPYING file at the
16 # root directory of this project for more details.
21 # The purpose of this script is to try a large batch of known AT
22 # commands, and report which ones work with your Blackberry
23 # modem / provider. There will be output written to stdout
24 # as well as a file created in /tmp/modemtest.log which holds
25 # the raw pppob traffic log.
28 #Change the $PPP variable to point to where pppob is installed.
29 $PPP="/usr/local/sbin/pppob -vP xxxxx -l /tmp/modemtest.log"
35 @connectionHandle = IO.popen( $PPP,"w+" )
42 @connectionHandle.write( data )
47 return nil if @connectionHandle.closed?
49 while input = IO.select([@connectionHandle],nil,nil,1)
50 c = @connectionHandle.getc
51 @ioBuffer << c if c != nil
52 return if ! @connecting
55 break if timeout >= 9000
65 # Note: AT+CLAC should list all available commands
113 puts("Testing the Blackberry Modem by sending AT commands through pppob.")
114 printf("Starting %s: %s",$PPP,modem.read())
115 puts("--------------------------------------------")
119 printf("Command: %s \nResult: %s",c,modem.read())
120 puts("--------------------------------------------")