论坛风格切换切换到宽版
  • 8073阅读
  • 33回复

可以用89C51来控制NOKIA手机收发短消息,来电识别了. [复制链接]

上一主题 下一主题
离线bd7bq
 
发帖
1491
只看楼主 倒序阅读 0楼 发表于: 2003-12-30
最近在实验用89c51控制nokia手机,是用nokia的f-bus来通信的.协议找不到现成的,是根据一些零星的资料不断的试和琢磨出来的.像来电识别,收发短消息等功能已经在pc机上模拟成功了.用89c51实现短消息的编码和输出也实验通过了.但是就是没有22.1184m的晶体,没有办法实现115.2k速率,所以还没有能够直接用89c51接n6110.
程序需要的数据空间比较大一些,所以89c51要外接ram,我的实验板上没有扩展ram,花了点时间来做了一块板,刚做好就找到一个ic卡读卡器,上面正好有扩展ram空间的.改一改就可以用,刚刚在89c51上调试通过sms的编码实验.估计换一个22.1184的晶体接上n6110就可以发短消息了.
刚学单片机,希望有兴趣的朋友来探讨.请高手指点.
新年要到了,祝愿大家万事如意!73
离线ooi
发帖
1551
只看该作者 1楼 发表于: 2003-12-30
好啊,努力
离线迷思
发帖
2388
只看该作者 2楼 发表于: 2003-12-30
支持!
离线ljchip
发帖
459
只看该作者 3楼 发表于: 2003-12-31
我1年前做过了的。
nokia5110与6110协议是一样的。
bg5sbh
离线migrant
发帖
65
只看该作者 4楼 发表于: 2003-12-31
厉害厉害
有协议吗?可不可以给我发一个协议?
离线BD4VNF
发帖
1208
只看该作者 5楼 发表于: 2004-01-04
我也感兴趣,想要点资料研究研究.hyolin@163.com
离线bd7bq
发帖
1491
只看该作者 6楼 发表于: 2004-01-09
装上个22.1184的晶体,刚才已经实验成功可以发送短信了.资料,我可还在摸索中.协议的来源有几个方面,(1)网上一些零星的资料,(2)对gsm协议的分析,(3)监测别人的用电脑控制收发短信的报文以及自己很多次的实验.有人感兴趣吗?大家一起分享分享.
离线何成
发帖
121
只看该作者 7楼 发表于: 2004-01-10
强,呵呵!
离线bd7bq
发帖
1491
只看该作者 8楼 发表于: 2004-01-10
最初由 何成 发表
强,呵呵!


你怎么就到家了吗?不是说昨天晚上的车吗?怎么凌晨一点多在线上啊,昨天晚上何俊将中继恢复上去了,没有听到你的声音。想你应该是回去了。
离线quark
发帖
83
只看该作者 9楼 发表于: 2004-01-11
nokia 6110 serial protocol

here are some of the details that i've observed while monitoring the protocol nokia cellular data suite uses to talk over a serial cable to the 6110. the information is fairly sketchy at the moment with lots of gaps, especially in the basic frame format. it is, however, a start.

snooping was performed over a wired connection. it is assumed that if infra red is used that much the same data is sent, but it may be wrapped up in a low level irda format.

serial communication

speed: 115.2 kbps
bits: 8
parity: none
stopbits: 1
unlike the 21xx series and nokia cellularware, data is sent over the fbus which has both rx and tx lines.
basic packet format

in a similar manner to the 21xx protocol. packets sent from the 'phone must be acknowledged by the pc via a special packet and vice versa.

most communication takes the form of:

pc sends some type of "request" or command packet
6110 sends an acknowledgement
6110 sends some response to the request packet
pc sends acknowledgment
format of packets from pc:
+--+--+--+----+--+---+----------+-+--+--+----+----+
|1e|00|0c|type|00|len|...body...|n|sq|0?|   chk   |
+--+--+--+----+--+---+----------+-+--+--+----+----+

type: some indication of message type:
    ( 1, 2, 4, 10, 11, 13, 14, 64 seen)
len:   length in bytes from following byte to sq inclusive
n:   if this packet is part of a group (i.e. long sms) indicates
    how many more messages, including this one, there are
sq:   packet sequence number,
    least significant nibble: incremented in range 0..7 for each
                      new packet
    most significant nibble: ? seems to be normally 4, but appears
                    to be 0 if this is not the first packet
                    in a group. 6 has also been seen
0?:   0x00, only included if len is odd
chk:   16 bit xor of all preceding 16 bit words

format of ack from pc:
+--+--+--+--+--+---+----+--+----+----+
|1e|00|0c|7f|00|len|type|sq|   chk   |
+--+--+--+--+--+---+----+--+----+----+

type: corresponds to original message type
len:   length in bytes, always 2
sq:   last 3 bits indicate sequence number of packet being
    acknowledged, most significant nibble is normally 0,
    8 for sequence error?
