[PATCH_v4 0/5] Private network request to ConnMan
by Guillaume Zajac
Hi,
Changelog from v3 is:
- Add private-network source/include
- ConnMan plugin is independant from emulator
- Each application that need VPN will pass a callback as argument
when private network is requested. This callback will contain the
private network settings.
Guillaume Zajac (5):
gatppp: Add new contructor to use external fd
private-network: add callback typedef drivers and settings
private-network: add request/release functions and new feature to
Makefile.am
emulator: add request/release private network calls
connman: add plugin in oFono to request request/release private
network
Makefile.am | 10 +-
gatchat/gatppp.c | 33 +++++-
gatchat/gatppp.h | 1 +
gatchat/ppp.h | 2 +-
gatchat/ppp_net.c | 40 ++++---
include/private-network.h | 59 +++++++++
plugins/connman.c | 297 +++++++++++++++++++++++++++++++++++++++++++++
src/emulator.c | 49 ++++++--
src/ofono.h | 6 +
src/private-network.c | 89 ++++++++++++++
10 files changed, 556 insertions(+), 30 deletions(-)
create mode 100644 include/private-network.h
create mode 100644 plugins/connman.c
create mode 100644 src/private-network.c
3 weeks
Business
by Daser Jnr.
Hi all
>From a business point of view, can some one tell me what i can do with ofono
Cheers
Daser S.
2 months, 2 weeks
Re-activating a context.
by Christopher Vogl
Hello,
I am trying to simulate a connection loss and after a valid ppp
connection I disconnect the antenna to get detached from GPRS.
After reconnecting the antenna everything seems to work fine just until
activating the context.
Ofono seems to get stuck in
drivers/atmodem/gprs-context.c:at_gprs_activate_primary() and
AT+CGDCONT=1 is missing on the debug output.
When I retry to activate the context after some minutes with a dbus-send
call, I receive an operation in progress error.
Below I have attached ofono's debug output and dbus-send calls for
important interfaces
- before removing the antenna
- after removing the antenna
- after reconnecting the antenna
Modem in use: Telit UC864-G
connMan in the debug output is my own simple connection manger. I am not
sure if I missed to set some ofono state or if there is a known issue.
I really would appreciate a hint in this case.
Thanks!
Greetings,
Christopher Vogl
...
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_initialize_restart_count: current state 6:REQSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_send_configure_request: current state 6:REQSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_process_configure_request: current state 6:REQSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_generate_event: current state 6:REQSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: event: 6 (RCR+),
action: 2008, new_state: 8 (ACKSENT)
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_send_configure_ack: current state 6:REQSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_process_configure_reject: current state 8:ACKSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_generate_event: current state 8:ACKSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: event: 9 (RCN),
action: 1028, new_state: 8 (ACKSENT)
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_initialize_restart_count: current state 8:ACKSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_send_configure_request: current state 8:ACKSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_process_configure_nak: current state 8:ACKSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_generate_event: current state 8:ACKSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: event: 9 (RCN),
action: 1028, new_state: 8 (ACKSENT)
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_initialize_restart_count: current state 8:ACKSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_send_configure_request: current state 8:ACKSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_process_configure_ack: current state 8:ACKSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_generate_event: current state 8:ACKSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: event: 8 (RCA),
action: 129, new_state: 9 (OPENED)
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP: ipcp:
pppcp_initialize_restart_count: current state 8:ACKSENT
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: PPP:
gatchat/gatppp.c:ppp_enter_phase() 4
Jan 1 07:56:39 mx31tt01 daemon.debug ofonod[408]:
drivers/atmodem/gprs-context.c:ppp_connect()
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: IP: 2.200.229.88
Jan 1 07:56:39 mx31tt01 daemon.info ofonod[408]: DNS: 139.7.30.126,
139.7.30.125
Jan 1 07:56:39 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:pri_activate_callback() 0x1b7dde0
Jan 1 07:56:39 mx31tt01 user.debug connMan[371]: Got connection context
signal Settings, Val = {'Interface': <'ppp0'>, 'Method': <'static'>,
'Address': <'2.200.229.88'>, 'Netmask': <'255.255.255.255'>, 'Do
mainNameServers': <['139.7.30.126', '139.7.30.125']>}
Jan 1 07:56:39 mx31tt01 daemon.debug ofonod[408]:
plugins/udev.c:udev_event() subsystem net add
Jan 1 07:56:39 mx31tt01 daemon.debug ofonod[408]:
plugins/udev.c:udev_event() subsystem net finished
Jan 1 07:56:39 mx31tt01 user.debug connMan[371]: Got connection context
signal Active, Val = true
Jan 1 07:56:39 mx31tt01 user.debug connMan[371]: Method is a string static
Jan 1 07:56:39 mx31tt01 user.info connMan[371]: Set up ip ip addr add
2.200.229.88/32 dev ppp0
Jan 1 07:56:39 mx31tt01 user.info connMan[371]: Domain name servers:
Jan 1 07:56:39 mx31tt01 user.info connMan[371]: 139.7.30.126
Jan 1 07:56:39 mx31tt01 user.info connMan[371]: Adding route ip route
add 139.7.30.126/32 dev ppp0
Jan 1 07:56:39 mx31tt01 user.info connMan[371]: 139.7.30.125
Jan 1 07:56:39 mx31tt01 user.info connMan[371]: Adding route ip route
add 139.7.30.125/32 dev ppp0
Jan 1 07:56:39 mx31tt01 user.info connMan[371]: resolv.conf file will
look like this:
Jan 1 07:56:39 mx31tt01 user.info connMan[371]: nameserver 139.7.30.126
nameserver 139.7.30.125
Jan 1 07:56:39 mx31tt01 user.info connMan[371]: Writing resolv.conf
Jan 1 07:56:39 mx31tt01 user.info connMan[371]: Setting default route
for interface ppp0
Jan 1 07:56:39 mx31tt01 user.info connMan[371]: Adding default route
route add default gw 2.200.229.88 ppp0
Jan 1 07:56:40 mx31tt01 daemon.debug ofonod[408]:
plugins/udevng.c:check_modem_list()
dbus-send --system --type=method_call --print-reply --dest=org.ofono
/telit_0 org.ofono.NetworkRegistration.GetProperties
method return sender=:1.5 -> dest=:1.16 reply_serial=2
array [
dict entry(
string "Status"
variant string "registered"
)
dict entry(
string "Mode"
variant string "auto"
)
dict entry(
string "LocationAreaCode"
variant uint16 832
)
dict entry(
string "CellId"
variant uint32 49481
)
dict entry(
string "Name"
variant string ""
)
dict entry(
string "Strength"
variant byte 100
)
]
dbus-send --system --type=method_call --print-reply --dest=org.ofono
/telit_0 org.ofono.ConnectionManager.GetProperties
method return sender=:1.5 -> dest=:1.17 reply_serial=2
array [
dict entry(
string "Attached"
variant boolean true
)
dict entry(
string "Bearer"
variant string "none"
)
dict entry(
string "RoamingAllowed"
variant boolean true
)
dict entry(
string "Powered"
variant boolean true
)
dict entry(
string "Suspended"
variant boolean false
)
]
dbus-send --system --type=method_call --print-reply --dest=org.ofono
/telit_0 org.ofono.ConnectionManager.GetContexts
method return sender=:1.5 -> dest=:1.18 reply_serial=2
array [
struct {
object path "/telit_0/context2"
array [
dict entry(
string "Name"
variant string "Internet"
)
dict entry(
string "Active"
variant boolean true
)
dict entry(
string "Type"
variant string "internet"
)
dict entry(
string "Protocol"
variant string "ip"
)
dict entry(
string "AccessPointName"
variant string "web.vodafone.de"
)
dict entry(
string "Username"
variant string ""
)
dict entry(
string "Password"
variant string ""
)
dict entry(
string "Settings"
variant array [
dict entry(
string "Interface"
variant string "ppp0"
)
dict entry(
string "Method"
variant string "static"
)
dict entry(
string "Address"
variant string
"2.200.229.88"
)
dict entry(
string "Netmask"
variant string
"255.255.255.255"
)
dict entry(
string "DomainNameServers"
variant array [
string "139.7.30.126"
string "139.7.30.125"
]
)
]
)
dict entry(
string "IPv6.Settings"
variant array [
]
)
]
}
]
After disconnecting the antenna:
Jan 1 08:02:25 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CREG: 2\r\n
Jan 1 08:02:25 mx31tt01 daemon.debug ofonod[408]:
src/network.c:ofono_netreg_status_notify() /telit_0 status 2 tech -1
Jan 1 08:02:25 mx31tt01 daemon.debug ofonod[408]:
src/network.c:current_operator_callback() 0x1b79df8, 0x1b80eb0
Jan 1 08:02:25 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:netreg_status_changed() 2
Jan 1 08:02:25 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:netreg_status_changed() 2
Jan 1 08:02:25 mx31tt01 user.debug connMan[371]: Got network
registration signal Status: 'searching'
Jan 1 08:02:25 mx31tt01 user.err connMan[371]:
checkAndSetOperatorSelection()
Jan 1 08:02:25 mx31tt01 daemon.info ofonod[408]: Aux: > AT+CGATT=0\r
Jan 1 08:02:25 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CGREG: 2\r\n
Jan 1 08:02:25 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:ofono_gprs_status_notify() /telit_0 status 2
Jan 1 08:02:25 mx31tt01 user.debug connMan[371]: Got network
registration signal Name: ''
Jan 1 08:02:25 mx31tt01 user.debug connMan[371]: Got connection context
signal Settings, Val = @a{sv} {}
Jan 1 08:02:25 mx31tt01 user.debug connMan[371]: Got connection context
signal Active, Val = false
Jan 1 08:02:25 mx31tt01 user.info connMan[371]: Connection context has
been deactivated.
Jan 1 08:02:25 mx31tt01 user.debug connMan[371]: Got connection manager
signal Attached, Val = false
Jan 1 08:02:25 mx31tt01 user.info connMan[371]: Detached - all contexts
have been deactivated
Jan 1 08:02:25 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:gprs_remove_context() Unregistering context: /telit_0/context2
Jan 1 08:02:25 mx31tt01 user.debug connMan[371]: Got connection manager
signal Powered, Val = false
Jan 1 08:02:28 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CME ERROR:
30\r\n
Jan 1 08:02:28 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:gprs_attach_callback() /telit_0 error = 1
Jan 1 08:02:28 mx31tt01 daemon.info ofonod[408]: Aux: > AT+CGREG?\r
Jan 1 08:02:28 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CGREG:
2,2\r\n\r\nOK\r\n
Jan 1 08:02:28 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:registration_status_cb() /telit_0 error 0 status 2
Jan 1 08:02:28 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:ofono_gprs_status_notify() /telit_0 status 2
dbus-send --system --type=method_call --print-reply --dest=org.ofono
/telit_0 org.ofono.NetworkRegistration.GetProperties
method return sender=:1.5 -> dest=:1.21 reply_serial=2
array [
dict entry(
string "Status"
variant string "searching"
)
dict entry(
string "Mode"
variant string "auto"
)
dict entry(
string "Name"
variant string ""
)
]
dbus-send --system --type=method_call --print-reply --dest=org.ofono
/telit_0 org.ofono.ConnectionManager.GetProperties
method return sender=:1.5 -> dest=:1.22 reply_serial=2
array [
dict entry(
string "Attached"
variant boolean false
)
dict entry(
string "RoamingAllowed"
variant boolean true
)
dict entry(
string "Powered"
variant boolean false
)
]
dbus-send --system --type=method_call --print-reply --dest=org.ofono
/telit_0 org.ofono.ConnectionManager.GetContexts
method return sender=:1.5 -> dest=:1.23 reply_serial=2
array [
]
After reconnecting the antenna:
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CGEV: ME
DETACH\r\n
Jan 1 08:08:48 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:ofono_gprs_detached_notify() /telit_0
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CREG:
1,"0340","143D"\r\n
Jan 1 08:08:48 mx31tt01 daemon.debug ofonod[408]:
src/network.c:ofono_netreg_status_notify() /telit_0 status 1 tech -1
Jan 1 08:08:48 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:netreg_status_changed() 1
Jan 1 08:08:48 mx31tt01 user.debug connMan[371]: Got network
registration signal Status: 'registered'
Jan 1 08:08:48 mx31tt01 user.debug connMan[371]: Got network
registration signal LocationAreaCode: uint16 832
Jan 1 08:08:48 mx31tt01 user.err connMan[371]:
checkAndSetOperatorSelection()
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: > AT+COPS=3,2\r
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CGREG: 0\r\n
Jan 1 08:08:48 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:ofono_gprs_status_notify() /telit_0 status 0
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: < \r\nOK\r\n
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: > AT+COPS?\r
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+COPS:
0,2,"26202",0\r\n\r\nOK\r\n
Jan 1 08:08:48 mx31tt01 daemon.debug ofonod[408]:
drivers/atmodem/network-registration.c:cops_numeric_cb() Cops numeric
got mcc: 262, mnc: 02
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: > AT+CIND?\r
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CIND:
4,99,1,0,0,0,0,0,2\r\n\r\nOK\r\n
Jan 1 08:08:48 mx31tt01 user.debug connMan[371]: Got network
registration signal CellId: uint32 5181
Jan 1 08:08:48 mx31tt01 user.debug connMan[371]: Got connection manager
signal Powered, Val = true
Jan 1 08:08:48 mx31tt01 daemon.debug ofonod[408]:
src/network.c:ofono_netreg_strength_notify() strength 40
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: > AT+COPS=3,0\r
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: < \r\nOK\r\n
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: > AT+COPS?\r
Jan 1 08:08:48 mx31tt01 user.debug connMan[371]: Got network
registration signal Strength: byte 0x28
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+COPS:
0,0,"Vodafone D2",0\r\n\r\nOK\r\n
Jan 1 08:08:48 mx31tt01 daemon.debug ofonod[408]:
drivers/atmodem/network-registration.c:cops_cb() cops_cb: Vodafone D2,
262 02 0
Jan 1 08:08:48 mx31tt01 daemon.debug ofonod[408]:
src/network.c:current_operator_callback() 0x1b79df8, (nil)
Jan 1 08:08:48 mx31tt01 user.debug connMan[371]: Got network
registration signal Name: 'Vodafone D2'
Jan 1 08:08:48 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:netreg_status_changed() 1
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: > AT+CGATT=1\r
Jan 1 08:08:48 mx31tt01 user.debug connMan[371]: Got network
registration signal MobileCountryCode: '262'
Jan 1 08:08:48 mx31tt01 user.debug connMan[371]: Got network
registration signal MobileNetworkCode: '02'
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: < \r\nOK\r\n
Jan 1 08:08:48 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:gprs_attach_callback() /telit_0 error = 0
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: > AT+CGREG?\r
Jan 1 08:08:48 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CGREG:
2,0\r\n\r\nOK\r\n
Jan 1 08:08:48 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:registration_status_cb() /telit_0 error 0 status 0
Jan 1 08:08:48 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:ofono_gprs_status_notify() /telit_0 status 0
Jan 1 08:08:57 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CGREG: 2\r\n
Jan 1 08:08:57 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:ofono_gprs_status_notify() /telit_0 status 2
Jan 1 08:08:57 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CGREG:
1,"0340","143D"\r\n
Jan 1 08:08:57 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:ofono_gprs_status_notify() /telit_0 status 1
Jan 1 08:08:57 mx31tt01 user.debug connMan[371]: Got connection manager
signal Attached, Val = true
Jan 1 08:08:57 mx31tt01 user.info connMan[371]: Attached
Jan 1 08:08:57 mx31tt01 user.debug connMan[371]: Getting first internet
context ...
Jan 1 08:08:57 mx31tt01 user.debug connMan[371]: No internet context
found! Adding a new internet context.
Jan 1 08:08:57 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:add_context() Registering new context
Jan 1 08:08:57 mx31tt01 user.debug connMan[371]: Context path:
/telit_0/context3
Jan 1 08:08:57 mx31tt01 user.debug connMan[371]: Connecting to
org.ofono.ConnectionContext PropertyChanged signal.
Jan 1 08:08:58 mx31tt01 user.debug connMan[371]: Connecting to
org.ofono.ConnectionContext ContextAdded signal.
Jan 1 08:08:58 mx31tt01 user.debug connMan[371]: Connecting to
org.ofono.ConnectionContext ContextRemoved signal.
Jan 1 08:08:58 mx31tt01 user.debug connMan[371]: set_and_activate_context()
Jan 1 08:08:58 mx31tt01 user.debug connMan[371]: Setting and Activating
the Internet connection context.
Jan 1 08:08:58 mx31tt01 user.debug connMan[371]: mccmnc = '26202', len = 5
Jan 1 08:08:58 mx31tt01 user.debug connMan[371]: Provider name '1&1'
Jan 1 08:08:58 mx31tt01 user.debug connMan[371]: Set AccessPointName:
web.vodafone.de
Jan 1 08:08:58 mx31tt01 user.debug connMan[371]: Set Username:
Jan 1 08:08:58 mx31tt01 user.debug connMan[371]: Set Password:
Jan 1 08:08:58 mx31tt01 user.debug connMan[371]: Trying to set
context:web.vodafone.de
Jan 1 08:08:58 mx31tt01 daemon.debug ofonod[408]:
drivers/atmodem/gprs-context.c:at_gprs_activate_primary() cid 1
Jan 1 08:09:18 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CREG:
1,"0340","C149"\r\n
Jan 1 08:09:18 mx31tt01 daemon.debug ofonod[408]:
src/network.c:ofono_netreg_status_notify() /telit_0 status 1 tech -1
Jan 1 08:09:18 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:netreg_status_changed() 1
Jan 1 08:09:18 mx31tt01 daemon.info ofonod[408]: Aux: > AT+COPS=3,2\r
Jan 1 08:09:18 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CGREG:
1,"0340","C149"\r\n
Jan 1 08:09:18 mx31tt01 daemon.debug ofonod[408]:
src/gprs.c:ofono_gprs_status_notify() /telit_0 status 1
Jan 1 08:09:18 mx31tt01 daemon.info ofonod[408]: Aux: < \r\nOK\r\n
Jan 1 08:09:18 mx31tt01 daemon.info ofonod[408]: Aux: > AT+COPS?\r
Jan 1 08:09:18 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+COPS:
0,2,"26202",0\r\n\r\nOK\r\n
Jan 1 08:09:18 mx31tt01 daemon.debug ofonod[408]:
drivers/atmodem/network-registration.c:cops_numeric_cb() Cops numeric
got mcc: 262, mnc: 02
Jan 1 08:09:18 mx31tt01 daemon.info ofonod[408]: Aux: > AT+CIND?\r
Jan 1 08:09:18 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+CIND:
4,99,1,0,0,0,0,0,2\r\n\r\nOK\r\n
Jan 1 08:09:18 mx31tt01 daemon.info ofonod[408]: Aux: > AT+COPS=3,0\r
Jan 1 08:09:18 mx31tt01 daemon.info ofonod[408]: Aux: < \r\nOK\r\n
Jan 1 08:09:18 mx31tt01 daemon.info ofonod[408]: Aux: > AT+COPS?\r
Jan 1 08:09:18 mx31tt01 daemon.info ofonod[408]: Aux: < \r\n+COPS:
0,0,"Vodafone D2",0\r\n\r\nOK\r\n
Jan 1 08:09:18 mx31tt01 daemon.debug ofonod[408]:
drivers/atmodem/network-registration.c:cops_cb() cops_cb: Vodafone D2,
262 02 0
Jan 1 08:09:18 mx31tt01 daemon.debug ofonod[408]:
src/network.c:current_operator_callback() 0x1b79df8, 0x1b80eb0
Jan 1 08:09:23 mx31tt01 user.debug connMan[371]: Got connection context
signal AccessPointName, Val = 'web.vodafone.de'
Jan 1 08:09:23 mx31tt01 user.info connMan[371]: APN: web.vodafone.de
Jan 1 08:09:23 mx31tt01 user.debug connMan[371]: Got network
registration signal CellId: uint32 49481
dbus-send --system --type=method_call --print-reply --dest=org.ofono
/telit_0 org.ofono.NetworkRegistration.GetProperties
method return sender=:1.5 -> dest=:1.24 reply_serial=2
array [
dict entry(
string "Status"
variant string "registered"
)
dict entry(
string "Mode"
variant string "auto"
)
dict entry(
string "LocationAreaCode"
variant uint16 832
)
dict entry(
string "CellId"
variant uint32 49481
)
dict entry(
string "MobileCountryCode"
variant string "262"
)
dict entry(
string "MobileNetworkCode"
variant string "02"
)
dict entry(
string "Name"
variant string "Vodafone D2"
)
dict entry(
string "Strength"
variant byte 40
)
]
dbus-send --system --type=method_call --print-reply --dest=org.ofono
/telit_0 org.ofono.ConnectionManager.GetProperties
method return sender=:1.5 -> dest=:1.25 reply_serial=2
array [
dict entry(
string "Attached"
variant boolean true
)
dict entry(
string "RoamingAllowed"
variant boolean true
)
dict entry(
string "Powered"
variant boolean true
)
dict entry(
string "Suspended"
variant boolean false
)
]
dbus-send --system --type=method_call --print-reply --dest=org.ofono
/telit_0 org.ofono.ConnectionManager.GetContexts
method return sender=:1.5 -> dest=:1.26 reply_serial=2
array [
struct {
object path "/telit_0/context3"
array [
dict entry(
string "Name"
variant string "Internet"
)
dict entry(
string "Active"
variant boolean false
)
dict entry(
string "Type"
variant string "internet"
)
dict entry(
string "Protocol"
variant string "ip"
)
dict entry(
string "AccessPointName"
variant string "web.vodafone.de"
)
dict entry(
string "Username"
variant string ""
)
dict entry(
string "Password"
variant string ""
)
dict entry(
string "Settings"
variant array [
dict entry(
string "Method"
variant string "dhcp"
)
]
)
dict entry(
string "IPv6.Settings"
variant array [
]
)
]
}
]
--
Scanned by MailScanner.
9 years, 8 months
[RFC] HFP support into oFono and BlueZ
by Gustavo F. Padovan
Hi,
These patches implement the new API for the Audio Gateway in BlueZ. It
follows the last version of the HandsfreeGateway and HandsfreeAgent
Intefaces API.
The first two patches is for BlueZ and the other for oFono. You can
test it with using enable-modem and test-voicecall scripts into the
test dir of oFono.
Feel free to test it and send me your comments. We have some bugs yet.
The audio part is not working yet. We are going to work on pulseaudio
this week to get this done soon.
Regards,
--
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi
9 years, 8 months
[PATCH] test-voicecall: Fix typo
by Guillaume Zajac
---
test/test-voicecall | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/test-voicecall b/test/test-voicecall
index 3b0d432..7118eb8 100755
--- a/test/test-voicecall
+++ b/test/test-voicecall
@@ -12,7 +12,7 @@ def hangup_all():
def print_calls():
calls = vcmanager.GetCalls()
- if (len(calls) != 0):
+ if (len(calls) == 0):
print "No calls available"
else:
for path, properties in calls:
--
1.7.5.4
9 years, 9 months
[PATCH_v2 0/2] Add new scripts for GCF testing
by Guillaume Zajac
Hi,
1st patch adds hold-and-answer script needed GPP test cases:
31.3.2.1, 31.3.2.2 and 31.3.2.3 in 3GPP 51.010.
2nd patch adds hangup <call_state> script needed for 3GPP test case 31.3.1.3.1
in 3GPP 51.0.10.
Guillaume Zajac (2):
test: Add hold-and-answer script for GCF testing
test: Add hangup script for GCF testing
Makefile.am | 4 ++-
test/hangup | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++
test/hold-and-answer | 20 ++++++++++++++++++
3 files changed, 76 insertions(+), 1 deletions(-)
create mode 100755 test/hangup
create mode 100755 test/hold-and-answer
--
1.7.5.4
9 years, 9 months
[PATCH 1/2] test: Rename script hangup-active to hangup
by Guillaume Zajac
---
Makefile.am | 2 +-
test/hangup | 29 +++++++++++++++++++++++++++++
test/hangup-active | 29 -----------------------------
3 files changed, 30 insertions(+), 30 deletions(-)
create mode 100755 test/hangup
delete mode 100755 test/hangup-active
diff --git a/Makefile.am b/Makefile.am
index 4410043..a3681c3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -554,7 +554,7 @@ test_scripts = test/backtrace \
test/enter-pin \
test/reset-pin \
test/hangup-all \
- test/hangup-active \
+ test/hangup \
test/set-mms-details \
test/set-roaming-allowed \
test/list-contexts \
diff --git a/test/hangup b/test/hangup
new file mode 100755
index 0000000..6444b23
--- /dev/null
+++ b/test/hangup
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+
+modems = manager.GetModems()
+path = modems[0][0]
+
+manager = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.VoiceCallManager')
+
+calls = manager.GetCalls()
+
+for path, properties in calls:
+ state = properties["State"]
+ print "[ %s ] %s" % (path, state)
+
+ if state != "active":
+ continue
+
+ call = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.VoiceCall')
+
+ call.Hangup()
diff --git a/test/hangup-active b/test/hangup-active
deleted file mode 100755
index 6444b23..0000000
--- a/test/hangup-active
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import dbus
-
-bus = dbus.SystemBus()
-
-manager = dbus.Interface(bus.get_object('org.ofono', '/'),
- 'org.ofono.Manager')
-
-modems = manager.GetModems()
-path = modems[0][0]
-
-manager = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.VoiceCallManager')
-
-calls = manager.GetCalls()
-
-for path, properties in calls:
- state = properties["State"]
- print "[ %s ] %s" % (path, state)
-
- if state != "active":
- continue
-
- call = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.VoiceCall')
-
- call.Hangup()
--
1.7.5.4
9 years, 9 months
[PATCH] test: Add new script for GCF testing
by Guillaume Zajac
---
Makefile.am | 3 ++-
test/hold-and-answer | 20 ++++++++++++++++++++
2 files changed, 22 insertions(+), 1 deletions(-)
create mode 100755 test/hold-and-answer
diff --git a/Makefile.am b/Makefile.am
index b35cf1f..4410043 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -622,7 +622,8 @@ test_scripts = test/backtrace \
test/set-context-property \
test/test-gnss \
test/swap-calls \
- test/release-and-answer
+ test/release-and-answer \
+ test/hold-and-answer
if TEST
testdir = $(pkglibdir)/test
diff --git a/test/hold-and-answer b/test/hold-and-answer
new file mode 100755
index 0000000..2c47e27
--- /dev/null
+++ b/test/hold-and-answer
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+
+modems = manager.GetModems()
+modem = modems[0][0]
+
+if (len(sys.argv) == 2):
+ modem = sys.argv[1]
+
+manager = dbus.Interface(bus.get_object('org.ofono', modem),
+ 'org.ofono.VoiceCallManager')
+
+manager.HoldAndAnswer(timeout=100)
--
1.7.5.4
9 years, 9 months
[PATCH] telit: notify sim inserted when sim ready
by Christopher Vogl
Use AT#QSS=2 instead of AT#QSS=1 to get an URC when the SIM is not only
inserted but ready to be used.
Remove sim_inserted_source and sim_inserted_timeout_cb which are not needed anymore as a
consequence. By the way the 1 second timeout was an ugly hack.
---
plugins/telit.c | 32 ++------------------------------
1 files changed, 2 insertions(+), 30 deletions(-)
diff --git a/plugins/telit.c b/plugins/telit.c
index 6ae7249..7fc2666 100644
--- a/plugins/telit.c
+++ b/plugins/telit.c
@@ -68,7 +68,6 @@ struct telit_data {
GAtChat *chat;
GAtChat *aux;
struct ofono_sim *sim;
- guint sim_inserted_source;
struct ofono_modem *sap_modem;
GIOChannel *bt_io;
GIOChannel *hw_io;
@@ -211,20 +210,6 @@ static GAtChat *open_device(struct ofono_modem *modem,
return chat;
}
-static gboolean sim_inserted_timeout_cb(gpointer user_data)
-{
- struct ofono_modem *modem = user_data;
- struct telit_data *data = ofono_modem_get_data(modem);
-
- DBG("%p", modem);
-
- data->sim_inserted_source = 0;
-
- ofono_sim_inserted_notify(data->sim, TRUE);
-
- return FALSE;
-}
-
static void switch_sim_state_status(struct ofono_modem *modem, int status)
{
struct telit_data *data = ofono_modem_get_data(modem);
@@ -238,16 +223,13 @@ static void switch_sim_state_status(struct ofono_modem *modem, int status)
break;
case 1:
DBG("SIM inserted");
- /* We need to sleep a bit */
- data->sim_inserted_source = g_timeout_add_seconds(1,
- sim_inserted_timeout_cb,
- modem);
break;
case 2:
DBG("SIM inserted and PIN unlocked");
break;
case 3:
DBG("SIM inserted and ready");
+ ofono_sim_inserted_notify(data->sim, TRUE);
break;
}
}
@@ -308,7 +290,7 @@ static void cfun_enable_cb(gboolean ok, GAtResult *result, gpointer user_data)
ofono_modem_set_powered(m, TRUE);
/* Enable sim state notification */
- g_at_chat_send(data->chat, "AT#QSS=1", none_prefix, NULL, NULL, NULL);
+ g_at_chat_send(data->chat, "AT#QSS=2", none_prefix, NULL, NULL, NULL);
/* Follow sim state */
g_at_chat_register(data->chat, "#QSS:", telit_qss_notify,
@@ -397,9 +379,6 @@ static void cfun_disable_cb(gboolean ok, GAtResult *result, gpointer user_data)
g_at_chat_unref(data->chat);
data->chat = NULL;
- if (data->sim_inserted_source > 0)
- g_source_remove(data->sim_inserted_source);
-
if (ok)
ofono_modem_set_powered(modem, FALSE);
@@ -650,18 +629,11 @@ static int telit_probe(struct ofono_modem *modem)
static void telit_remove(struct ofono_modem *modem)
{
- struct telit_data *data = ofono_modem_get_data(modem);
-
DBG("%p", modem);
bluetooth_sap_client_unregister(modem);
ofono_modem_set_data(modem, NULL);
-
- if (data->sim_inserted_source > 0)
- g_source_remove(data->sim_inserted_source);
-
- g_free(data);
}
static struct ofono_modem_driver telit_driver = {
--
1.7.7.6
--
Scanned by MailScanner.
9 years, 9 months
[PATCH] smsutil: <CR> is not necessarily a padding character in CBS message
by Philippe Nunes
---
src/smsutil.c | 37 ++++++++++++++++++++++++++++++-------
1 file changed, 30 insertions(+), 7 deletions(-)
diff --git a/src/smsutil.c b/src/smsutil.c
index a541964..59eb7b1 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -4090,7 +4090,7 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
unsigned char unpacked[CBS_MAX_GSM_CHARS];
long written;
int max_chars;
- int i;
+ int i, j;
max_chars =
sms_text_capacity_gsm(CBS_MAX_GSM_CHARS, taken);
@@ -4102,12 +4102,24 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
i = iso639 ? 3 : 0;
/*
- * CR is a padding character, which means we can
- * safely discard everything afterwards
+ * CR can be used as a padding character, which means
+ * we can safely discard everything afterwards
*/
+
for (; i < written; i++, bufsize++) {
- if (unpacked[i] == '\r')
- break;
+ if (unpacked[i] == '\r') {
+ /*
+ * check if this is a padding character or
+ * if it is a wanted <CR>
+ */
+ for (j=i+1; j < written; j++)
+ if (unpacked[j] != '\r')
+ break;
+
+ if (j == written)
+ break;
+ }
+
buf[bufsize] = unpacked[i];
}
@@ -4135,8 +4147,19 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
}
while (i < max_offset) {
- if (ud[i] == 0x00 && ud[i+1] == '\r')
- break;
+ if (ud[i] == 0x00 && ud[i+1] == '\r') {
+ int j = i+2;
+
+ while (j < max_offset) {
+ if (ud[j] != 0x00 || ud[j+1] != '\r')
+ break;
+
+ j += 2;
+ }
+
+ if (j == max_offset)
+ break;
+ }
buf[bufsize] = ud[i];
buf[bufsize + 1] = ud[i+1];
--
1.7.9.5
9 years, 9 months