现在的位置: 首页 > 综合 > 正文

用oFono控制Nokia手机

2013年10月12日 ⁄ 综合 ⁄ 共 7329字 ⁄ 字号 评论关闭

因为oFono的plugins中加入了对Nokia Phonet的支持,oFono已经可以支持市场上比较高端的N系列手机了,如N900,N97等。我手上没有支持手机的列表,如果你有兴趣的,可以把你的手机通过数据线连上PC,在Linux用oFono看看它能不能识别出手机来。

连接Nokia手机

1. sudo src/ofonod –nd ‘*’ 启动oFono。

2. 用数据线连接手机,我的N900会询问你使用"storage mode”还是"PC suite modem”。选在PC suite mode。

3. 如果oFono能够检测到的话,会有类似下面的输出。

ofonod[4947]: plugins/usbpnmodem.c:usbpn_status_cb() Done regging modem /isimodem0
ofonod[4947]: plugins/usbpnmodem.c:usbpn_status_cb() Phonet link usbpn0 (16) is down
ofonod[4947]: plugins/usbpnmodem.c:usbpn_status_cb() Modem for interface usbpn0 already exists
ofonod[4947]: drivers/isimodem/isimodem.c:phonet_status_cb() Link usbpn0 (16) is up
ofonod[4947]: plugins/usbpnmodem.c:usbpn_status_cb() Phonet link usbpn0 (16) is up
ofonod[4947]: plugins/usbpnmodem.c:usbpn_status_cb() Modem for interface usbpn0 already exists
ofonod[4947]: drivers/isimodem/isimodem.c:reachable_cb() PN_MTC (v.018.000) reachable
ofonod[4947]: drivers/isimodem/isimodem.c:mtc_query_cb() current modem state: MTC_NORMAL (0x01)
ofonod[4947]: drivers/isimodem/isimodem.c:mtc_query_cb() target modem state: MTC_NORMAL (0x01)
ofonod[4947]: drivers/isimodem/isimodem.c:isi_modem_pre_sim() (0x966d6c0) with usbpn0
ofonod[4947]: drivers/isimodem/sim.c:sim_reachable_cb() PN_SIM (v.-01.-01) reachable
ofonod[4947]: drivers/isimodem/devinfo.c:reachable_cb() PN_PHONE_INFO (v008.005) reachable
ofonod[4947]: drivers/isimodem/voicecall.c:isi_call_verify_cb() PN_CALL (v007.020) reachable
ofonod[4947]: src/sim.c:ofono_sim_add_state_watch() 0x966ccd8
ofonod[4947]: src/sim.c:ofono_sim_add_state_watch() 0x966ccd8
ofonod[4947]: src/sim.c:ofono_sim_add_state_watch() 0x966ccd8
ofonod[4947]: drivers/isimodem/sim.c:isi_read_file_transparent() fileid = 6fae
ofonod[4947]: drivers/isimodem/sim.c:isi_read_file_transparent() Not implemented (fileid = 6fae)
ofonod[4947]: drivers/isimodem/sim.c:isi_read_file_info() Not implemented (fileid = 6fb7)
ofonod[4947]: src/voicecall.c:ecc_g2_read_cb() 0
ofonod[4947]: drivers/isimodem/sim.c:isi_read_file_info() Not implemented (fileid = 6fb7)
ofonod[4947]: src/voicecall.c:ecc_g3_read_cb() 0
ofonod[4947]: drivers/isimodem/sim.c:fake_file_info() Returning static file_info for 2fe2
ofonod[4947]: drivers/isimodem/sim.c:isi_read_file_transparent() fileid = 2fe2
ofonod[4947]: drivers/isimodem/sim.c:isi_read_file_info() Not implemented (fileid = 6f05)
ofonod[4947]: drivers/isimodem/sim.c:isi_read_file_info() Not implemented (fileid = 2f05)
ofonod[4947]: drivers/isimodem/sim.c:isi_read_file_info() Not implemented (fileid = 6f16)
ofonod[4947]: drivers/isimodem/isimodem.c:isi_modem_post_sim() (0x966d6c0) with usbpn0
ofonod[4947]: Example History Probe for modem: 0x966d6c0
ofonod[4947]: Example Network Time Probe for modem: 0x966d6c0
ofonod[4947]: drivers/isimodem/sim.c:isi_read_file_info() Not implemented (fileid = 6f40)
ofonod[4947]: drivers/isimodem/sim.c:isi_read_file_info() Not implemented (fileid = 6f49)
ofonod[4947]: drivers/isimodem/phonebook.c:reachable_cb() PN_SIM (v-01.-01) reachable
ofonod[4947]: drivers/isimodem/isimodem.c:isi_modem_online() (0x966d6c0) with usbpn0
ofonod[4947]: drivers/isimodem/isimodem.c:mtc_state_cb() cause: MTC_ALREADY_ACTIVE (0x06)
ofonod[4947]: drivers/isimodem/isimodem.c:isi_modem_post_online() (0x966d6c0) with usbpn0
ofonod[4947]: drivers/isimodem/gprs.c:gpds_reachable_cb() PN_GPDS (v017.026)
ofonod[4947]: drivers/isimodem/gprs-context.c:gpds_ctx_reachable_cb() PN_GPDS (v017.026) for PDP contexts
ofonod[4947]: drivers/isimodem/network-registration.c:reachable_cb() PN_NETWORK (v014.002) reachable
ofonod[4947]: Registered: Dial-Up Networking, handle: 0x10007
ofonod[4947]: src/network.c:__ofono_netreg_add_status_watch() 0x966d4d0
ofonod[4947]: drivers/isimodem/sms.c:routing_resp_cb() Request failed: 0x04 (SMS_ERR_PP_RESERVED).
4. ofono/test/list-modems