chk:   16 bit xor of all preceding 16 bit words.



format of packets from 6110:
+--+--+--+----+--+---+----------+-+--+--+----+----+
|1e|0c|00|type|00|len|...body...|n|sq|0?|   chk   |
+--+--+--+----+--+---+----------+-+--+--+----+----+

type: some indication of message type
    (1, 2, 4, 10, 11, 13, 14, 64 observed)
len:   length in bytes from following byte to id inclusive
n:   if this message is part of a group (i.e. long sms) indicates
    how many more messages, including this one, there are
sq:   packet sequence number,
    least significant nibble: incremented in range 0..7 for each
                      new packet
    most significant nibble: ? seems to be 4 normally, but appears
                    to be 0 if this is not the first packet
                    in a group. 6 has also been seen
0?:   00, only included if len is odd
chk:   16 bit xor of all preceding 16 bit words.


format of ack from 6110:
+--+--+--+--+--+---+----+--+----+----+
|1e|0c|00|7f|00|len|type|sq|   chk   |
+--+--+--+--+--+---+----+--+----+----+

type: corresponds to original message type
len:   length in bytes, always 02
sq:   last 3 bits indicate sequence number of packet being
    acknowledged, most significant nibble is normally 0,
    8 for sequence error?
chk:   16 bit xor of all preceding 16 bit words.


format of sms-submit from pc:

referring to gsm 03.40 will make the following fields
clearer. it should be noted that the format of the data
in this packet is different to the sms-submit tpdu. the fields
are, however, the same. gsm 03.38 shows how the message itself
is packed. this packet format is only valid as long as len < 0x41
if the message length would force the packet to be longer then the
message is split across multiple packets. i'll post that
information shortly.
                         
+--+--+--+--+--+---+--+--+--+--+--+--+--+--+-------+--+--+--+--+
|1e|00|0c|02|00|len|00|01|00|01|02|00|sl|st|..sca..|fo|00|pi|dc|
+--+--+--+--+--+---+--+--+--+--+--+--+--+--+-------+--+--+--+--+

+--+--+--+--------+------+---------+--+--+--+-------+
|ml|dl|dt|...da...|..vp..|...msg...|01|sq|0?| chk |
+--+--+--+--------+------+---------+--+--+--+-------+

len: packet length from following byte to sq inclusive
sl:   smsc number len in octets including st
st:   smsc number type e.g. 0x81-unknown 0x91-international 0xa1-national
sca: smsc number. this is packed in bcd format ie. 2 digits per octet
    it is a 10 byte field whether the number is 20 digits or not.
fo:   first octet of tpdu, holds flas such as validity period format
pi:   pid, protocol id
dc:   dcs, data coding scheme
ml:   message length in 7 bit chars
dl:   destination address (da) length in used semi-octets,
dt:   da type eg. 81-unknown 91-international a1-national
da:   destination number packed as bcd ie. 2 digits per octet
    this is a 10 byte field. unused octets can sometimes hold
    rubbish.
vp:   validity period (1 integer byte or 7 octets - vpf) 7 byte field
msg: 7 bit chars packed into bytes (see gsm 03.38)
sq:   packet sequence number,
    least significant nibble: incremented in range 0..7 for each
                      new packet
    most significant nibble: ? seems to be 4 normally, but appears
                    to be 0 if this is not the first packet
                    in a group. 6 has also been seen
0?:   pad bye, only present if len is odd
chk: 6 bit xor of all preceding 16 bit words.

example:

sms sent to 987654321 via smsc 12345678. first octet of tpdu
(fo) = 0x11, validity period (vp) = 0xa7,
data coding scheme (dcs) = 0 and protocol identifier (pid) = 0.
message reads "hello" - 0xe8 0x32 0x9b 0xfd 0x06 in packed format:

1e 00 0c 02 00 31 00 01 00 01 02 00 06 81 21 43 65 87 f9 63 a8 00 00
00 11 00 00 00 05 09 81 89 67 45 23 f1 b8 81 20 15 63 a7 00 00 00 00
00 00 e8 32 9b fd 06 01 44 00

phonebook packet format

