| 1 |
#!/usr/bin/perl |
| 2 |
|
| 3 |
# $Id: cellcom.pl,v 1.1 2003/04/16 12:24:20 joko Exp $ |
| 4 |
# $Log: cellcom.pl,v $ |
| 5 |
# Revision 1.1 2003/04/16 12:24:20 joko |
| 6 |
# initial commit |
| 7 |
# |
| 8 |
|
| 9 |
|
| 10 |
# cellcom - or Cellular2Pim |
| 11 |
# for requirements, features and todos see cellrap.pl |
| 12 |
|
| 13 |
|
| 14 |
use strict; |
| 15 |
use warnings; |
| 16 |
|
| 17 |
use lib '../../../libs'; |
| 18 |
|
| 19 |
use Data::Dumper; |
| 20 |
use Data::Storage::Handler::Cellphone; |
| 21 |
|
| 22 |
my $cellular = Data::Storage::Handler::Cellphone->new( baudrate => 115200, command_type => 'GSM' ); |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
# toggle command echo mode on/off |
| 27 |
#$cellular->send('ATE0' . "\r\n"); |
| 28 |
#$cellular->send('ATE1' . "\r\n"); |
| 29 |
|
| 30 |
# send dummy AT |
| 31 |
#$cellular->send('AT' . "\r\n"); |
| 32 |
|
| 33 |
# query vendor/manufacturer info |
| 34 |
#$cellular->send('AT+CGMI' . "\r\n"); |
| 35 |
|
| 36 |
# model id code |
| 37 |
#$cellular->send('AT+CGMM' . "\r\n"); |
| 38 |
|
| 39 |
# gsm telephone version |
| 40 |
#$cellular->send('AT+CGMR' . "\r\n"); |
| 41 |
|
| 42 |
|
| 43 |
# query the cellulars clock |
| 44 |
#$cellular->send('AT+CCLK?' . "\r\n"); |
| 45 |
#$cellular->send('AT+CCLK?' . "\r\n"); |
| 46 |
|
| 47 |
# query the serial number (IMEI) |
| 48 |
#$cellular->send('AT+CGSN' . "\r\n"); |
| 49 |
#$cellular->send('AT+GSN' . "\r\n"); |
| 50 |
$cellular->send('GSN'); |
| 51 |
|
| 52 |
# phone status |
| 53 |
#$cellular->send('AT+CPAS' . "\r\n"); |
| 54 |
|
| 55 |
# price per unit |
| 56 |
#$cellular->send('AT+CPUC?' . "\r\n"); |
| 57 |
|
| 58 |
# query capabilities |
| 59 |
#$cellular->send('AT+GCAP' . "\r\n"); |
| 60 |
|
| 61 |
# sms stuff |
| 62 |
#$cellular->send('AT^SMGL=4' . "\r\n"); |
| 63 |
#$cellular->send('AT^SMGR=3' . "\r\n"); |
| 64 |
|
| 65 |
# off |
| 66 |
#$cellular->send('AT^SMSO' . "\r\n"); |
| 67 |
|
| 68 |
# database access |
| 69 |
#$cellular->send('AT^SDBR=90' . "\r\n"); |
| 70 |
|
| 71 |
# output signal quality |
| 72 |
#$cellular->send('AT+CSQ' . "\r\n"); |
| 73 |
|
| 74 |
# telephone book access |
| 75 |
#$cellular->send('AT+CPBR=93' . "\r\n"); |
| 76 |
|
| 77 |
# play signal tone |
| 78 |
#$cellular->send('AT^SPST=0,1' . "\r\n"); |
| 79 |
|
| 80 |
# use GSM charset |
| 81 |
#$cellular->send('AT+CSCS=GSM' . "\r\n"); |
| 82 |
#$cellular->send('AT+CSCS=UCS2' . "\r\n"); |
| 83 |
|
| 84 |
# organizer database (vcalendar entries in hex) |
| 85 |
# > AT^SBNW=? |
| 86 |
# ^SBNW: ("bmp",(0-3)),("mid",(0-5)),("vcf",(0-500)),("vcs",(0-50)),("t9d",(0)),("bmx",(4)) |
| 87 |
#$cellular->send('AT^SBNW=?' . "\r\n"); |
| 88 |
#$cellular->send('AT^SBNR="vcs",3' . "\r\n"); |
| 89 |
#$cellular->send('AT^SBNR="bmp",2' . "\r\n"); |
| 90 |
#$cellular->send('AT^SBNR="vcf",55' . "\r\n"); |
| 91 |
#$cellular->send('AT^SBNR="vcf",40' . "\r\n"); |
| 92 |
#$cellular->send('AT^SBNR="vcf",124' . "\r\n"); |
| 93 |
#$cellular->send('AT^SBNR="vcf",125' . "\r\n"); |
| 94 |
|
| 95 |
# phonebook -search and -lookup ... |
| 96 |
# ... by letter |
| 97 |
#$cellular->send('AT^SPBC=K' . "\r\n"); |
| 98 |
#$cellular->send('AT^SPBC=K' . "\r\n"); |
| 99 |
# ... by index |
| 100 |
#$cellular->send('AT^SPBG=38' . "\r\n"); |
| 101 |
|
| 102 |
# select different telephone book |
| 103 |
#$cellular->send('AT^SPBS=?' . "\r\n"); |
| 104 |
#$cellular->send('AT^SPBS=MC' . "\r\n"); |
| 105 |
#$cellular->send('AT^SPBG=?' . "\r\n"); |
| 106 |
#$cellular->send('AT^SPBC=?' . "\r\n"); |
| 107 |
|
| 108 |
#$cellular->send('AT^SPBS=CS' . "\r\n"); |
| 109 |
#$cellular->send('AT^SPBG=38' . "\r\n"); |
| 110 |
|
| 111 |
$cellular->response_read(); |
| 112 |
|
| 113 |
|
| 114 |
$cellular->send('SDBR=90', 'SIEMENS'); |
| 115 |
$cellular->response_read(); |
| 116 |
|
| 117 |
1; |
| 118 |
__END__ |