View source for Gsmd/zh tw
From Openmoko
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Template used on this page:
Return to Gsmd/zh tw.
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Template used on this page:
Return to Gsmd/zh tw.
gsmd 是在Openmoko手機上執行的 GSM背景程式。它用來管理話機中傳統的'通話' 領域 (聲音/簡訊/gprs 通訊連結)。
你可以在這裡找到進行中的進階技術描述及API文件。
當以/etc/init.d/gsmd script啟動時,gsmd 通常會以背景程式執行,在這個案例當中gsmd會輸出偵錯訊息到 "/tmp/gsm.log"檔案中 (stdout及stderr在這裡則被重新導引).
針對偵錯目地,gsmd可以在前景模式下執行,可以被使用的選項如下:
> gsmd --help gsmd - (C) 2006 by Harald Welte <laforge@gnumonks.org> This program is FREE SOFTWARE under the terms of GNU GPL Usage: -v --version 顯示程式版本 -d --daemon Deamonize -h --help 顯示輔助訊息 -p dev --device dev 指定串列裝置為作用中裝置 -s spd --speed spd 指定bps速度 (9600,38400,115200,...) -F --hwflow 硬體流量控制(RTS/CTS) -L --leak-report Leak Report of talloc memory allocator -l file --logfile file Specify a logfile to log to
如果你的GSM 數據機連接到ttySAC0 (如 Neo1973), 使用如下指令啟動它:
> gsmd -p /dev/ttySAC0 -s 115200 -F
(baud rate可被modem自動偵測)
使用最近的 uboot (svn > r2885),gsm modem可以電源啟動,並且從uboot本身連接到uboot的串列控制埠。然後,允許host PC直接與數據機互動。關於host pc執行gsmd 的文章,你可以在這裡找到。
libgsmd 是C 語言API中的程式庫。這個程式庫的程式可以被用在手機上,如打電話、接收電話、註冊為網路一員...等。
libgsmd-tool is a small demo application that can be used to demonstrate the usage of the libgsmd API.
libgsmd-tool has multiple modes.
Shell mode provides a simple text-based command interface for making voice calls.
The shell mode can be started using
libgsmd-tool -m shell
It can be used like in the following example:
> src/util/libgsmd-tool -m shell libgsm-tool - (C) 2006 by Harald Welte This program is Free Software and has ABSOLUTELY NO WARRANTY ? A Answer incoming call D Dial outgoing number H Hangup call O Power On o Power Off r Register to network R Register to given operator (R=number) U Unregister from netowrk P Print current operator L Detect available operators Q Read signal quality T Send DTMF Tone n Print subscriber numbers pd PB Delete (pb=index) pr PB Read (pr=index) prr PB Read Range (prr=index1,index2) pf PB Find (pf=indtext) pw PB Write (pw=index,number,text) ps PB Support pm PB Memory pp PB Set Memory (pp=storage) pRr Retrieve Readrg Records pRf Retrieve Find Records sd SMS Delete (sd=index,delflg) sl SMS List (sl=stat) sr SMS Read (sr=index) ss SMS Send (ss=ask_ds,number,text|["text"]) sw SMS Write (sw=stat,number,text) sm SMS Storage stats sM SMS Set preferred storage (sM=mem1,mem2,mem3) sc SMS Show Service Centre sC SMS Set Service Centre (sC=number) q Quit O # EVENT: PIN request (type=1) Please enter PIN: 6582 r # EVENT: Netreg searching for network EVENT: Netreg registered (home network) D03024033902 # Dial 03024033902 EVENT: Call Progress: UNKNOWN EVENT: Call Progress: PROCEED EVENT: Call Progress: SYNC EVENT: Call Progress: ALERT H # Hangup EVENT: Call Progress: DISCONNECT EVENT: Call Progress: RELEASE EVENT: Incoming call type=2! EVENT: Incoming call clip=`"03024033902"' EVENT: Incoming call type=2! A # Answer RSTR=`OK' H # Hangup RSTR=`OK'
The atcmd mode is a passthrough-mode. Passthrough means that it accepts GSM 07.07 commands, passes them through the daemon to the phone, and returns you the response. this is very useful for debugging.
The atcmd mode can be started using
libgsmd-tool -m atcmd
Usage is like in the following example:
> src/util/libgsmd-tool -m atcmd libgsm-tool - (C) 2006 by Harald Welte This program is Free Software and has ABSOLUTELY NO WARRANTY AT+CPAS STR=`AT+CPAS' RSTR=`+CPAS: 0' AT+COPS=? STR=`AT+COPS=?' RSTR=`+COPS: (2,"E-Plus","E-Plus","26203"),(3,"o2 - de","o2 - de","26207"),(3,"Vodafone.de","Vodafone","26202"),(3,"T-Mobile D","TMO D","26201")'
Operator selection functions were implemented and merged into SVN head[1]:
The new commands in libgsmd-util are as followings:
R - Register to given operator (R=number) P - Print current operator L - Detect available operators Q - Read signal quality
This is implemented by the functions with "_opers_" naming.
(please add items to this list if you're missing more features)
Emulating/mocking the firmware, gsmd and libgsmd can be tested for functionality; on any machine. See Kero's page or go directly to the (lib)gsmd testing page.
gsmd needs to do apropriate state tracking of the underlying GSM hardware. For many of the state transition we only get events from the GSM Modem, but don't have apropriate query commands. Thus, assuming gsmd runs all the time, applications can come and go, but still have an idea about the current state of the modem, even if they missed the initial state transitions.
Also, gsmd state tracking allows us to allow for safer interoperability of multiple applications. If i.e. one applications has just started an outgoing call, gsmd can detect another application who intends to interfere with that and deny access
It must also configure the modem so that it can on appropriate events wake the system from sleep.
Sources of gsmd are kept in OpenMoko svn in src/target/gsm directory.
Languages: |
English • العربية • Български • Česky • Dansk • Deutsch • Esperanto • Eesti • Español • فارسی • Suomi • Français • עברית • Magyar • Italiano • 한국어 • Nederlands • Norsk (bokmål) • Polski • Português • Română • Русский • Svenska • Slovenčina • Українська • 中文(中国大陆) • 中文(台灣) • Euskara • Català |