in the following descriptions, me = mobile equipment (i.e. the phone or it's memory) and sm = sim card.

pc reading phonebook entry:
+--+--+--+--+--+---+--+--+--+--+--+--+--+--+--+--+---+
|1e|00|0c|03|00|len|00|01|00|01|st|ix|00|01|sq|0?|chk|
+--+--+--+--+--+---+--+--+--+--+--+--+--+--+--+--+---+

st:   storage type e.g. 02-me 03-sm etc.
ix:   index

e.g. to read location with index 1 from the sim:
1e 00 0c 03 00 09 00 01 00 01 03 01 00 01 46 00 57 0a

6110 responding to a phonebook read:
+--+--+--+--+--+---+--+--+--+--+--+--+----+--+---+--+--+--+--+--+---+
|1e|0c|00|03|00|len|01|08|00|02|00|tl|text|nl|num|05|00|01|sq|0?|chk|
+--+--+--+--+--+---+--+--+--+--+--+--+----+--+---+--+--+--+--+--+---+

tl:   name text length
text: entry name text in ascii
nl:       number len (in digits)
num: number in ascii

e.g. response to reading sim location 1 containing
  "action line", 0345888444:
1e 0c 00 03 00 20 01 08 00 02 00 0b 41 63 74 69 6f 6e 20 4c 69 6e 65
0a 30 33 34 35 38 38 38 34 34 34 05 00 01 44 5d 18

reading empty location 1 from the phone returns (as expected):
1e 0c 00 03 00 0b 01 08 00 02 00 00 00 05 00 01 47 00 58 0a
i.e. text and number lengths are 0 and there are no actual text
  or number fields

pc writing a phonebook entry:
+--+--+--+--+--+---+--+--+--+--+--+--+--+----+--+---+--+--+--+--+---+
|1e|00|0c|03|00|len|00|01|00|04|st|ix|tl|text|nl|num|ff|01|sq|0?|chk|
+--+--+--+--+--+---+--+--+--+--+--+--+--+----+--+---+--+--+--+--+---+

st:   storage type 02-me 03-sm etc.
ix:   index
tl:   name text length
text: entry name text in ascii
nl:       number len (in digits)
num: number in ascii

e.g. writing an entry "test", 1234 to location index 2 to the phone memory:
1e 00 0c 03 00 13 00 01 00 04 02 02 04 54 65 73 74 04 31 32 33 34 ff 01 47 00 bf 33


6110 responding to phonebook write:

success:            
1e 0c 00 03 00 06 01 08 00 05 01 46 1e 42
                  ^^-indicates success?

failure due to index being out of range:
1e 0c 00 03 00 07 01 08 00 06 74 01 43 00 28 07
    indicates failure---^^ ^^--indicates reason?


pc requesting storage parameters:
+--+--+--+--+--+---+--+--+--+--+--+--+--+--+---+
|1e|00|0c|03|00|len|00|01|00|07|st|01|sq|0?|chk|
+--+--+--+--+--+---+--+--+--+--+--+--+--+--+---+

st:   storage type

e.g. requesting parameters for the sim card:
1e 00 0c 03 00 07 00 01 00 07 03 01 43 00 52 03

6110 responding with storage parameters:
+--+--+--+--+--+---+--+--+--+--+--+--+--+--+--+--+---+
|1e|0c|00|03|00|len|01|08|00|08|st|fr|us|01|sq|0?|chk|
+--+--+--+--+--+---+--+--+--+--+--+--+--+--+--+--+---+

st:   storage type
fr:   number of free locations
us:   number of used locations

e.g. responding for the sim storage which has 90 locations
  59 of which are used:
1e 0c 00 03 00 09 01 08 00 08 03 1f 3b 01 43 00 64 18
离线bd3vk
发帖
36
只看该作者 10楼 发表于: 2004-05-08
太棒了!我也在做gps+gsm+sms系统。希望交流。
离线bd4acw
发帖
862
只看该作者 11楼 发表于: 2004-05-08
'
太棒了!我也在做gps+gsm+sms系统。希望交流。
'

我以前玩过garmin15/25 + tc-35/mc35
但程序是人家的,没尽!
如自己是diy的那味道就不一样咯!
73!de bd4acw
离线bd7bq
发帖
1491
只看该作者 12楼 发表于: 2004-05-08
我用epson的gps加tc35,目前实验已经可以实现指定号码呼入的自动监听,指定号码的中文短消息查询gps位置,和位置变化的设防报警。欢迎交流。
离线ahzds
发帖
7423
只看该作者 13楼 发表于: 2004-05-09
不错!!希望继续努力!如能公开资料最好了!
离线BD4VNF
发帖
1208
只看该作者 14楼 发表于: 2004-05-09
楼主能搞到n6610的液晶显示屏吗?听说不到20圆在昆明能买到
离线bd7bq
发帖
1491
只看该作者 15楼 发表于: 2004-05-09
n6610的lcd可是彩屏啊!20元可以买到吗?是不是n6110的?
离线BD4VNF
发帖
1208
只看该作者 16楼 发表于: 2004-05-11
是彩屏的.在某个论坛上有人就是这么说的.我不是行内人士,所以问问大家.我有彩屏的应用资料.
离线7ieh
发帖
378
只看该作者 17楼 发表于: 2004-05-11
能给点电路资料吗?我有一块5110的裸板想玩玩。
离线BD4VNF
发帖
1208
只看该作者 18楼 发表于: 2004-05-11
离线BD4VNF
发帖
1208
只看该作者 19楼 发表于: 2004-05-11
我记错了.好不容易找到原贴,地址在上面