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。所以在調試時,最好詢問一下網關的開發人員,來確定具體的值。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章