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