1 ############################################################################
2 # operator - a gcom script for viewing and selecting networks
4 # An example of how you might do operator selection when travelling
5 # in a foreign country.
6 # Big ToDo - improve the interface!!!
8 # Copyright (C) 2003 Paul Hardwick <paul@peck.org>
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 ###########################################################################
26 ############################################################################
27 # $Id: gcom.h 10 2006-01-04 12:40:44Z paul $
28 # $HeadURL: http://10.0.0.4/svn/gcom/gcom.h $
29 ############################################################################
36 waitfor 20 "+COPS=?","Error"
37 if % = -1 goto timeout
39 print "Error response from device\n"
43 print "Getting Operator list: "
47 if % = -1 goto stillwaiting
50 print $s,"\n\n==============================================================\n"
51 print "Format: (Access,Long Name, Short Name, Network ID [,Technology])\n"
52 print "Access: 2 - Registered, 1 - Available, 3 - Forbidden\n"
53 print "Technology: 0 - GSM/GPRS, 2 - UMTS (Not available on all cards)\n"
54 print "\nEnter the Network ID to attempt manual registration\n [blank = automatic selection]:"
59 if $a = "" goto automatic
60 let $b="AT+COPS=1,2,\""+$a
69 if % = -1 goto timeout
70 if % = 2 goto failedreg
71 print "Registration request accepted\n"
72 print "Command was: ",$b,"\n"
75 print "Registration request refused\n"
76 print "Command was: ",$b,"\n"
79 if c > 60 goto timeout
83 print "Network Search Timeout\n"