NOKIA、MOTOROLA、SIMENS及ERICCSON铃声和图片格式分析

NOKIA、MOTOROLA、SIMENS等

发布时间:20040524  点击数:1197  作者:syy007   转载出处:天堂鸟 录入:web

<script language=javascript src="../Include/ubb.js" type=text/javascript></script> <script language=javascript type=text/javascript> document.write(ubbcode("NOKIA、MOTOROLA、SIMENS及ERICCSON铃声和图片格式分析

最近一直有些朋友们要求总结一下主流手机铃声和图片的问题,由于本人在这方面基本没有什么尝试,只能将有些朋友们发表过的东西总结一下。这些总结中有已经实现的,有些还是在摸索中的,希望大家能根据提供的资料多试试,成功后能将自己的经验与大家分享。这些总结针对的是SP与梦网短信网关之间传输的格式,至于通过其它方式发送的格式,我也不知道能不能套用。:(

NOKIA:
铃声和图片的格式有资料详细介绍,有兴趣的最好还是去看看他的smartmessage。
在CMPP的CMPP_SUBMIT包里,其Msg_Content由两部分组成,头和内容

铃声:0x6 0x5 0x4 0x15 0x81 0 0(头) + 铃声二进制内容
图片:0x6 0x5 0x4 0x15 0x82 0 00x64 0xf0 0(头) + 图片二进制

铃声和图片的编辑工具及将文本转换成二进制文件的工具,请在论坛的“资源共享”里查找


Motorola铃声:(由iStudy提供)
在CMPP的CMPP_SUBMIT包里,其Msg_Content由|<-Header ->|<-Tempo value->|<-Musical Data -> |<-Delimiter->|Checksum->|组成

field binary data ascii data
-------------------------------------------------------------------------------------
Header: 4c 33 35 26 -->/"L35&/"
Tempo value: 32 20 -->/"2 /"
Musical Data: 43 2d 32 20 43 23 2d 32 20 44 2d 32 20 -->/"C-2 C#-2 D-2 /"
Delimiter: 26 26 -->/"&&/"
Checksum: 35 38 -->/"58/"
-------------------------------------------------------------------------------------
最终发送的二进制流为:4c3335263220432d322043232d3220442d322026263538

要注意的是校验位的计算,是所有Musical Data 异或后的值,然后拆分转换而来得,如果checksum计算不正确则手机接收后是些非法字符的普通消息。下面的文档中算法很详细。

Header: L35& This is a constant string for all musical tone SMS. [By using 'Send As SMS'
option user can send composed Ringer Tone to other compatible Motorola phone. To
differentiate Music SMS from Normal SMS, special header is attached.]
Tempo Value: This is either 1 or 2 or 3 or 4 followed by a space(e.g. “2 “). Default is 2.
Musical Data : It consists of 1 or more notes, subject to a maximum of 35 Notes , the format
of which is given below.
Delimiter : && This represents the end of musical notes in the tone.
Checksum : Two bytes. The algorithm for calculation of the checksum is given below.

Step1: Calculate one byte XOR sum of the all the bytes of the musical data starting after
the space in the tempo value(not including space) till the && (not inclusive of &&). Let
us say this is XY.
Step 2: Separate X and Y into two bytes X0 and 0Y.
Step 3: Take 0Y and add hex 30. This becomes 3Y. Call this byte 1.
Step 4: Take X0 and shift right by 4 bits. This becomes 0X.
Step 5: Add hex 30 to 0X. This becomes 3X. Call this byte 2.
Step 6: Two byte checksum is <byte 2><byte1>


SIMENS铃声:(由hello008提供)
可能hello008还没有完全试成功,所以有兴趣的朋友还是多参见他提供的相关文档,多多测试和分析一下,成功了一定要告诉我一下喔!
在CMPP的CMPP_SUBMIT包里,其Msg_Content由
2f 2f 53 45 4f:头
1:版本
6b 0:数据段长度
7 11 9 17:类似序列号
6 0:第6个数据包
8 0:共8个数据包
f7 2 0 0:mid文件大小
3 6d 69 64:3mid
8:文件名长度
65 31 33 39 2e 6d 69 64:文件名
。。。:数据


ERICSSON铃声:
是我从网关上截取分析出来的,没有实际试过。
在CMPP的CMPP_SUBMIT包里,其Msg_Content由
其格式是:
binary data ascii data
---------------------------------------------------------
42 45 47 49 4e 3a 45 4d 45 4c 4f 44 59 0a -->BEGIN:EMELODY+换行符(0x0a)
45 52 53 49 4f 4e 3a 31 2e 30 0a -->VERSION:1.0+换行符(0x0a)
4d 45 4c 4f 44 59 3a数据内容0a -->MELODY:+内容++换行符(0x0a)
45 4e 44 3a 45 4d 45 4c 4f 44 59 -->END:EMELODY
-------------------------------------------------------------

大概就这么多吧,剩下的大家要么看文档要么试成功后把自己的经验共享一下。
在这里我并没有对CMPP_SUBMIT中同铃声和图片相关的几个字段如tp_udhi,Msg_Fmt做出说明,主要是各网关厂商对它们在处理上也不一样,如对tp_udhi,有的要求填0,有的要求填1,有的则要求填0x40。所以在调试时,最好询问一下网关的开发人员,来确定具体的值。


*******如需转载,请注明出处*************
*******asp.7i24.com/yjack*************
")); </script> NOKIA、MOTOROLA、SIMENS及ERICCSON铃声和图片格式分析

最近一直有些朋友们要求总结一下主流手机铃声和图片的问题,由于本人在这方面基本没有什么尝试,只能将有些朋友们发表过的东西总结一下。这些总结中有已经实现的,有些还是在摸索中的,希望大家能根据提供的资料多试试,成功后能将自己的经验与大家分享。这些总结针对的是SP与梦网短信网关之间传输的格式,至于通过其它方式发送的格式,我也不知道能不能套用。:(

NOKIA:
铃声和图片的格式有资料详细介绍,有兴趣的最好还是去看看他的smartmessage。
在CMPP的CMPP_SUBMIT包里,其Msg_Content由两部分组成,头和内容

铃声:0x6 0x5 0x4 0x15 0x81 0 0(头) + 铃声二进制内容
图片:0x6 0x5 0x4 0x15 0x82 0 00x64 0xf0 0(头) + 图片二进制

铃声和图片的编辑工具及将文本转换成二进制文件的工具,请在论坛的“资源共享”里查找


Motorola铃声:(由iStudy提供)
在CMPP的CMPP_SUBMIT包里,其Msg_Content由|<-Header ->|<-Tempo value->|<-Musical Data -> |<-Delimiter->|Checksum->|组成

field binary data                  ascii data
-------------------------------------------------------------------------------------
Header: 4c 33 35 26                 -->"L35&"
Tempo value: 32 20                  -->"2 "
Musical Data: 43 2d 32 20 43 23 2d 32 20 44 2d 32 20 -->"C-2 C#-2 D-2 "
Delimiter: 26 26                   -->"&&"
Checksum: 35 38                   -->"58"
-------------------------------------------------------------------------------------
最终发送的二进制流为:4c3335263220432d322043232d3220442d322026263538

要注意的是校验位的计算,是所有Musical Data 异或后的值,然后拆分转换而来得,如果checksum计算不正确则手机接收后是些非法字符的普通消息。下面的文档中算法很详细。

Header: L35& This is a constant string for all musical tone SMS. [By using 'Send As SMS'
option user can send composed Ringer Tone to other compatible Motorola phone. To
differentiate Music SMS from Normal SMS, special header is attached.]
Tempo Value: This is either 1 or 2 or 3 or 4 followed by a space(e.g. “2 “). Default is 2.
Musical Data : It consists of 1 or more notes, subject to a maximum of 35 Notes , the format
of which is given below.
Delimiter : && This represents the end of musical notes in the tone.
Checksum : Two bytes. The algorithm for calculation of the checksum is given below.

Step1: Calculate one byte XOR sum of the all the bytes of the musical data starting after
the space in the tempo value(not including space) till the && (not inclusive of &&). Let
us say this is XY.
Step 2: Separate X and Y into two bytes X0 and 0Y.
Step 3: Take 0Y and add hex 30. This becomes 3Y. Call this byte 1.
Step 4: Take X0 and shift right by 4 bits. This becomes 0X.
Step 5: Add hex 30 to 0X. This becomes 3X. Call this byte 2.
Step 6: Two byte checksum is <byte 2><byte1>


SIMENS铃声:(由hello008提供)
可能hello008还没有完全试成功,所以有兴趣的朋友还是多参见他提供的相关文档,多多测试和分析一下,成功了一定要告诉我一下喔!
在CMPP的CMPP_SUBMIT包里,其Msg_Content由
2f 2f 53 45 4f:头
1:版本
6b 0:数据段长度
7 11 9 17:类似序列号
6 0:第6个数据包
8 0:共8个数据包
f7 2 0 0:mid文件大小
3 6d 69 64:3mid
8:文件名长度
65 31 33 39 2e 6d 69 64:文件名
。。。:数据


ERICSSON铃声:
是我从网关上截取分析出来的,没有实际试过。
在CMPP的CMPP_SUBMIT包里,其Msg_Content由
其格式是:
binary data                  ascii data
---------------------------------------------------------
42 45 47 49 4e 3a 45 4d 45 4c 4f 44 59 0a -->BEGIN:EMELODY+换行符(0x0a)
45 52 53 49 4f 4e 3a 31 2e 30 0a     -->VERSION:1.0+换行符(0x0a)
4d 45 4c 4f 44 59 3a数据内容0a      -->MELODY:+内容++换行符(0x0a)
45 4e 44 3a 45 4d 45 4c 4f 44 59     -->END:EMELODY
-------------------------------------------------------------

大概就这么多吧,剩下的大家要么看文档要么试成功后把自己的经验共享一下。
在这里我并没有对CMPP_SUBMIT中同铃声和图片相关的几个字段如tp_udhi,Msg_Fmt做出说明,主要是各网关厂商对它们在处理上也不一样,如对tp_udhi,有的要求填0,有的要求填1,有的则要求填0x40。所以在调试时,最好询问一下网关的开发人员,来确定具体的值。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章