【正文】
IM 卡的 IMSI 號,進行數(shù)據傳輸。 串口驅動 由于數(shù)據終端是用單片機實現(xiàn)的,必須從底層的串口通信開始逐漸實現(xiàn) GPRS登錄,最終實現(xiàn)數(shù)據的傳輸,串口驅動實現(xiàn)打開串口( OpenComm)、關閉串口( CloseComm)、讀串口數(shù)據( ReadComm)、向串口寫數(shù)據( WriteComm)、串口中斷( Interrupt UartRxISR)等。 登錄 GPRS 網絡 通過 GPRS Modem 支持的 AT命令集對其進行初始化設置,初始化設置成功后即可進行撥號連接, GPRS Modem 的初始化及撥號過程如下: AT+IPR=38400; //把波特率設置為 38400b/s,默認值為 9600b/s。 AT+CGCLASS=“B” ; //設置移動終端的類別為 B類,即具有 GPRS 上網和 GSM 語音功能,但二者不能同時使用, 可自動切換。 AT+CGDCONT=1, “IP” , “CMNET” ; //設置 GPRS 接入網關,如果 Modem 返回 “310D” 則表示初始化成功。 發(fā)送 “ATDT*99***1” 若 Modem 返回 “310D” 則表示成功接通 GPRS 網絡。 網絡協(xié)商 GGSN 和 Modem 通信時遵循 PPP 協(xié)議, Modem 撥號后首先要與 GGSN 進行通信鏈路的協(xié)商,即進行點到點的各種通信鏈路的參數(shù)配置,協(xié)商過程遵循 LCP、 PAP、 CHAP、IPCP 等協(xié)議,其中 LCP 用于建立、構造、測試鏈路連接, PAP 或 CHAP 用于處理密碼 驗證部分; IPCP 協(xié)議用于設置網絡協(xié)議環(huán)境,并 分配 IP 地址。 Modem 接收到 IP后將其存入數(shù)據終端的配置地址域,數(shù)據終端向數(shù)據中心發(fā)送配置后的數(shù)據幀,告知其動態(tài) IP地址和 IMSI 號,數(shù)據中心存儲收到的信息,作為下傳數(shù)據的聯(lián)絡信息。 傳輸數(shù)據 網絡協(xié)商之后即可進行數(shù)據傳送, GPRS 網絡支持 TCP/IP 協(xié)議,所以通過收發(fā)IP數(shù)據包來傳送數(shù)據,此時,終端系統(tǒng)向 GGSN 發(fā)送的所有包含 IP 報文的 PPP 報文都會被傳送給 Inter 網中相應的 IP 地址,從而完成終端系統(tǒng)向遠程監(jiān)控中心通過互聯(lián)網傳輸數(shù)據的過程 。 系統(tǒng)實現(xiàn)的一個難點是登錄 GGSN 的過程,即終端系統(tǒng)登錄 GPRS 網關( GGSN)并與網關通過 LCP, PAP, IPCP 協(xié)議進行協(xié)商的過程。 網絡協(xié)商過程是一個復雜的過程,協(xié)商過程大致如下,在撥號成功連接后 GPRS網關首先會返回一個 PAP REQ 幀,我們發(fā)送一個空 LCP REQ 幀,以強迫進行協(xié)議協(xié)商階段,隨后, GPRS 網關發(fā)送 LCP 設置幀,我們拒絕所有的設置并請求驗證模式,GPRR 網關選擇 CHAP 或 PAP 方式驗證,我們只接受 PAP 方式,然后進行 PAP 驗證用戶名或密碼過程,如果成功, GPRS 網關會返回 IPCP 報 文分配動態(tài) IP地址。此時就完成了 GPRS 網關的協(xié)商過程。 4 結 論 遠程監(jiān)控技術在工業(yè)控制領域中的應用非常廣泛,在電力系統(tǒng)、燃 氣管道 管網、石油勘測、水利、交通運輸?shù)阮I域有著非常重要的作用,采用 GPRS 無線技術使得監(jiān)控系統(tǒng)的實時性、可靠性有了很大的提高,進一步促進了工業(yè)監(jiān)控系統(tǒng)的智能化和信息化。附件 2:外文原文 Longdistance supervisory system data terminal research Based on GPRS 1 introduction With the development of puter technology, Inter technology is particularly extensive and indepth various aspects of people39。s lives. make people39。s lives has undergone a profound industrial areas, because of the need to control areas, monitoring of a wide range of objects, hence the need to spend a lot of manpower, material and financial resources for equipment maintenance. Moreover, there are many adverse conditions, it is not easy to stay the occasional moment of arrival or not some field data collection. If the amount of wiring work it is not the economy, is unreasonable. This has helped wireless munications technology development in the field of remote monitoring. GPRS (General Packet Radio Service), as the existing GSM work evolution of the transition to the third generation mobile munication technology for (), with rapid access, always online, so by the flowmeter features Remote realtime data transmission in a sudden unmatched advantages. 2 GPRS technology GPRS (General Packet Radio Service) is based on the GSM mobile work systems, the use of pa