xxx@xxx:~/ofono/test$ ./list-modems

[ /isimodem0 ]

    Features = sim

    Powered = 1

    Interfaces = org.ofono.Phonebook org.ofono.SimManager org.ofono.VoiceCallManager

    Online = 0

    Model = Nokia N900

    Manufacturer = Nokia

    Serial = 356938030516794

    Revision = RX-51_1.2009.42.11

V 0.0.000

RX-51

(c) NOKIA

    [ org.ofono.Phonebook ]

    [ org.ofono.SimManager ]

        SubscriberNumbers =

        CardIdentifier = 89860052090975205163

        LockedPins =

        PinRequired = none

        SubscriberIdentity = 460004520285163

        Present = 1

    [ org.ofono.VoiceCallManager ]

        EmergencyNumbers = 119 118 999 110 08 000 911 112

        MultipartyCalls =

        Calls =

5. ./online-modem /isimodem0

xxx@xxx:~/ofono/test$ ./online-modem /isimodem0

Setting modem /isimodem0 online...

6. ./list-modems

xxx@xxx:~/ofono/test$ ./list-modems

[ /isimodem0 ]

    Features = sms net gprs sim

    Powered = 1

    Interfaces = org.ofono.CallSettings org.ofono.CallForwarding org.ofono.SupplementaryServices org.ofono.SmsManager org.ofono.NetworkRegistration org.ofono.DataConnectionManager org.ofono.Phonebook org.ofono.SimManager org.ofono.VoiceCallManager

    Online = 1

    Model = Nokia N900

    Manufacturer = Nokia

    Serial = 356938030516794

    Revision = RX-51_1.2009.42.11

V 0.0.000

RX-51

(c) NOKIA

    [ org.ofono.CallSettings ]

        CalledLineRestriction = unknown

        HideCallerId = default

        CallingLinePresentation = unknown

        CalledLinePresentation = unknown

        VoiceCallWaiting = disabled

        CallingLineRestriction = unknown

    [ org.ofono.CallForwarding ]

    [ org.ofono.SupplementaryServices ]

        State = idle

    [ org.ofono.SmsManager ]

        UseDeliveryReports = 0

        Bearer = cs-preferred

        ServiceCenterAddress = +8613800210500

    [ org.ofono.NetworkRegistration ]

        Status = registered

        Strength = 100

        Name = CMCC

        Operators = /isimodem0/operator/46000

        LocationAreaCode = 6253

        Mode = auto

        Technology = edge

        CellId = 34385

    [ org.ofono.DataConnectionManager ]

        Powered = 1

        Attached = 1

        PrimaryContexts =

        RoamingAllowed = 1

    [ org.ofono.Phonebook ]

    [ org.ofono.SimManager ]

        SubscriberNumbers =

        CardIdentifier = 89860052090975205163

        LockedPins =

        PinRequired = none

        SubscriberIdentity = 460004520285163

        Present = 1

    [ org.ofono.VoiceCallManager ]

        EmergencyNumbers = 119 118 999 110 08 000 911 112

        MultipartyCalls =

        Calls =

7. 接下来就可以打电话,发短信了。

8. 打一个电话

xxx@xxx:~/ofono/test$ ./test-voicecall 10086

Using modem /isimodem0

dbus.Array([], signature=dbus.Signature('o'), variant_level=1)

Call list modification>

No calls in systems

Dialing 10086...

Dialing in progress, got obj: /isimodem0/voicecall01

State: dialing, Number: 10086

Call list modification>

Call /isimodem0/voicecall01, Status: dialing, LineId: 10086

Voicecall property: 'State' changed to 'alerting'

Voicecall property: 'State' changed to 'active'

Voicecall property: 'StartTime' changed to '2010-07-29T13:08:05+0800'

Hanging up

Voicecall property: 'State' changed to 'disconnected'

Call list modification>

No calls in systems

9. GPRS

xxx@xxx:~/ofono/test$ ./list-contexts

[ /isimodem0 ]

xxx@xxx:~/ofono/test$ ./create-context cmnet

Setting APN of /isimodem0/primarycontext1 to cmnet

xxx@xxx:~/ofono/test$

xxx@xxx:~/ofono/test$ ./list-contexts

[ /isimodem0 ]

    [ /isimodem0/primarycontext1 ]

        Username =

        Protocol = ip

        Name = Internet access

        Settings = { }

        Active = 0

        AccessPointName = cmnet

        Password =

        Type = internet

xxx@xxx:~/ofono/test$ ./activate-context

xxx@xxx:~/ofono/test$ ./list-contexts

[ /isimodem0 ]

    [ /isimodem0/primarycontext1 ]

        Username =

        Protocol = ip

        Name = Internet access

        Settings = { Interface=gprs0 Method=dhcp DomainNameServers=211.136.112.50,211.136.20.203, Address=10.85.89.3 }

        Active = 1

        AccessPointName = cmnet

        Password =

        Type = internet

xxx@xxx:~/ofono/test$ ./deactivate-context

xxx@xxx:~/ofono/test$ ./remove-contexts

Removed: [ /isimodem0/primarycontext1 ]

10. SMS

xxx@xxx:~/ofono/test$ ./send-sms 135xxxxxxxx hello

抱歉!评论已关闭.