[PATCH 1/1] Set MNC length to 2 if EFad doesn't specify it
by Jonas Bonn
Byte 4 of the EFAD structure, which specifies the MNC length, is optional.
If this byte is not present, then there is no way to determine the length
of the MNC. As the, by far, most common length is 2, we might as well
default to this value.
This patch changes the ofono_error to a warning as it's not really an
error that we're encountering, but the user should nonetheless be given
a heads-up that something might not work as expected.
Signed-off-by: Jonas Bonn <jonas(a)southpole.se>
---
src/sim.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/sim.c b/src/sim.c
index 4384eb0..f6109c6 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -1760,7 +1760,9 @@ static void sim_ad_read_cb(int ok, int length, int record,
return;
if (length < 4) {
- ofono_error("EFad should contain at least four bytes");
+ ofono_warn("EFad does not specify (optional) MNC length"
+ ", defaulting to 2");
+ sim->mnc_length = 2;
return;
}
--
1.7.9.5
8 years, 2 months
PinRequired value during sim initialization
by Cedric Jehasse
Hi,
Immediately after the 'Present' property changes to true on
org.ofono.SimManager, i read the 'PinRequired' property. Because the
sim is not yet initialized this is set to "none". It would be nice if
this was set to "notinitialized", or if there would be an additional
property to know if sim initialization is done.
Thanks,
Cedric
8 years, 3 months
[PATCH 0/3] gdbus patches
by Lucas De Marchi
These patches were applied to BlueZ repository. Please, have a look and apply
them on other projects.
Johan Hedberg (1):
gdbus: Fix crash when getting disconnected from the bus
Lucas De Marchi (2):
gdbus: Fix wrong signal handler match
gdbus: Refactor filter_data_find()
gdbus/mainloop.c | 9 ++--
gdbus/watch.c | 122 ++++++++++++++++++++++++++++++++++++-------------------
2 files changed, 86 insertions(+), 45 deletions(-)
--
1.7.12.1
8 years, 3 months
[PATCH 00/11] Samsung IPC modem support
by Simon Busch
Heyho,
the following patch series adds support for the Samsung IPC protocol which is implemented
in an external library called libsamsung-ipc (see [0]). The library contains the
implementation of the protocol used in most Samsung mobile handsets. As of right now the
implementation contains drivers for the devinfo, sim, voicecall, gprs and gprs-context
subsystems. Implementation for other subsystems like sms will follow.
I submit the patches here for a first review to make sure things I did are right and are
fine for inclusion in ofono. Anyway the code is not ready yet and needs more tweaking and
testing but I think it's time for a first look.
One thing about libsamsung-ipc: The library itself needs some rework and fine tuning and
is not ready for a release yet so this is a hard dependency for the inclusion in ofono.
regards,
Simon
[0]: https://github.com/morphis/libsamsung-ipc
Simon Busch (11):
build: Add skeleton for Samsung IPC modem driver
build: add dependency for samsung-ipc library
samsungmgr: plugin for powering up samsung related modems via an
additional daemon
samsungipcmodem: implement the transport layer for the IPC protocol
samsungipcmodem: add devinfo driver implementation
samsungipcmodem: add sim driver implementation
samsungipcmodem: add network registration driver implementation
samsungipcmodem: add voicecall driver implementation
samsungipcmodem: add gprs driver implementation
samsungipcmodem: add gprs-context driver implementation
samsungipc: Add initial implementation of the Samsung IPC modem
plugin
Makefile.am | 25 +
configure.ac | 11 +
drivers/samsungipcmodem/devinfo.c | 214 ++++++++
drivers/samsungipcmodem/gprs-context.c | 311 +++++++++++
drivers/samsungipcmodem/gprs.c | 215 ++++++++
drivers/samsungipcmodem/ipc.c | 443 ++++++++++++++++
drivers/samsungipcmodem/ipc.h | 58 ++
drivers/samsungipcmodem/network-registration.c | 398 ++++++++++++++
drivers/samsungipcmodem/samsungipcmodem.c | 53 ++
drivers/samsungipcmodem/samsungipcmodem.h | 33 ++
drivers/samsungipcmodem/sim.c | 674 ++++++++++++++++++++++++
drivers/samsungipcmodem/util.h | 57 ++
drivers/samsungipcmodem/voicecall.c | 358 +++++++++++++
plugins/samsungipc.c | 414 +++++++++++++++
plugins/samsungmgr.c | 199 +++++++
15 files changed, 3463 insertions(+)
create mode 100644 drivers/samsungipcmodem/devinfo.c
create mode 100644 drivers/samsungipcmodem/gprs-context.c
create mode 100644 drivers/samsungipcmodem/gprs.c
create mode 100644 drivers/samsungipcmodem/ipc.c
create mode 100644 drivers/samsungipcmodem/ipc.h
create mode 100644 drivers/samsungipcmodem/network-registration.c
create mode 100644 drivers/samsungipcmodem/samsungipcmodem.c
create mode 100644 drivers/samsungipcmodem/samsungipcmodem.h
create mode 100644 drivers/samsungipcmodem/sim.c
create mode 100644 drivers/samsungipcmodem/util.h
create mode 100644 drivers/samsungipcmodem/voicecall.c
create mode 100644 plugins/samsungipc.c
create mode 100644 plugins/samsungmgr.c
--
1.7.9.5
8 years, 4 months
ofono exits after DBUS error
by Cedric Jehasse
Hi,
It looks like "AT+COPS?" returns an invalid character. I guess this is
passed to DBUS which causes oFono to exit.
ofonod[10318]: PCUI: > AT+COPS=3,2\r
ofonod[10318]: PCUI: < \r\nOK\r\n
ofonod[10318]: PCUI: > AT+COPS?\r
ofonod[10318]: PCUI: < \r\n+COPS: 0,2,"20620",2\r\n\r\nOK\r\n
ofonod[10318]: drivers/atmodem/network-registration.c:cops_numeric_cb()
Cops numeric got mcc: 206, mnc: 20
ofonod[10318]: PCUI: > AT+CSQ\r
ofonod[10318]: PCUI: < \r\n+CSQ: 16,99\r\n\r\nOK\r\n
ofonod[10318]: drivers/atmodem/network-registration.c:csq_cb() csq_cb: 16
ofonod[10318]: src/network.c:ofono_netreg_strength_notify() strength 51
ofonod[10318]: PCUI: > AT+CGATT=1\r
ofonod[10318]: PCUI: < \r\n+CREG: 1,12F,9E13\r\n\r\n+CGREG: 1,12F,9E13\r\n
ofonod[10318]: PCUI: < \r\nOK\r\n
ofonod[10318]: src/network.c:ofono_netreg_status_notify() /huawei_1
status 1 tech -1
ofonod[10318]: src/cbs.c:cbs_location_changed() 1, 303, 40467, -1, (null)(null)
ofonod[10318]: src/gprs.c:netreg_status_changed() 1
ofonod[10318]: src/gprs.c:ofono_gprs_status_notify() /huawei_1 status 1
ofonod[10318]: src/gprs.c:gprs_attach_callback() /huawei_1 error = 0
ofonod[10318]: PCUI: > AT+COPS=3,0\r
ofonod[10318]: PCUI: < \r\nOK\r\n
ofonod[10318]: PCUI: > AT+COPS?\r
ofonod[10318]: PCUI: < \r\n+COPS: 0,0,"BASE\241",2\r\n\r\nOK\r\n
ofonod[10318]: drivers/atmodem/network-registration.c:cops_cb()
cops_cb: BASE�, 206 20 2
ofonod[10318]: src/network.c:current_operator_callback() 0x8bbc410, (nil)
process 10318: arguments to dbus_message_iter_append_basic() were
incorrect, assertion "_dbus_check_is_valid_utf8 (*string_p)" failed in
file ../../dbus/dbus-message.c line 2534.
This is normally a bug in some application using the D-Bus library.
ofonod[10318]: src/cbs.c:cbs_location_changed() 1, 303, 40467, -1, 20620
ofonod[10318]: src/cbs.c:cbs_location_changed() 1, 0, 0
ofonod[10318]: src/gprs.c:netreg_status_changed() 1
ofonod[10318]: PCUI: > AT+COPS=3,2\r
ofonod[10318]: System bus has disconnected!
ofonod[10318]: src/plugin.c:__ofono_plugin_cleanup()
ofonod[10318]: plugins/push-notification.c:push_notification_exit()
ofonod[10318]: plugins/smart-messaging.c:smart_messaging_exit()
ofonod[10318]: src/cdma-provision.c:ofono_cdma_provision_driver_unregister()
driver: 0x816f4c0 name: CDMA provisioning
ofonod[10318]: src/gprs-provision.c:ofono_gprs_provision_driver_unregister()
driver: 0x816f480 name: Provisioning
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816f420, name: sim900
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816f3c0, name: samsung
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816f360, name: speedupcdma
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816f300, name: speedup
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816f2a0, name: alcatel
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816f240, name: icera
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816f1e0, name: linktop
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816f180, name: nokiacdma
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816f120, name: nokia
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816f0c0, name: tc65
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816f020, name: ste
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816efc0, name: ifx
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816ef60, name: palmpre
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816ef00, name: novatel
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816eea0, name: sierra
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816ee20, name: huawei
ofonod[10318]: src/modem.c:modem_unregister() 0x8bb4ae8
ofonod[10318]: src/modem.c:modem_change_state() old state: 3, new state: 0
ofonod[10318]: src/modem.c:flush_atoms()
ofonod[10318]: src/ussd.c:ussd_remove() atom: 0x8bb84d0
ofonod[10318]: src/network.c:__ofono_netreg_remove_status_watch() 0x8bbc410
ofonod[10318]: src/cbs.c:cbs_remove() atom: 0x8bbb840
ofonod[10318]: src/sim.c:ofono_sim_remove_spn_watch() 0x8bc8cd8
ofonod[10318]: src/network.c:netreg_remove() atom: 0x8bbb820
ofonod[10318]: src/gprs.c:gprs_context_unregister() 0x8bbb8c0, 0x8bbb790
ofonod[10318]: src/gprs.c:gprs_context_remove() atom: 0x8bbb8e0
ofonod[10318]: drivers/atmodem/gprs-context.c:at_gprs_context_remove()
ofonod[10318]: src/gprs.c:gprs_unregister() 0x8bbb790
ofonod[10318]: src/gprs.c:gprs_remove() atom: 0x8bc9478
ofonod[10318]: plugins/push-notification.c:push_notification_cleanup() 0x8bb8bc8
ofonod[10318]: plugins/smart-messaging.c:smart_messaging_cleanup() 0x8bb6f68
ofonod[10318]: src/sms.c:sms_remove() atom: 0x8bb9308
ofonod[10318]: src/radio-settings.c:radio_settings_remove() atom: 0x8bb9218
ofonod[10318]: src/phonebook.c:phonebook_remove() atom: 0x8bb92b8
ofonod[10318]: src/sim.c:sim_remove() atom: 0x8bb8e68
ofonod[10318]: src/modem.c:devinfo_remove() atom: 0x8bc8ef8
ofonod[10318]: plugins/huawei.c:huawei_disable() 0x8bb4ae8
ofonod[10318]: plugins/huawei.c:huawei_remove() 0x8bb4ae8
ofonod[10318]: src/modem.c:unregister_property() property 0x8bb8700
ofonod[10318]: src/modem.c:unregister_property() property 0x8bb54f0
ofonod[10318]: src/modem.c:unregister_property() property 0x8bc9d40
ofonod[10318]: src/modem.c:emit_modem_removed() 0x8bb4ae8
ofonod[10318]: src/modem.c:call_modemwatches() 0x8bb4ae8 added:0
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816edc0, name: zte
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816ed60, name: hso
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816ed00, name: mbm
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816eca0, name: calypso
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816ec40, name: wavecom
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816ebe0, name: gobi
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816eb80, name: g1
ofonod[10318]: src/cdma-voicecall.c:ofono_cdma_voicecall_driver_unregister()
driver: 0x816eb00, name: cdmamodem
ofonod[10318]: src/modem.c:ofono_devinfo_driver_unregister() driver:
0x816eb20, name: cdmamodem
ofonod[10318]: src/cdma-connman.c:ofono_cdma_connman_driver_unregister()
driver: 0x816eb44, name: cdmamodem
ofonod[10318]: src/ctm.c:ofono_ctm_driver_unregister() driver:
0x816ea20, name: phonesim
ofonod[10318]: src/gprs.c:ofono_gprs_context_driver_unregister()
driver: 0x816ea34, name: phonesim
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816ea60, name: phonesim
ofonod[10318]: src/ussd.c:ofono_ussd_driver_unregister() driver:
0x816e9e0, name: speedupmodem
ofonod[10318]: src/voicecall.c:ofono_voicecall_driver_unregister()
driver: 0x816e8c0, name: hfpmodem
ofonod[10318]: src/modem.c:ofono_devinfo_driver_unregister() driver:
0x816e97c, name: hfpmodem
ofonod[10318]: src/network.c:ofono_netreg_driver_unregister() driver:
0x816e920, name: hfpmodem
ofonod[10318]: src/call-volume.c:ofono_call_volume_driver_unregister()
driver: 0x816e954, name: hfpmodem
ofonod[10318]: src/handsfree.c:ofono_handsfree_driver_unregister()
driver: 0x816e998, name: hfpmodem
ofonod[10318]: src/network.c:ofono_netreg_driver_unregister() driver:
0x816e840, name: dunmodem
ofonod[10318]: src/gprs.c:ofono_gprs_driver_unregister() driver:
0x816e86c, name: dunmodem
ofonod[10318]: src/voicecall.c:ofono_voicecall_driver_unregister()
driver: 0x816e760, name: stemodem
ofonod[10318]: src/gprs.c:ofono_gprs_context_driver_unregister()
driver: 0x816e7ec, name: stemodem
ofonod[10318]: src/radio-settings.c:ofono_radio_settings_driver_unregister()
driver: 0x816e7c0, name: stemodem
ofonod[10318]: src/stk.c:ofono_stk_driver_unregister() driver:
0x816e6f0, name: ifxmodem
ofonod[10318]: src/gprs.c:ofono_gprs_context_driver_unregister()
driver: 0x816e6cc, name: ifxmodem
ofonod[10318]: src/radio-settings.c:ofono_radio_settings_driver_unregister()
driver: 0x816e6a0, name: ifxmodem
ofonod[10318]: src/audio-settings.c:ofono_audio_settings_driver_unregister()
driver: 0x816e670, name: ifxmodem
ofonod[10318]: src/voicecall.c:ofono_voicecall_driver_unregister()
driver: 0x816e620, name: ifxmodem
ofonod[10318]: src/ctm.c:ofono_ctm_driver_unregister() driver:
0x816e718, name: ifxmodem
ofonod[10318]: src/gprs.c:ofono_gprs_context_driver_unregister()
driver: 0x816e5a0, name: hsomodem
ofonod[10318]: src/radio-settings.c:ofono_radio_settings_driver_unregister()
driver: 0x816e5c0, name: hsomodem
ofonod[10318]: src/location-reporting.c:ofono_location_reporting_driver_unregister()
driver: 0x816e544, name: mbmmodem
ofonod[10318]: src/stk.c:ofono_stk_driver_unregister() driver:
0x816e524, name: mbmmodem
ofonod[10318]: src/gprs.c:ofono_gprs_context_driver_unregister()
driver: 0x816e500, name: mbmmodem
ofonod[10318]: src/stk.c:ofono_stk_driver_unregister() driver:
0x816e4a8, name: calypsomodem
ofonod[10318]: src/voicecall.c:ofono_voicecall_driver_unregister()
driver: 0x816e460, name: calypsomodem
ofonod[10318]: src/cdma-netreg.c:ofono_cdma_netreg_driver_unregister()
driver: 0x816e40c, name: huaweimodem
ofonod[10318]: src/gprs.c:ofono_gprs_context_driver_unregister()
driver: 0x816e3bc, name: huaweimodem
ofonod[10318]: src/radio-settings.c:ofono_radio_settings_driver_unregister()
driver: 0x816e3e0, name: huaweimodem
ofonod[10318]: src/audio-settings.c:ofono_audio_settings_driver_unregister()
driver: 0x816e3a8, name: huaweimodem
ofonod[10318]: src/voicecall.c:ofono_voicecall_driver_unregister()
driver: 0x816e360, name: huaweimodem
ofonod[10318]: src/ussd.c:ofono_ussd_driver_unregister() driver:
0x816e340, name: huaweimodem
ofonod[10318]: src/radio-settings.c:ofono_radio_settings_driver_unregister()
driver: 0x816e2e0, name: ztemodem
ofonod[10318]: src/gprs.c:ofono_gprs_context_driver_unregister()
driver: 0x816e2a0, name: swmodem
ofonod[10318]: src/radio-settings.c:ofono_radio_settings_driver_unregister()
driver: 0x816e240, name: nwmodem
ofonod[10318]: src/sim-auth.c:ofono_sim_auth_driver_unregister()
driver: 0x816e1cc, name: atmodem
ofonod[10318]: src/stk.c:ofono_stk_driver_unregister() driver:
0x816e05c, name: atmodem
ofonod[10318]: src/sim.c:ofono_sim_driver_unregister() driver:
0x816df60, name: atmodem
ofonod[10318]: src/sim.c:ofono_sim_driver_unregister() driver:
0x816dfc0, name: atmodem-noef
ofonod[10318]: src/sms.c:ofono_sms_driver_unregister() driver:
0x816dde0, name: atmodem
ofonod[10318]: src/ussd.c:ofono_ussd_driver_unregister() driver:
0x816e07c, name: atmodem
ofonod[10318]: src/phonebook.c:ofono_phonebook_driver_unregister()
driver: 0x816e118, name: atmodem
ofonod[10318]: src/call-settings.c:ofono_call_settings_driver_unregister()
driver: 0x816dd60, name: atmodem
ofonod[10318]: src/call-meter.c:ofono_call_meter_driver_unregister()
driver: 0x816dea0, name: atmodem
ofonod[10318]: src/call-forwarding.c:ofono_call_forwarding_driver_unregister()
driver: 0x816de60, name: atmodem
ofonod[10318]: src/call-barring.c:ofono_call_barring_driver_unregister()
driver: 0x816e0f8, name: atmodem
ofonod[10318]: src/network.c:ofono_netreg_driver_unregister() driver:
0x816df00, name: atmodem
ofonod[10318]: src/modem.c:ofono_devinfo_driver_unregister() driver:
0x816e140, name: atmodem
ofonod[10318]: src/voicecall.c:ofono_voicecall_driver_unregister()
driver: 0x816e0a0, name: atmodem
ofonod[10318]: src/cbs.c:ofono_cbs_driver_unregister() driver:
0x816de40, name: atmodem
ofonod[10318]: src/call-volume.c:ofono_call_volume_driver_unregister()
driver: 0x816e164, name: atmodem
ofonod[10318]: src/gprs.c:ofono_gprs_driver_unregister() driver:
0x816e194, name: atmodem
ofonod[10318]: src/gprs.c:ofono_gprs_context_driver_unregister()
driver: 0x816e1b8, name: atmodem
ofonod[10318]: src/gnss.c:ofono_gnss_driver_unregister() driver:
0x816e1e4, name: atmodem
ofonod[10318]: src/modem.c:ofono_devinfo_driver_unregister() driver:
0x816db20, name: u8500
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816db40, name: u8500
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816dac0, name: n900
ofonod[10318]: src/modem.c:ofono_modem_driver_unregister() driver:
0x816da60, name: isiusb
ofonod[10318]: src/modem.c:ofono_devinfo_driver_unregister() driver:
0x816d750, name: isimodem
ofonod[10318]: src/phonebook.c:ofono_phonebook_driver_unregister()
driver: 0x816d740, name: isimodem
ofonod[10318]: src/network.c:ofono_netreg_driver_unregister() driver:
0x816d780, name: isimodem
ofonod[10318]: src/voicecall.c:ofono_voicecall_driver_unregister()
driver: 0x816d7c0, name: isimodem
ofonod[10318]: src/sms.c:ofono_sms_driver_unregister() driver:
0x816d820, name: isimodem
ofonod[10318]: src/cbs.c:ofono_cbs_driver_unregister() driver:
0x816d840, name: isimodem
ofonod[10318]: src/sim.c:ofono_sim_driver_unregister() driver:
0x816d860, name: isimodem
ofonod[10318]: src/ussd.c:ofono_ussd_driver_unregister() driver:
0x816d8a8, name: isimodem
ofonod[10318]: src/call-forwarding.c:ofono_call_forwarding_driver_unregister()
driver: 0x816d8c0, name: isimodem
ofonod[10318]: src/call-settings.c:ofono_call_settings_driver_unregister()
driver: 0x816d8e0, name: isimodem
ofonod[10318]: src/call-barring.c:ofono_call_barring_driver_unregister()
driver: 0x816d910, name: isimodem
ofonod[10318]: src/call-meter.c:ofono_call_meter_driver_unregister()
driver: 0x816d940, name: isimodem
ofonod[10318]: src/radio-settings.c:ofono_radio_settings_driver_unregister()
driver: 0x816d980, name: isimodem
ofonod[10318]: src/gprs.c:ofono_gprs_driver_unregister() driver:
0x816d9a4, name: isimodem
ofonod[10318]: src/gprs.c:ofono_gprs_context_driver_unregister()
driver: 0x816d9b8, name: isimodem
ofonod[10318]: src/audio-settings.c:ofono_audio_settings_driver_unregister()
driver: 0x816d9cc, name: isimodem
ofonod[10318]: src/sim.c:ofono_sim_driver_unregister() driver:
0x816d9e0, name: wgmodem2.5
ofonod[10318]: plugins/udevng.c:destroy_modem()
/sys/devices/pci0000:00/0000:00:0b.0/usb1/1-1
ofonod[10318]: src/modem.c:ofono_modem_remove() 0x8bb4ae8
ofonod[10318]: plugins/udevng.c:destroy_modem() /dev/ttyUSB0
ofonod[10318]: plugins/udevng.c:destroy_modem() /dev/ttyUSB1
ofonod[10318]: plugins/udevng.c:destroy_modem() /dev/ttyUSB2
ofonod[10318]: Exit
thanks,
Cedric
8 years, 4 months
[PATCH] stkagent: Sanitize any output from the agent
by Philippe Nunes
---
src/stkagent.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 53 insertions(+), 3 deletions(-)
diff --git a/src/stkagent.c b/src/stkagent.c
index 63b82f3..dbcc962 100644
--- a/src/stkagent.c
+++ b/src/stkagent.c
@@ -59,6 +59,9 @@ struct stk_agent {
DBusPendingCall *call;
void *user_cb;
void *user_data;
+ int min_length;
+ int max_length;
+ ofono_bool_t hidden_entry;
ofono_destroy_func user_destroy;
const struct stk_menu *request_selection_menu;
@@ -539,14 +542,24 @@ static void get_digit_cb(DBusPendingCall *call, void *data)
if (dbus_message_get_args(reply, NULL,
DBUS_TYPE_STRING, &digit,
- DBUS_TYPE_INVALID) == FALSE ||
- strlen(digit) != 1 ||
- !valid_phone_number_format(digit)) {
+ DBUS_TYPE_INVALID) == FALSE) {
ofono_error("Can't parse the reply to GetDigit()");
remove_agent = TRUE;
goto error;
}
+ if (strlen(digit) != 1 || !strspn(digit, "0123456789*#+")) {
+ ofono_error("Invalid character");
+ remove_agent = TRUE;
+ goto error;
+ }
+
+ if (agent->hidden_entry && digit[0] == '+') {
+ ofono_error("The character + is not allowed in this mode");
+ remove_agent = TRUE;
+ goto error;
+ }
+
cb(result, digit, agent->user_data);
CALLBACK_END();
@@ -578,6 +591,7 @@ int stk_agent_request_digit(struct stk_agent *agent, const char *text,
agent->user_cb = cb;
agent->user_data = user_data;
agent->user_destroy = destroy;
+ agent->hidden_entry = FALSE;
dbus_pending_call_set_notify(agent->call, get_digit_cb, agent, NULL);
@@ -610,6 +624,7 @@ int stk_agent_request_quick_digit(struct stk_agent *agent, const char *text,
agent->user_cb = cb;
agent->user_data = user_data;
agent->user_destroy = destroy;
+ agent->hidden_entry = TRUE;
dbus_pending_call_set_notify(agent->call, get_digit_cb, agent, NULL);
@@ -692,6 +707,7 @@ static void get_digits_cb(DBusPendingCall *call, void *data)
enum stk_agent_result result;
gboolean remove_agent;
char *string;
+ int len, span;
if (check_error(agent, reply,
ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE,
@@ -713,6 +729,25 @@ static void get_digits_cb(DBusPendingCall *call, void *data)
goto error;
}
+ len = strlen(string);
+
+ if (len < agent->min_length || len > agent->max_length) {
+ ofono_error("Length not acceptable");
+ remove_agent = TRUE;
+ goto error;
+ }
+
+ if (agent->hidden_entry)
+ span = strspn(string, "0123456789*#");
+ else
+ span = strspn(string, "0123456789*#+");
+
+ if (span != len) {
+ ofono_error("Invalid character found");
+ remove_agent = TRUE;
+ goto error;
+ }
+
cb(result, string, agent->user_data);
CALLBACK_END();
@@ -756,6 +791,9 @@ int stk_agent_request_digits(struct stk_agent *agent, const char *text,
agent->user_cb = cb;
agent->user_data = user_data;
agent->user_destroy = destroy;
+ agent->min_length = min_val;
+ agent->max_length = max_val;
+ agent->hidden_entry = hidden_val;
dbus_pending_call_set_notify(agent->call, get_digits_cb, agent, NULL);
@@ -770,6 +808,7 @@ static void get_input_cb(DBusPendingCall *call, void *data)
enum stk_agent_result result;
gboolean remove_agent;
char *string;
+ int len;
if (check_error(agent, reply,
ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE,
@@ -791,6 +830,14 @@ static void get_input_cb(DBusPendingCall *call, void *data)
goto error;
}
+ len = g_utf8_strlen(string, -1);
+
+ if (len < agent->min_length || len > agent->max_length) {
+ ofono_error("Length not acceptable");
+ remove_agent = TRUE;
+ goto error;
+ }
+
cb(result, string, agent->user_data);
CALLBACK_END();
@@ -835,6 +882,9 @@ int stk_agent_request_input(struct stk_agent *agent, const char *text,
agent->user_cb = cb;
agent->user_data = user_data;
agent->user_destroy = destroy;
+ agent->min_length = min_val;
+ agent->max_length = max_val;
+ agent->hidden_entry = hidden_val;
dbus_pending_call_set_notify(agent->call, get_input_cb, agent, NULL);
--
1.7.9.5
8 years, 4 months
[PATCH] TODO: Set number of significant digits in settings
by Ronald Tessier
This patch concerns mmsd.
The number of significant digits is country dependant, mmsd cannot know the
local numbering plan and so needs this information from the upper layer.
---
TODO | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/TODO b/TODO
index 6e54f6f..3635a2f 100644
--- a/TODO
+++ b/TODO
@@ -63,6 +63,19 @@ MMS Delivery Report
Owner: Sébastien Bianti <sebastien.bianti(a)linux.intel.com>
+MMS Settings
+============
+
+- Add an entry in MMS settings file to set number of significant digits
+ (i.e.: last digits of the phone number).
+ Use this value to match international and local phone number when dealing with
+ conversation or delivery report.
+
+ Priority: Medium
+ Complexity: C2
+ Owner:
+
+
D-Bus API
=========
--
1.7.9.5
8 years, 4 months
[PATCH v4 1/3] smsutil: Fix style issues
by Philippe Nunes
---
src/smsutil.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/smsutil.c b/src/smsutil.c
index a541964..b4d129f 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -81,11 +81,11 @@ void extract_bcd_number(const unsigned char *buf, int len, char *out)
for (i = 0; i < len; i++) {
oct = buf[i];
- out[i*2] = digit_lut[oct & 0x0f];
- out[i*2+1] = digit_lut[(oct & 0xf0) >> 4];
+ out[i * 2] = digit_lut[oct & 0x0f];
+ out[i * 2 + 1] = digit_lut[(oct & 0xf0) >> 4];
}
- out[i*2] = '\0';
+ out[i * 2] = '\0';
}
static inline int to_semi_oct(char in)
@@ -600,7 +600,7 @@ gboolean sms_encode_address_field(const struct sms_address *in, gboolean sc,
out:
pdu[0] = addr_len;
pdu[1] = (in->number_type << 4) | in->numbering_plan | 0x80;
- memcpy(pdu+2, p, (sc ? addr_len - 1 : (addr_len + 1) / 2));
+ memcpy(pdu + 2, p, (sc ? addr_len - 1 : (addr_len + 1) / 2));
*offset = *offset + 2 + (sc ? addr_len - 1 : (addr_len + 1) / 2);
@@ -768,7 +768,7 @@ static gboolean decode_deliver(const unsigned char *pdu, int len,
if ((len - offset) < expected)
return FALSE;
- memcpy(out->deliver.ud, pdu+offset, expected);
+ memcpy(out->deliver.ud, pdu + offset, expected);
return TRUE;
}
@@ -929,11 +929,11 @@ static gboolean decode_submit_report(const unsigned char *pdu, int len,
if (out->type == SMS_TYPE_SUBMIT_REPORT_ERROR) {
out->submit_err_report.udl = udl;
memcpy(out->submit_err_report.ud,
- pdu+offset, expected);
+ pdu + offset, expected);
} else {
out->submit_ack_report.udl = udl;
memcpy(out->submit_ack_report.ud,
- pdu+offset, expected);
+ pdu + offset, expected);
}
}
@@ -1063,7 +1063,7 @@ static gboolean decode_status_report(const unsigned char *pdu, int len,
if ((len - offset) < expected)
return FALSE;
- memcpy(out->status_report.ud, pdu+offset, expected);
+ memcpy(out->status_report.ud, pdu + offset, expected);
}
return TRUE;
@@ -1214,11 +1214,11 @@ static gboolean decode_deliver_report(const unsigned char *pdu, int len,
if (out->type == SMS_TYPE_DELIVER_REPORT_ERROR) {
out->deliver_err_report.udl = udl;
memcpy(out->deliver_err_report.ud,
- pdu+offset, expected);
+ pdu + offset, expected);
} else {
out->deliver_ack_report.udl = udl;
memcpy(out->deliver_ack_report.ud,
- pdu+offset, expected);
+ pdu + offset, expected);
}
}
@@ -1371,7 +1371,7 @@ static gboolean decode_submit(const unsigned char *pdu, int len,
if (expected > (int) sizeof(out->submit.ud))
return FALSE;
- memcpy(out->submit.ud, pdu+offset, expected);
+ memcpy(out->submit.ud, pdu + offset, expected);
return TRUE;
}
@@ -1450,7 +1450,7 @@ static gboolean decode_command(const unsigned char *pdu, int len,
if ((len - offset) < out->command.cdl)
return FALSE;
- memcpy(out->command.cd, pdu+offset, out->command.cdl);
+ memcpy(out->command.cd, pdu + offset, out->command.cdl);
return TRUE;
}
@@ -1866,7 +1866,7 @@ void sms_address_from_string(struct sms_address *addr, const char *str)
addr->numbering_plan = SMS_NUMBERING_PLAN_ISDN;
if (str[0] == '+') {
addr->number_type = SMS_NUMBER_TYPE_INTERNATIONAL;
- strcpy(addr->address, str+1);
+ strcpy(addr->address, str + 1);
} else {
addr->number_type = SMS_NUMBER_TYPE_UNKNOWN;
strcpy(addr->address, str);
@@ -4139,7 +4139,7 @@ char *cbs_decode_text(GSList *cbs_list, char *iso639_lang)
break;
buf[bufsize] = ud[i];
- buf[bufsize + 1] = ud[i+1];
+ buf[bufsize + 1] = ud[i + 1];
bufsize += 2;
i += 2;
--
1.7.9.5
8 years, 4 months
[PATCH v2 1/2] stk: convert to phone number format and remove DTMF string
by Philippe Nunes
The dialing number provided by the Setup Call proactive command
may contain pause and DTMF characters.
---
src/stk.c | 58 +++++++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 43 insertions(+), 15 deletions(-)
diff --git a/src/stk.c b/src/stk.c
index 19cb0eb..0a279bf 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -104,6 +104,27 @@ static void timers_update(struct ofono_stk *stk);
result.additional_len = sizeof(addn_info); \
result.additional = addn_info; \
+static gboolean convert_to_phone_number_format(const char *input_str,
+ char *output_str)
+{
+ char *digit;
+ char *digit_from = "01234567890abcABC";
+ char *digit_to = "01234567890*#p*#p";
+ int pos;
+
+ for (pos = 0; input_str[pos] != '\0'; pos++) {
+ digit = strchr(digit_from, input_str[pos]);
+ if (digit == NULL)
+ return FALSE;
+
+ output_str[pos] = digit_to[digit - digit_from];
+ }
+
+ output_str[pos] = '\0';
+
+ return TRUE;
+}
+
static int stk_respond(struct ofono_stk *stk, struct stk_response *rsp,
ofono_stk_generic_cb_t cb)
{
@@ -1715,6 +1736,8 @@ static void confirm_call_cb(enum stk_agent_result result, gboolean confirm,
char *alpha_id = NULL;
struct ofono_voicecall *vc;
struct stk_response rsp;
+ char number[256];
+ char *pause_chr;
int err;
switch (result) {
@@ -1752,7 +1775,20 @@ static void confirm_call_cb(enum stk_agent_result result, gboolean confirm,
}
}
- err = __ofono_voicecall_dial(vc, sc->addr.number, sc->addr.ton_npi,
+ /* Convert the setup call number to phone number format */
+ if (convert_to_phone_number_format(sc->addr.number, number) == FALSE) {
+ send_simple_response(stk, STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD);
+ return;
+ }
+
+ /* Remove the DTMF string from the phone number */
+ pause_chr = strchr(number,'p');
+
+ if (pause_chr)
+ number[pause_chr - number] = '\0';
+
+ /* TODO: send the DTMF after call is connected */
+ err = __ofono_voicecall_dial(vc, number, sc->addr.ton_npi,
alpha_id, sc->icon_id_call_setup.id,
qualifier >> 1, call_setup_connected,
stk);
@@ -2353,10 +2389,8 @@ static gboolean handle_command_send_dtmf(const struct stk_command *cmd,
{
static unsigned char not_in_speech_call_result[] = { 0x07 };
struct ofono_voicecall *vc = NULL;
- char dtmf[256], *digit;
- char *dtmf_from = "01234567890abcABC";
- char *dtmf_to = "01234567890*#p*#p";
- int err, pos;
+ char dtmf[256];
+ int err;
vc = __ofono_atom_find(OFONO_ATOM_TYPE_VOICECALL,
__ofono_atom_get_modem(stk->atom));
@@ -2366,18 +2400,12 @@ static gboolean handle_command_send_dtmf(const struct stk_command *cmd,
}
/* Convert the DTMF string to phone number format */
- for (pos = 0; cmd->send_dtmf.dtmf[pos] != '\0'; pos++) {
- digit = strchr(dtmf_from, cmd->send_dtmf.dtmf[pos]);
- if (digit == NULL) {
- rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
- return TRUE;
- }
-
- dtmf[pos] = dtmf_to[digit - dtmf_from];
+ if (convert_to_phone_number_format(cmd->send_dtmf.dtmf, dtmf) ==
+ FALSE) {
+ rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
+ return TRUE;
}
- dtmf[pos] = '\0';
-
err = __ofono_voicecall_tone_send(vc, dtmf, dtmf_sent_cb, stk);
if (err == -ENOSYS) {
--
1.7.9.5
8 years, 4 months
Huawei E1552 powered timeout
by Cedric Jehasse
Hi,
sometimes when i try to set the "Powered" property for a Huawei E1552,
it times out.
In huawei_enable() "ATE0 +CMEE=1" is sent to the modem and the pcui
port. It looks like the device doesn't always send a response on both
ports.
I think this device has problems handling AT commands on both ports at
the same time.
Could there be a compatibility problem with other Huawei devices, if
these AT commands are only sent on one port?
ofonod[9065]: plugins/huawei.c:huawei_enable() 0x98e95b0
ofonod[9065]: src/modem.c:get_modem_property() modem 0x98e95b0 property Modem
ofonod[9065]: plugins/huawei.c:open_device() Modem /dev/ttyUSB0
ofonod[9065]: src/modem.c:get_modem_property() modem 0x98e95b0 property Pcui
ofonod[9065]: plugins/huawei.c:open_device() Pcui /dev/ttyUSB2
ofonod[9065]: Modem: > ATE0 +CMEE=1\r
ofonod[9065]: PCUI: > ATE0 +CMEE=1\r
ofonod[9065]: PCUI: < \r\nOK\r\n
ofonod[9065]: PCUI: > ATI\r
ofonod[9065]: src/modem.c:set_powered_timeout() modem: 0x98e95b0
Thanks,
Cedric
8 years, 4 months