Compare commits

...

2510 Commits

Author SHA1 Message Date
Pekka Vuorela
32ab6b3c78 Merge pull request #44 from sailfishos/broadband_info_dependency
[ofono] Require (again) mobile-broadband-provider-info. JB#57703
2024-02-20 14:25:05 +02:00
Pekka Vuorela
13c8d6cf97 [ofono] Require (again) mobile-broadband-provider-info. JB#57703
Commit 33744c51 made it recommended only, but the reason for change
seemed more of not failing building images without anything providing
the ofono-configs. On provider-info there shouldn't be similar
problems and there should be a dependency for it.
2024-02-20 13:15:00 +02:00
Pekka Vuorela
a7227c6cad Merge pull request #43 from sailfishos/conf_unit_test
[ofono] Don't care about whitespace in config unit test. JB#61330
2024-02-19 16:01:47 +02:00
Pekka Vuorela
cff7c7adb1 [ofono] Don't care about whitespace in config unit test. JB#61330
New glib keeps some extra line feed on the merged conf file data.
It shouldn't really matter so ignore such differences on the test.
2024-02-19 15:56:39 +02:00
Matti Lehtimäki
a50522b062 Merge pull request #42 from sailfishos/jb61571
Backport two patches from upstream to fix CVE-2023-4233 and CVE-2023-4234
2024-02-19 14:13:18 +02:00
Denis Grigorev
bb7d65f41a smsutil: Validate the length of the address field
This addresses CVE-2023-4233.
2024-02-16 17:50:58 +02:00
Denis Grigorev
278f28d15c smsutil: Check that submit report fits in memory
This addresses CVE-2023-4234.
2024-02-16 17:50:43 +02:00
Matti Lehtimäki
3afa0876c6 Merge pull request #40 from sailfishos/jb58763
[ofono] Add support for NR networks. JB#58763
2023-04-14 22:36:31 +03:00
Matti Lehtimäki
04162f719e [ofono] Add support for NR networks. JB#58763 2023-01-02 11:26:51 +02:00
Slava Monich
4ae4d688ce Merge pull request #41 from monich/uaf
Fix use after free
2023-01-02 11:13:43 +02:00
Slava Monich
224b551feb [voicecall] Fix use after free. JB#54354
Thanks to Denis Grigorev for pointing it out.
2023-01-02 00:38:40 +02:00
Slava Monich
6acf808d89 Merge pull request #38 from monich/conf-mask
Allow merging mask conf values
2022-11-07 16:37:19 +02:00
Slava Monich
942b2efc3b [ofono] Allow merging mask conf values. JB#59210
To allow syntax like disableFeatures += voice
2022-11-07 16:17:36 +02:00
Slava Monich
301b880a87 Merge pull request #37 from monich/cbs-topics-max
Widen the range of allowed cell broadcast channels
2022-10-27 02:12:01 +03:00
Slava Monich
933525829f [cbs] Widen the range of allowed cell broadcast channels. JB#5761 2022-10-25 13:39:33 +03:00
Slava Monich
d8df18c80c Updated upstream hash to point to 1.29 2022-10-25 13:25:52 +03:00
Slava Monich
47fd559c1b Merge pull request #36 from monich/jb58727
Remove event source after closing BT socket
2022-09-08 01:18:26 +03:00
Slava Monich
8fa9a7068f [hfp_ag_bluez5] Remove event source after closing BT socket. JB#58727
Otherwise GIOChannel stays alive and glib main loop keeps polling
invalid fd and eating up CPU time.
2022-09-07 17:21:24 +03:00
Slava Monich
10c1d7ac75 [ims] Tweak the treatment of the default Registration value
To handle the case if it's not IMS_REG_AUTO
2022-05-09 17:57:41 +03:00
Slava Monich
81ad45dfd9 Merge pull request #33 from monich/ims
org.ofono.IpMultimediaSystem D-Bus API tweaks
2022-04-21 04:33:24 +03:00
Slava Monich
0e27cf811b [ims] Extend org.ofono.IpMultimediaSystem D-Bus API. JB#57999
The following property has been added to the API:

	string Registration [readwrite, Sailfish OS specific]

		The IMS registration strategy. Valid values are:

			"disabled" keep registration off
			"enabled"  manual registration
			"auto"     keep registration on

		The Register() method, if implemented, will fail
		with [service].Error.NotAllowed if the value of
		this property is "disabled".
2022-04-21 03:40:28 +03:00
Slava Monich
5ec5081b7d [watch] Added reg_tech watch. JB#57999 2022-04-20 20:23:02 +03:00
Slava Monich
d2cae30a03 [ims] D-Bus access control for org.ofono.IpMultimediaSystem. JB#57408 2022-04-14 01:28:01 +03:00
Slava Monich
e0ea7b54c6 [gprs] Fixed ofono_gprs_context memory leak. JB#54354 2022-03-14 05:06:41 +02:00
Slava Monich
01c5e7fc1a Version 1.29 2022-03-14 04:48:41 +02:00
Slava Monich
291530d291 [sim] OFONO_SIM_DRIVER_API_VERSION 2. JB#54354 2022-03-14 04:47:31 +02:00
Slava Monich
108611ef72 Merge pull request #24 from sailfish-on-dontbeevil/branch-1.29
[ofono] Upgrade ofono baseline to 1.29. JB#54354
2022-03-14 04:44:50 +02:00
Marcel Holtmann
a3c9fc793c Release 1.29 2022-03-11 15:35:22 +00:00
Richard Röjfors
03491c78e7 ublox: gprs-context: Fix router mode IP settings.
The ublox modems always run DHCP when in router mode.
Unfortunately the code overwrote the IP settings with
static IP settings while activating.

Now we respect the networking_mode regardless if
we read settings during activation or read settings
phase.
2022-03-11 15:35:22 +00:00
Antara Borwankar
c534b7e9b0 xmm7modem: Changes in plugin for DSSA functionality
Changed the sim driver vendor for xmm7modem from
OFONO_VENDOR_IFX to OFONO_VENDOR_XMM to handle DSSA functionality.
2022-03-11 15:35:22 +00:00
Antara Borwankar
35e7cd19e6 xmm7modem: handling of dual sim single active feature
Handled DSSA use case for xmm7modem. Added driver function
to switch between available card slots for SIM.

Only one SIM will be active at a given time. On calling this
function the active SIM will be removed and the card slot made
inactive and SIM in the other card slot will be made active.

Use case is similar to a SIM swap/change where one SIM is replaced
another SIM in the same slot.
2022-03-11 15:35:22 +00:00
Antara Borwankar
2ed8b1bb7f sim: added error handling in set slot callback
Adding the handling of error when the driver returns
CME ERROR:4.

This error will be returned for non xmm vendor modems
using ifxmodem driver for sim.
2022-03-11 15:35:22 +00:00
Richard Röjfors
8f65b01f4c ublox: Correct the USBCONF reply prefix
According to the u-blox AT Commands Manual and my tests
the response prefix of AT+UUSBCONF is "+UUSBCONF:", including
a colon. The colon was missing in the code, causing next step
to parse a number to fail, since a colon is not a number.
2022-03-11 15:35:22 +00:00
Richard Röjfors
1aa2ac5e67 ublox: Do not leave vendor_family unset
In a recent patch vendor family was only set if the device
did not support USBCONF, but that resulted in drivers
being registered the "generic" vendor. That caused
for instance netreg to use incorrect cmer mode and fail
on TOBY-L210.
2022-03-11 15:35:22 +00:00
Denis Kenzior
cb8a13433f sim: Initialize card_slot_count and active_card_slot
Initialize both to 1 so that SimManager does not erroneously show
ActiveCardSlot as 0 for drivers that do not (yet) setup these values.
2022-03-11 15:35:22 +00:00
Denis Kenzior
ee1c34cd7f sim: Emit PropertyChanged for ActiveCardSlot changes 2022-03-11 15:35:22 +00:00
Antara Borwankar
2b89f6d488 sim: handling of dual sim single active feature
Added implementation for handling CardSlotCount and ActiveCardSlot
properties for DSSA use case.
2022-03-11 15:35:22 +00:00
Antara Borwankar
32b886d89d sim: Added set function for CardSlotCount and ActiveCardSlot
Adding set function definition for CardSlotCount and ActiveCardSlot
properties.
2022-03-11 15:35:22 +00:00
Antara Borwankar
a9a3e024e1 doc: Added new properties to SimManager for DSSA
Adding two new properties to sim manager interface to handle
dual SIM single active use case.

CardSlotCount [readonly]
Contains the count of number of SIM card slots available.

ActiveCardSlot [readwrite]
Contains the index of the currently active SIM card slot
for dual SIM single active mode.
2022-03-11 15:35:22 +00:00
Jonas Bonn
8c432e5426 ublox: do not set bridge mode for TOBY L2
Trying to set the networking mode to "bridge" mode in the plugin is bogus
because the setting does not apply until after the device has been
reset.  Instead, the current setting should be queried.

If a user wants to set the modem networking mode, the setting should be
made outside of ofono.

The gprs-context driver has already been adjusted to query the
networking mode and to set things up accordingly.
2022-03-11 15:35:22 +00:00
Jonas Bonn
fc26876503 ublox: gprs-context: query networking mode for TOBY L2
The TOBY L2 may run in either "bridge" mode or "router" mode.  For this
model, query the configured mode so that the appropriate settings are
communicated when the context is activated.
2022-03-11 15:35:22 +00:00
Jonas Bonn
7461d52b10 ublox: TOBY L4 supports only router mode
The TOBY L4 supports only "router mode" where the modem presents a
network interface that one can run a DHCP client against.  Behind this
interface, the modem takes care of routing packets via NAT by:

i)  selecting the relevant context based on destination IP
ii) using the first activated context as the default route

In order to have the connection manager, thus, do the right thing, the
context only needs to report itself as being active and with the IP
settings set to method "dhcp".  There's no need for the connection manager
to know details like what IP address the context was assigned.

Tested with connman that does the right thing when it finds an active
"dhcp" context.
2022-03-11 15:35:22 +00:00
Jonas Bonn
9e2fd992b5 ublox: pass model_id to gprs-context driver
Depending on the transport used on the data connection we want either
the "atmodem" (PPP) driver or the "ubloxmodem".  For the "ubloxmodem",
we want to pass the model data so this patch wrangles some parameters to
make sure that right driver and right variant data are passed.
2022-03-11 15:35:22 +00:00
Jonas Bonn
1295539515 ublox: gprs-context: take model parameter 2022-03-11 15:35:22 +00:00
Jonas Bonn
65aa5aab14 ublox: pass model id to LTE plugin 2022-03-11 15:35:22 +00:00
Jonas Bonn
8da2178a96 ublox: extend LTE driver
There are a couple of semi-independent changes here:

* use the 'vendor' parameter to pass the modem 'model'
* support TOBY L4 modem which uses a fixed CID for configuring the EPS
default bearer
* add the setup of authentication parameters that was recently added to
the atmodem LTE driver
2022-03-11 15:35:22 +00:00
Jonas Bonn
181c74b1a9 Separate ATE and AT+CMEE commands
The TOBY L4 doesn't seem to like seeing these two commands on the same
line...
2022-03-11 15:35:22 +00:00
Jonas Bonn
a30ef13844 udevng: detect ublox TOBY L4
ttyACM0 (USB interface 02) is reportedly unreliable (breaking DHCP setup)
so the recommended approach is to use ttyACM2 (USB interface 06)
exclusively.
2022-03-11 15:35:22 +00:00
Jonas Bonn
ec85e50ab4 ublox: add TOBY L4 models 2022-03-11 15:35:22 +00:00
Jonas Bonn
1cedb9d750 ublox: add device flags
Some aspects of a device are detectable at runtime, like the USB profile
detection that was added in a patch preceding this one.  This patch
switches the driver over from creating a new "vendor id" for each
profile to just setting a flag.  This is more easily extensible as we
detect other features of the modem.
2022-03-11 15:35:22 +00:00
Jonas Bonn
a412839f45 udevng: ublox: Model string no longer used 2022-03-11 15:35:22 +00:00
Jonas Bonn
86af7cd7c9 ublox: query USBCONF for applicable devices
The TOBY L2 series of modems presents a number of different
configurations with different throughtput characteristics.  These
configurations are packaged up as USB profiles; moreover, changing the
profile actually changes the USB model ID so this is even more like
selecting a different "device" altogether.  Nonetheless, all we need to
know is which profile is selected in order to set things up correctly
and this can be queried directly.

This patch adds a call to UUSBCONF for applicable modems in order to
query the USB configuration to find out which profile is active.
2022-03-11 15:35:22 +00:00
Jonas Bonn
050332577c ublox: add model flag HAVE_USBCONF
This flag should be set on devices that support multiple USB profiles
and will be used to determine whether or not querying USB profiles is
appropriate/necessary.
2022-03-11 15:35:22 +00:00
Jonas Bonn
339814e429 ublox: query device model
This patch adds a call to CGMM into the modem_enable path in order to
establish the specific device model.  From this device model string, a
model-specific capabilities structure can be selected.
2022-03-11 15:35:22 +00:00
Jonas Bonn
278d7236c9 ublox: create model data structures
This sets up some device model data structures and adds some helpers for
manipulating them.  These data structures are a first step to trying to
support the large number of devices that ublox produces with a common
driver structure.
2022-03-11 15:35:22 +00:00
Jonas Bonn
15a9ea2977 ublox: make device selection more flexible
Many ublox modems can sit on either the USB bus or talk directly to a
UART.  The udev plugin mostly takes care of figuring out what ports to
talk to and the protocol is common for all devices after that.

This patch simplifies the setup a bit:
i)  There must always be an aux channel for communication with the modem
ii)  The aux channel may be found behind the string Aux for USB modems
or Device for serial modems
iii)  If the Modem string is set, use it; if not set, assume it's not
available.
2022-03-11 15:35:22 +00:00
Jonas Bonn
9910ab1693 atmodem: Remove TOBY_L2 vendor 2022-03-11 15:35:22 +00:00
Jonas Bonn
d5a3613fd4 ublox: drop vendor type for Toby L2 model 2022-03-11 15:35:22 +00:00
Jonas Bonn
d337893b39 atmodem: drop vendor type for Toby L2 model
The 'Toby L2'-specific vendor type is used only to prevent the CMER
command from attempting to set mode '3'.  For all u-blox models, mode
'3' is just an alias for mode '1'.  As such, mode '1' can be used in
place of mode '3', removing the model-specific quirk in favour of a
vendor-specific quirk.

With this change, the L2-specific vendor type is no longer needed.
2022-03-11 15:35:22 +00:00
Jonas Bonn
9ef41fdc2f Fix whitespace weirdness 2022-03-11 15:35:22 +00:00
Anirudh Gargi
c779a8b19d sim: fix segfault in sim atom
While adding the sim pin cache feature, pin_name could cause issue in
cases when sim pin is not there.

log:
ofonod[27810]: drivers/atmodem/sim.c:at_cpin_cb() crsm_pin_cb: READY
ofonod[27810]: src/sim.c:sim_pin_query_cb() sim->pin_type: 0, pin_type: 0
ofonod[27810]: Aborting (signal 11) [./src/ofonod]
ofonod[27810]: ++++++++ backtrace ++++++++
ofonod[27810]: #0  0x7fb7a7586cb0 in /lib/x86_64-linux-gnu/libc.so.6
ofonod[27810]: #1  0x7fb7a7693cd8 in /lib/x86_64-linux-gnu/libc.so.6
ofonod[27810]: #2  0x4d899b in sim_pin_query_cb() at src/sim.c:3174
ofonod[27810]: #3  0x4649e7 in at_cpin_cb() at drivers/atmodem/sim.c:1304
ofonod[27810]: #4  0x4a5d70 in at_chat_finish_command() at gatchat/gatchat.c:462
2022-03-11 15:35:22 +00:00
Denis Kenzior
81c7f886cb ifxmodem: Clean up the previous commit slightly
The if statements were over 80 characters and breaking them up made the
code look a bit uglier.  So refactor the if statements to just figure
out the data path 'n' parameter or return an error.  On success, form
the datapath string and return it.

Also bump the buffer size and use snprintf to be safe(r).
2022-03-11 15:35:22 +00:00
Antara Borwankar
4adac31b51 xmm7modem: data channel setup for xmm7modem
Added the implementation required to setup data channel
in ifxmodem gprs-context driver for xmm7modem vendor
2022-03-11 15:35:22 +00:00
Antara Borwankar
31bebd7ecf gprs-context: Adding get function for inteface
Added definition of get function to get interface value in
gprs-context
2022-03-11 15:35:22 +00:00
Antara Borwankar
f1965b1e2b gprs-context: adding get function for network interface
Added declaration of get function to get network interface
for gprs-context
2022-03-11 15:35:22 +00:00
Philippe De Swert
fed8c5b171 common: Add new NB-IoT technologies
Add lte-cat-m1 and lte-cat-nb1 technology identifiers.
2022-03-11 15:35:22 +00:00
Christophe Ronco
5e1f159ad1 qmi: support sim hotplug
Use card status indication to detect SIM removal and insertions
2022-03-11 15:35:22 +00:00
Antara Borwankar
972aea87e8 xmm7modem: Change in xmm7mode plugin for multiple PDP
Made changes in xmm7modem plugin to allow mutiple PDP context
activation and to assign correct network interface to the
activated PDP context.
2022-03-11 15:35:22 +00:00
Antara Borwankar
f4df805783 udevng: Detect multiple network interfaces for xmm7xxx 2022-03-11 15:35:22 +00:00
Denis Kenzior
1066668a4b gprs: Let gprs_context interface be settable once
This patch allows a driver to set the interface only once, instead of at
every context activation.  The previous way was originally designed for
PPP and RAW_IP based contexts which would have a (potentially)
differently named interface after each context activation due to use of
TUN/TAP.  This also worked for static high-speed interface setups as
well, since these usually had a single interface only.

For devices that support multiple high-speed interfaces it would be
advantageous to have each gprs_context get an interface assignment right
in the modem driver and skip having to setup the interface on every
activation.
2022-03-11 15:35:22 +00:00
Pičugins Arsenijs
c5029eafcf sim800: fix typo in model check code
Fixing a copy-paste error in SIM800 code
that results in a SIM900 modem being
detected as a SIM800 modem.
2022-03-11 15:35:22 +00:00
Nicolas Serafini
6ce1e081a4 qmimodem: Notify when SIM is initialized
Since the commit that introduced the notification API of a SIM inserted
and initialized I can not unlock the SIM card on a WP7607 modem.

The previously mentioned commit: 54d56d763e40bc44c99a9b24aa0477bd373ea085
2022-03-11 15:35:22 +00:00
Pavel Machek
91435c39ed test: better help text for dial-number
Better help text for "dial-number". Without details, user may be
tempted to pass 0|1 (as send-sms uses) or true|false.
2022-03-11 15:35:22 +00:00
Nandini Rebello
531afae6b2 modem: add support to clear cached pins.
If the modem is powered off via D-Bus, clear any cached PINs to make
sure that automatic PIN entry behavior is not activated.
2022-03-11 15:35:22 +00:00
Denis Kenzior
1c8a577a4b sim: Fix memory leaks introduced by sim pin caching 2022-03-11 15:35:22 +00:00
Nandini Rebello
bd175869f4 sim: Sim PIN1 cache upon modem reset/crash
Adding SIM PIN caching feature to oFono. oFono now caches the SIM PIN1
type against the ICCID throughout its lifetime in a link list and
enters implicitly upon modem reset/crash.

Note, that this behavior can violate 3GPP spec 21.111, section 5.3 -
User Data stored in ME if that section is interpreted very strictly.
However, our interpretation is that firmware resets are allowed, based
on historic precedent.  Helps in user experience by not barring out
cellular services unless pin is entered manually.

Handles cases of incorrect pin and sim pin changed externally.
Clear cached PIN incase modem disabled manually and selectively when
sim is removed.

Seperate 'pin_cache_enter_cb' added without dbus calls to handle
implict entering of cached pin.

For now this behavior is applicable to all modems by default.  In the
future it may be needed to make this behavior opt in or otherwise
configurable.
2022-03-11 15:35:22 +00:00
Marcel Holtmann
bcb08afc50 gitignore: unit/test-idmap binary 2022-03-11 15:35:22 +00:00
Slava Monich
eb8bfb57e9 [dbus-access] Added access control entry for SendDataMessage. JB#56657 2022-03-11 17:09:33 +02:00
Slava Monich
871eab499c Housekeeping 2022-03-11 17:09:17 +02:00
Slava Monich
dae12e74a4 Merge pull request #17 from LaakkonenJussi/jb56657
Add support for sending SMS data messages
2022-03-11 17:05:08 +02:00
Jussi Laakkonen
9f486aa91a [sms] Support setting endianess for SMS data messages. JB#56657
This implements support for selecting endianess for the SMS data message
multi-byte parameters. By default big endian is used but little endian
is required in some special protocols. Thus, omitting flag value results
in the "GSM" setting which is the big endian used by default.

This required adding a new sms_datagram_prepare_with_endianess() plugin
API call that is called by the original sms_datagram_prepare() with GSM
encoding.

This affects only the new SendDataMessage D-Bus API. A value 0x02 for
little endian is added to enum ofono_sms_data_flag().
2022-03-09 11:18:08 +02:00
Jussi Laakkonen
b015849e98 [sms] Add support for sending SMS data messages. Fixes JB#56657
This adds a new D-Bus API call "SendDataMessage" to be used for sending
a SMS data message. This is required especially by AML but can be
utilized for other uses as well.

The given message data is defined as a byte array so pre-encoded data
is only supported. Additionally source and destination ports as well as
flags are to be defined for the SMS data message. Flag
OFONO_SMS_DATA_FLAG_DELIVERY_REPORT (0x01) determine the need for
delivery reports. Other flags may be added later on.

This also implements the filter functionality for the SMS data messages.
This can be utilized by the plugins to react to the sent SMS data
messages appropriately.
2022-03-09 11:18:03 +02:00
Slava Monich
6c77fa2ddd Merge pull request #31 from monich/sim_api_ext
Add mechanism for extending ofono_sim_driver API
2022-02-23 20:10:26 +02:00
Slava Monich
09bd3cc5ac [ofono] Add mechanism for extending ofono_sim_driver API
This way struct ofono_sim_driver can be extended without having to
recompile all plugins in the world.
2022-02-23 20:09:47 +02:00
Slava Monich
1758eb3b2a Merge pull request #27 from monich/imei
Add API for querying IMEI from the modem
2022-02-23 19:59:39 +02:00
Slava Monich
faae02c2f4 Merge pull request #32 from LaakkonenJussi/allow_emerg_call_filter
Allow filtering for emergency calls
2022-02-23 19:56:22 +02:00
Jussi Laakkonen
d2abaa7776 [voicecall] Allow filtering for emergency calls. JB#56657
This removes the exceptions made for emergency calls to disallow
filtering of them via plugins. Thus, this allows the plugins to detect
if an emergency call is made and make an action based on it.
2022-02-23 14:36:37 +02:00
Slava Monich
78e83f877c [ofono] Added API for querying IMEI from the modem. JB#56657
ofono_devinfo_get_serial(ofono_modem_get_devinfo(modem))
2022-02-16 17:05:03 +02:00
Slava Monich
2b00591782 Merge pull request #23 from monich/ims
Expose ext_info bits to the plugins
2022-02-12 21:04:56 +02:00
Slava Monich
18b38db35f [ims] Expose ext_info bits to the plugins. JB#57408 2022-02-12 20:59:23 +02:00
Slava Monich
056cc73bae Merge pull request #22 from monich/ussd_decode
Add ofono_ussd_decode and ofono_ussd_decode_free API
2022-01-25 23:59:39 +02:00
Slava Monich
ad0d616696 [ofono] Add ofono_ussd_decode and ofono_ussd_decode_free API. JB#55524
Those are required by external plugins to properly support USSD sending.
ofono_ussd_decode_free() is basically a g_free() and its only purpose
is to keep ofono API glib-free. External plugins shouldn't make any
assumptions about how return values are allocated by the core.
2022-01-25 19:42:03 +02:00
Slava Monich
15d0364dc0 Version 1.28 2022-01-17 03:45:59 +02:00
Slava Monich
0faff9bf8d Updated upstream hash to point to 1.28 2022-01-17 03:43:29 +02:00
Slava Monich
9a2ef6c17d Merge pull request #20 from sailfish-on-dontbeevil/branch-1.28
[ofono] Updated baseline to 1.28. JB#42254
2022-01-17 03:40:14 +02:00
Slava Monich
aab3e8cca9 [voicecall] Added ofono_voicecall_is_emergency_number() API. JB#56657 2022-01-11 14:53:15 +02:00
Slava Monich
0538daab9d [ofono] Housekeeping
Fixed a typo
2022-01-11 05:46:59 +02:00
Slava Monich
24fd7e863c [unit] Added one more slot-manager test case 2022-01-10 21:10:26 +02:00
Slava Monich
3bdcd55ad8 Merge pull request #21 from monich/imsi-change
Fix re-evaluation of data slot after SIM change
2022-01-10 19:54:55 +02:00
Slava Monich
fb76fa7be1 [ofono] Fixed re-evaluation of data slot after SIM change. JB#56789
The way it was done, slot driver wasn't always notified about the
role change after IMSI update (e.g. when SIM gets hot-swapped or
enabled/disabled) which could result in mobile data remaining
disabled.
2022-01-10 19:16:41 +02:00
Marcel Holtmann
36c281e843 Release 1.28 2022-01-09 22:28:57 +00:00
Denis Kenzior
a4d5053c65 AUTHORS: Mention Pavel's contributions 2022-01-09 22:28:57 +00:00
Pavel Machek
2168d53bd6 rilmodem: fix compilation on gcc-6.3
gcc-6 fails to compile ofono due to #pragma directives. Limit them to
gcc versions where they are needed.
2022-01-09 22:28:57 +00:00
Denis Kenzior
258a623939 stkutil: Fix ofono_bool_t usage
The actual datatype is bool
2022-01-09 22:28:57 +00:00
Marcel Holtmann
d0208b2085 build: Use -fsigned-char and -fno-exceptions compiler options 2022-01-09 22:28:57 +00:00
Antara Borwankar
955ce593d2 ifxmodem: removing TAP/TUN support check for XMM vendor
skipping TAP/TUN support check from gprs-context probe for
xmm vendor. xmm modem does not require TAP/TUN support. Also
it is not enabled by default in enbedded yocto bsp.
2022-01-09 22:28:57 +00:00
Denis Kenzior
535b0e2e6e AUTHORS: Mention Khaled's contributions 2022-01-09 22:28:57 +00:00
Khaled Romdhani
2809230885 gemalto: Move atoms to post_online
when the voice call driver is probing, I noticed sometimes
a CME Error with the code = 4 (operation not supported)
related to AT commands "AT+CSSN=1,1" and "AT^SLCC=1".

In the current voice call implementation for Gemalto modems
the ofono_voicecall_create() is called on the gemalto_pre_sim().
The sim is not totaly readed by the module, it is not yet
online which is causing a sporadic problem at driver
intialization also when launching some outgoing/incoming calls.

This change moves the ofono_voicecall_create() to the
gemalto_post_online() to be sure that sim is well registred
and online.  Several other call related atoms are also moved to
post_online state.
2022-01-09 22:28:57 +00:00
Denis Kenzior
ad1037fbd2 stkutil: Use standard types 2022-01-09 22:28:57 +00:00
Denis Kenzior
75a10ccb5a rilmodem: Fix compiler error 2022-01-09 22:28:57 +00:00
Denis Kenzior
4745d6ed8a stkutil: Convert away from glib datatypes 2022-01-09 22:28:57 +00:00
Denis Kenzior
1a56f30091 stkagent: Use bool instead of gboolean / ofono_bool_t 2022-01-09 22:28:57 +00:00
Denis Kenzior
04021d8cf4 stktest: Fix immediate response test
Commit f39d7efb53 changed the amount of
time an immediate response text is displayed.  Fix stktest accordingly.
2022-01-09 22:28:57 +00:00
Denis Kenzior
16402d5056 stktest: Handle self-explanatory icons
At some point, self-explanatory icons meant that no text was sent to the
agent, yet stktest was never updated to reflect that behavior.  Update
this properly.
2022-01-09 22:28:57 +00:00
Denis Kenzior
8b90d7f8f1 unit: Fix memory leak 2022-01-09 22:28:57 +00:00
Denis Kenzior
db093dae3f drivers: Update to the new util api 2022-01-09 22:28:57 +00:00
Denis Kenzior
1cf235bc0d unit: update to the new util api 2022-01-09 22:28:57 +00:00
Denis Kenzior
dd2ec559af util: Use bool instead of gboolean 2022-01-09 22:28:57 +00:00
Slava Monich
25c11d6697 Updated upstream hash to point to 1.27 2022-01-10 00:12:23 +02:00
Slava Monich
0f789ddf25 Merge pull request #19 from sailfish-on-dontbeevil/branch-1.27
[ofono] Update baseline to 1.27. JB#42254
2022-01-10 00:07:34 +02:00
Slava Monich
cfae9cd095 include: Housekeeping 2022-01-10 00:01:23 +02:00
Marcel Holtmann
dca2747d5f Release 1.27 2022-01-08 08:39:08 +00:00
Antara Borwankar
b6df026722 xmm7modem: modified ofono.conf for coex agent
Added coex agent interface to ofono.conf
2022-01-08 08:39:08 +00:00
Denis Kenzior
aa1e36040d xmm7xxx: Various style cleanups 2022-01-08 08:39:08 +00:00
Antara Borwankar
227af51e10 xmm7modem: implemnetation of coexistence functionality
Added coex implementation in xmm7modem plugin
2022-01-08 08:39:08 +00:00
Pau Espin Pedrol
cbab683ac2 qmi: Fix Secondary DNS overwriting Primary DNS
inet_ntoa was called twice in a row and as a result both primay and
secondary DNS were pointing to same static buffer containing last
value (secondary DNS).

As a result, ofono always advertised the secondary DNS twice through
DBus ConnectionContext.GetProperties 'DomainNameServers'.

Related: https://osmocom.org/issues/3031
2022-01-08 08:39:08 +00:00
Antara Borwankar
8a42f7cf48 doc: Adding documetation for intel LTE coex
Added intel-lte-coex-api.txt which defines LTE coexistence
interface for intel modems.
2022-01-08 08:39:08 +00:00
Nandini Rebello
45b8b675ac test: Fix number of arguments check in change-pin
Fix the number of arguments checked in second case of change-pin.
2022-01-08 08:39:08 +00:00
Nandini Rebello
b977415db8 xmm7xxx: Adding case for SIM PIN locked state
Handling the case when SIM PIN is enabled for xmm7xxx modem.
2022-01-08 08:39:08 +00:00
Clement Viel
011377b505 sim800: add sim800 support 2022-01-08 08:39:08 +00:00
Clement Viel
7653e2b293 sim800: merge sim800 and sim900 documentation. 2022-01-08 08:39:08 +00:00
Slava Monich
0012a3e4f0 Updated upstream hash to point to 1.26 2022-01-08 04:50:14 +02:00
Slava Monich
40ec15a394 [ofono] Handle OFONO_GPRS_AUTH_METHOD_ANY. JB#42254 2022-01-08 04:29:08 +02:00
Slava Monich
cb2fd2de41 [include] Updated enum ofono_gprs_auth_method. JB#42254
For backward compatibility.
2022-01-08 04:28:55 +02:00
Slava Monich
3221ab9512 Merge pull request #18 from sailfish-on-dontbeevil/branch-1.26
Update to Ofono 1.26
2022-01-08 04:27:59 +02:00
Marcel Holtmann
06b58a3650 Release 1.26 2022-01-05 12:55:41 +00:00
Marcel Holtmann
e834b8c1a8 mbimmodem: Convert back to using __builtin_bswap16 with proper indexing 2022-01-05 12:55:41 +00:00
Marcel Holtmann
c6eaa7f108 mbimmodem: Fix conversion of strings into UTF16-LE on big endian 2022-01-05 12:55:41 +00:00
Marcel Holtmann
ccf340a896 mbimmodem: Fix endian issue with UTF16-LE to UTF16-CPU conversion 2022-01-05 12:55:41 +00:00
Denis Kenzior
c8577e681b mbimmodem: Fix compilation on 32-bit
CC       drivers/mbimmodem/mbim.o
drivers/mbimmodem/mbim.c: In function ‘command_write_handler’:
drivers/mbimmodem/mbim.c:490:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
   l_info("n_iov: %lu, %lu", n_iov + 1, (size_t) written);
   ^
drivers/mbimmodem/mbim.c:490:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat=]
drivers/mbimmodem/mbim.c: In function ‘command_read_handler’:
drivers/mbimmodem/mbim.c:649:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
  l_info("header_offset: %lu", device->header_offset);
  ^
drivers/mbimmodem/mbim.c:650:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
  l_info("segment_bytes_remaining: %lu", device->segment_bytes_remaining);
  ^
2022-01-05 12:55:41 +00:00
Nandini Rebello
64f833d351 udevng: enhance udev detection for intel 7xxx modems
Handle newer 7xxx modem enumeration based on ProductId.
Preserving the previous gen support too.
2022-01-05 12:55:41 +00:00
Marcel Holtmann
0bd5121144 mbim: Add the missing mbim-private.h header into packages 2022-01-05 12:55:22 +00:00
Denis Kenzior
f7cd4d229f gemalto: Use GEMALTO vendor for netreg 2022-01-05 12:45:12 +00:00
Giacinto Cifelli
b55593d9ef atmodem: remove vendor Cinterion 2022-01-05 12:44:29 +00:00
Giacinto Cifelli
ab9fdb8af1 cinterion: use Gemalto vendor in netreg 2022-01-05 12:44:15 +00:00
Giacinto Cifelli
1daf3f62c2 atmodem: Change cinterion prefix to gemalto 2022-01-05 12:43:59 +00:00
Giacinto Cifelli
20359b88d2 atmodem: change vendor cinterion to gemalto 2022-01-05 12:42:49 +00:00
Giacinto Cifelli
4e1f39638d gemalto: Use Gemalto vendor for LTE atom 2022-01-05 12:41:51 +00:00
Jonas Bonn
22c5c3ae98 modem: global data is pre-zeroed
Module-local and global data are BSS symbols and don't require
zero-initialization.
2022-01-05 12:41:30 +00:00
Jonas Bonn
f3f3d6819d stkutil: remove test for impossible condition
'string' is an array and therefore never NULL so this test always fails.
2022-01-05 12:41:16 +00:00
Jonas Bonn
8934c398bb qmimodem: prevent use of unitialized variable
'index' may not be initialized in the error path so don't try to print a
message with it.
2022-01-05 12:40:39 +00:00
Jonas Bonn
14759305fd mbim: remove unused modem data
Neither the Vendor nor Model strings are used by the mbim plugin.
2022-01-05 12:40:17 +00:00
Giacinto Cifelli
df160a28f7 doc/common-patterns.txt: initial version 2022-01-05 12:35:39 +00:00
Denis Kenzior
90cc6a3862 atmodem: Make sure to use none_prefix
Otherwise all unsolicited notifications would also be consumed when
invoking +CGAUTH/+CGDCONT
2022-01-05 12:35:16 +00:00
Giacinto Cifelli
9176411489 atmodem: Add proto and authentication handling to lte
The ofono_lte_default_attach_info now handles also the protocol and the
authentication method, username and password.

Co-authored-by: Martin Baschin <martin.baschin@googlemail.com>
2022-01-05 12:35:03 +00:00
Giacinto Cifelli
c470ab5043 atmodem: Add reference counting to cb_data
the cb_data can be used by creating the structure with cb_data_new,
and then there are two possibilities:
- use it in a single callback function, and destroy it with a call to
  g_free.
  Example:
  - calling function:
    struct cb_data *cbd = cb_data_new(cb, data);
    if (g_at_chat_send(chat, buf, NULL, at_cgatt_cb, cbd, g_free) > 0)
	return;
    g_free(cbd);
  - called function (here at_cgatt_cb):
	static void at_cgatt_cb(gboolean ok, GAtResult *result,
						gpointer user_data)
	{
		struct cb_data *cbd = user_data;
		ofono_gprs_cb_t cb = cbd->cb;
		struct ofono_error error;

		decode_at_error(&error,
				g_at_result_final_response(result));

		cb(&error, cbd->data);
	}
    note the absence of explicit g_free(cbd);

- pass it through a train of callback functions, adding a reference at
  each pass cb_data_ref, and removing it with cb_data_unref.
  the use of cb_data_ref would replace a new object creation, while the
  use of cb_data_unref the use of g_free.
  Example:
  - calling function:
	struct cb_data *cbd = cb_data_new(cb, data);
	// no cb_ref at the creation
	if (g_at_chat_send(chat, buf, NULL,
				at_lte_set_default_attach_info_cb,
				cbd, cb_data_unref) > 0)
		goto end;
	cb_data_unref(cbd);
  - called function 1 (at_lte_set_default_attach_info_cb):
	static void at_lte_set_default_attach_info_cb(gboolean ok,
				GAtResult *result, gpointer user_data)
	{
		struct cb_data *cbd = user_data;

		cbd = cb_data_ref(cbd);
		if (g_at_chat_send(chat, buf, NULL,
				at_cgatt_cb, cbd, cb_data_unref) > 0)
			return;
		cb_data_unref(cbd);
	}
  - called function 2 (at_cgatt_cb):
    like above. no call to g_free or cb_data_unref. The terminal function
    doesn't need to know about the reference scheme.
2022-01-05 12:34:51 +00:00
Giacinto Cifelli
9c092bbe72 modem: Implement ofono_modem_set_timeout_hint
this patch provides the handling for the modem-depending powered timeout

It provides the trivial implementation for
ofono_modem_set_powered_timeout_hint, introducing the ofono_modem
variable timeout_hint, used together with the existing ofono_modem
variable timeout.

The default value, previously hardcoded as a magic number, is provided
by the DEFAULT_POWERED_TIMEOUT define and set as soon as the
ofono_modem struct is created, and then can be overwritten by the
aforementioned ofono_modem_set_powered_timeout_hint.
2022-01-05 12:34:35 +00:00
Giacinto Cifelli
2c41120b78 include: add ofono_modem_set_powered_timeout_hint
function to set the powered timeout for those cases where a device might
require longer time to boot (uncommon).

The function is effective if called before Powered=true,
so it is best called by modem detection logic and prior to calling
ofono_modem_register.
2022-01-05 12:34:07 +00:00
Giacinto Cifelli
88342a037c atmodem: added Gemalto vendor quirk for +CNMI 2022-01-05 12:32:25 +00:00
Giacinto Cifelli
75ff3e7bbf atmodem: Add at_util_get_cgdcont_command
The function at_util_get_cgdcont_command computes the AT+CGDCONT
string, as per 3GPP 27.007.
It uses a second function, at_util_gprs_proto_to_pdp_type,
that returns the pdp_type string for the command
2022-01-05 12:32:09 +00:00
Giacinto Cifelli
6abd0106b9 atmodem: Add at_util_gprs_auth_method_to_auth_proto
This function converts the ofono enum ofono_gprs_auth_method
into the value of the 3GPP 27.007 'auth_proto' variable of +CGAUTH so
that it can be passed directly to the AT command.
2022-01-05 12:31:51 +00:00
Denis Kenzior
85f9307c71 lte: Add additional sanity checks for username/password 2022-01-05 12:31:35 +00:00
Giacinto Cifelli
c5f48019ff lte: protocol and authentication for default ctx
Many LTE networks require user authentication, even for the default
context. In particular, most of the private APNs use this facility
to add some control on top of the MNO providing the service, so that
another user of the same network cannot access the private one.
As such, we add these parameters to the default context
settings that will attempt to use when registering to the network.

The additional parameters added by this patch are:  protocol, user, and
password.  These are sufficient to allow to connect to networks
available to the patch author where ofono previously failed to register
to the network at all.

Co-authored-by: Martin Baschin <martin.baschin@googlemail.com>
Co-authored-by: Denis Kenzior <denis.kenzior@intel.com>
2022-01-05 12:31:18 +00:00
Giacinto Cifelli
efa0627332 include: add proto and authentication parameters
The ofono_lte_default_attach_info is extended with protocol,
authentication method, username and password.

Co-authored-by: Martin Baschin <martin.baschin@googlemail.com>
2022-01-05 12:31:02 +00:00
Denis Kenzior
35e8201e96 doc: Mark new properties experimental
Just in case we need to redesign these in the near future
2022-01-05 12:30:32 +00:00
Giacinto Cifelli
b465782a10 doc: Add additional default attach parameters to LTE
Added 4 properties for handling the type of context and the
authentication method, exactly like in any gprs context handling.
The properties are named after the equivalent gprs-context one, for
compatibility and uniformity.

Co-authored-by: Martin Baschin <martin.baschin@googlemail.com>
2022-01-05 12:30:07 +00:00
Denis Kenzior
557f907b27 AUTHORS: Mention Giacinto's contributions 2022-01-05 12:29:54 +00:00
Giacinto Cifelli
9a354879d3 gemalto: added voice support
The plugin for Gemalto modems is enriched with all voice-related atoms,
as well as USSD.
All except the voicecall itself are from the atmodem, while the
voicecall is from gemaltomodem.
2022-01-05 12:29:38 +00:00
Giacinto Cifelli
e6799aacc9 gemalto: Add Gemalto specific voicecall atom
This atom uses the URC ^SLCC to monitor the call status, as well as
incoming calls.
Note the use in the atom of the variable GemaltoVtsQuotes: this is
needed to support future modules, as of today not yet available in the
plugin.
2022-01-05 12:26:56 +00:00
Jonas Bonn
f5d78b7e2f treewide: Remove superfluous use of _GNU_SOURCE
There are a large number of files in the tree that define _GNU_SOURCE
despite not actually using features hidden behind this flag.  This patch
removes all these definitions in one fell swoop...
2022-01-05 12:26:25 +00:00
Jonas Bonn
8fde6264c8 drivers: constify vtables
The driver vtables are read-only structures.  This patch declares them as
'const' allowing the compiler to (optionally) put them in the RELRO
section.  RELRO pages may be marked as read-only by the linker after
the relocations have been done ensuring that they aren't inadvertently
or maliciously altered at runtime.
2022-01-05 12:26:09 +00:00
Nandini Rebello
eb8371b02d test: add support for new languages
Adding new language support to set "alphabet" parameter.
2022-01-05 12:25:47 +00:00
Nandini Rebello
3b2bfa8943 sms: support 8 national lang in Alphabet property
Adding support for 8 additional languages for GSM 7 bit.
2022-01-05 12:15:23 +00:00
Nandini Rebello
d2e46f9a5f util: adding 8 national sms alphabets
Adding national language tables for hindi,kannada,malayalam,
oriya,punjabi,tamil,telugu and urdu.
2022-01-05 12:13:44 +00:00
Nandini Rebello
9b3ba1a2f0 doc: add support for 8 additional sms alphabets
Adding support for hindi,kannada,malayalam,oriya,punjabi,tamil,
telugu and urdu for GSM 7 bit.
2022-01-05 12:13:31 +00:00
Denis Kenzior
b36b0d86f6 xmm7modem: Fix memory leak in netmon 2022-01-05 12:13:17 +00:00
Denis Kenzior
655dd9ab5a phonesim: Fix memory leak 2022-01-05 12:13:00 +00:00
Nandini Rebello
74017fe30f sms: fix a missing entry in single shift table
Fix a missing char in the nation language set in single shift table
for a special character. Character set again validated.
2022-01-05 12:12:43 +00:00
Giacinto Cifelli
022b31b075 common: Move proto and auth_method related helpers
the following functions:
	gprs_proto_to_string
	gprs_proto_from_string
	gprs_auth_method_to_string
	gprs_auth_method_from_string

are moved from gprs.c to common.c, with related declaration in common.h
so that they can also be accessed from lte core functions
2022-01-05 12:09:50 +00:00
Giacinto Cifelli
6674cc3340 include: move auth_method and proto enumerations
ofono_gprs_proto and ofono_gprs_auth_method, and related length consts,
moved to types.h from gprs-context.h,
so that they can be shared also with lte core functions
2022-01-05 11:45:38 +00:00
Antara
a850fd8978 netmon: Enabled netmon atom for xmm7modem plugin
enabling netmon atom to report current serving cell measurements
for xmm7modem
2022-01-05 11:45:38 +00:00
Antara
c006d8b5ce netmon: Added netmon driver for xmm7modem
adding netmon driver for xmm7modem which uses intel proprietary
AT command +XMCI
2022-01-05 11:45:38 +00:00
Giacinto Cifelli
bf8e09da98 file-provision: support for auth type of NONE 2022-01-05 11:45:38 +00:00
Giacinto Cifelli
e60c6b16ff gprs-context: added OFONO_GPRS_AUTH_METHOD_NONE
This method makes explicit the lack of authentication.

When selected, the username and password are ignored, but they are not
changed in the user-defined properties for the context.
This treatment is necessary to allow setting independently auth_method,
username and password.

This method is also selected implicitly when username is set to
an empty string. Also this selection is done without changing the
user-defined auth_method for the context, so that the behavior is
consistent.
2022-01-05 11:36:53 +00:00
Giacinto Cifelli
c2dd50232f connman-api: added "none" auth_method 2022-01-05 11:36:53 +00:00
Giacinto Cifelli
fff50b8670 gatchat: support for auth NONE
Added authentication method G_AT_PPP_AUTH_METHOD_NONE and its handling.
2022-01-05 11:36:53 +00:00
Anirudh Gargi
0dd2d4874a xmm7xxx: enable sms and phonebook support 2022-01-05 11:36:53 +00:00
Denis Kenzior
b0e79b7564 AUTHORS: Mention Nandini's contributions 2022-01-05 11:36:53 +00:00
Nandini Rebello
e7f7197e5f test: Add test script to set sms alphabet 2022-01-05 11:36:53 +00:00
Nandini Rebello
fea0b49834 util: add bengali and gujrati sms alphabets 2022-01-05 11:36:53 +00:00
Nandini Rebello
e67bf1c41c doc: add support for 2 additional sms alphabets
Adding support for bengali and gujrati for GSM 7 bit.
2022-01-05 11:36:53 +00:00
Anirudh Gargi
3a5feec41d gprs: fix seg fault in case of NULL callback
In case of AT callback if callback handler is NULL, check for null
before calling the success macro.

Logs:
ofonod[32496]: src/network.c:current_operator_callback() 0x157ad60, (nil)
ofonod[32496]: src/gprs.c:netreg_status_changed() 0
ofonod[32496]: src/gprs.c:gprs_netreg_update() attach: 0, driver_attached: 1
ofonod[32496]: src/gprs.c:ofono_gprs_detached_notify() /xmm7xxx_0
ofonod[32496]: drivers/ifxmodem/gprs-context.c:ifx_gprs_detach_shutdown()
ofonod[32496]: drivers/ifxmodem/gprs-context.c:ifx_gprs_deactivate_primary() cid 0
ofonod[32496]: src/gprs.c:ofono_gprs_detached_notify() /xmm7xxx_0
ofonod[32496]: src/gprs.c:gprs_attach_callback() /xmm7xxx_0 error = 0
ofonod[32496]: drivers/ifxmodem/gprs-context.c:deactivate_cb() ok 0
ofonod[32496]: Aborting (signal 11) [./../src/ofonod]
ofonod[32496]: ++++++++ backtrace ++++++++
ofonod[32496]: +++++++++++++++++++++++++++
2022-01-05 11:36:53 +00:00
Anirudh Gargi
8457376df4 sms: allow sms send for EUTRAN sms only state
Patch to be considered, if support for EUTRAN SMS states accepted.

SMS registered flag while sending sms to consider the new EUTRAN
registered status also.
2022-01-05 11:36:53 +00:00
Adam Pigg
2aed406a96 network: add support eutran sms only states
EUTRAN SMS states mapped to registered and roaming respectively.
2022-01-05 11:36:49 +00:00
Anirudh Gargi
9ec0f966ef doc: Clarify LTE registration status documentation 2022-01-05 10:18:59 +00:00
Slava Monich
81b1bf3943 [packaging] Detect rpm version at build time. JB#55991 2021-12-17 13:56:07 +02:00
Slava Monich
c1bdd87f22 [unit] Avoid using g_key_file_save_to_file
Its use in a unit test is not significant enough to introduce
glib >= 2.40 requirement
2021-12-17 13:55:22 +02:00
Slava Monich
a796f670e1 [ofono] Fixed a few compilation warnings
plugins/cellinfo-netmon.c: In function 'cellinfo_netmon_notify':
plugins/cellinfo-netmon.c:85:44: warning: '%0*d' directive output may be truncated writing between 1 and 2147483647 bytes into a region of size 3 [-Wformat-truncation=]
     snprintf(s_mnc, OFONO_MAX_MNC_LENGTH, "%0*d",
                                            ^~~~
plugins/cellinfo-netmon.c:85:43: note: directive argument in the range [0, 999]
     snprintf(s_mnc, OFONO_MAX_MNC_LENGTH, "%0*d",
                                           ^~~~~~

src/gprs-provision.c: In function 'ofono_gprs_provision_get_settings':
src/gprs-provision.c:60:2: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
  if (mcc == NULL || strlen(mcc) == 0 || mnc == NULL || strlen(mnc) == 0)
  ^

plugins/generic-phonebook.c: In function 'export_entries':
plugins/generic-phonebook.c:942:2: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
  if (strcmp(storage, "SM") != 0) {
  ^
2021-12-17 13:54:19 +02:00
Slava Monich
122998372d Merge pull request #16 from monich/cellinfo-netmon
Add ofono_cell_info based NetMon driver
2021-12-09 14:27:52 +02:00
Slava Monich
29a9190dce [plugins] Add ofono_cell_info based NetMon driver. JB#56038
Instantiate with ofono_netmon_create(modem, 0, "cellinfo", modem)
Requires slot driver to provide ofono_cell_info interface.
2021-12-09 14:21:39 +02:00
Slava Monich
3eba9c2518 Merge pull request #15 from monich/phonebook
Add generic phonebook plugin
2021-12-01 13:06:44 +02:00
Slava Monich
8bd27690bf [plugins] Add generic phonebook plugin. JB#55524
Instantiate with ofono_phonebook_create(modem, 0, "generic", modem)
2021-12-01 02:33:46 +02:00
Slava Monich
09074dc026 [include] Added ofono_slot_remove_all_handlers macro. JB#55524 2021-11-13 02:08:07 +02:00
Slava Monich
b6c5a7e33f [include] Define struct modem in types.h
Not having it defined prior to use may result in weird compilation
errors about pointer type being incompatible with iself, e.g.

expected struct ofono_modem * but argument is of type struct ofono_modem *
2021-11-05 15:11:30 +02:00
Slava Monich
9de9417ef1 [include] Defined enum ofono_call_mode. JB#55524
Just 'int type' gives no clue, which value means what.
2021-11-05 15:10:19 +02:00
Slava Monich
d5599452b4 Merge pull request #14 from monich/jb55900
[ofono] Pulled in a bug fix from upstream. JB#55900
2021-10-28 13:25:46 +03:00
Jimmy Gysens
b1f3d44524 gprs: clean context properly
After a context is detached, the context is not properly cleared. In
addition to releasing the context:

- Reset the context settings (IP, DNS, interface, ...).
- Signal the Active flag as false.
2021-10-28 02:58:52 +03:00
Slava Monich
14e0f4555b Merge pull request #12 from sailfishos/jb55010
BuildRequire systemd via pkgconfig
2021-10-12 18:28:34 +03:00
Björn Bidar
949878c201 [packaging] BuildRequire systemd via pkgconfig. JB#55010
This allows to pick systemd-mini inside the builder instead of full
systemd.
2021-10-12 17:57:01 +03:00
Slava Monich
2a21299b3d [radio-settings] Removed unreachable code 2021-10-12 00:38:16 +03:00
Slava Monich
76e2c4388c [ofono] Bump libglibutil requirement 2021-10-10 05:11:39 +03:00
Slava Monich
dfafcfc190 Merge pull request #11 from monich/modemwatch
Expose modem watch API to plugins
2021-10-08 13:07:45 +03:00
Slava Monich
c38df7dbf0 [ofono] Expose modem watch API to plugins. JB#54540 2021-10-08 03:39:47 +03:00
Slava Monich
a008c72abd Update upstream hash 2021-10-07 19:52:37 +03:00
Slava Monich
7794754b6a Merge pull request #9 from PsychoGame/ofono-new
[ofono] Update baseline to 1.25. JB#54354
2021-10-07 19:50:03 +03:00
Slava Monich
9c2ab0e1d8 [plugin] Disabled OFONO_API_SUBJECT_TO_CHANGE check in plugin.h
Sailfish OS APIs must remain backward compatible. That's not subject
to change.
2021-10-01 13:53:18 +03:00
Slava Monich
d87e925d57 Merge pull request #10 from monich/config
Do not require non-critical packages
2021-09-29 12:34:40 +03:00
Slava Monich
33744c5106 [ofono] Do not require non-critical packages. JB#55701
Recommend them instead (requires rpm 4.12)
2021-09-28 19:13:18 +03:00
Jan Jasper de Kroon
a68123c74b Merge branch 'sailfishos:master' into ofono-new 2021-09-20 17:38:41 +01:00
Slava Monich
1d35a2dc2d Merge pull request #8 from monich/signals
Fix a problem with D-Bus signal not being emitted
2021-09-17 12:42:08 +03:00
Jan Jasper de Kroon
fcd5ce0bdd Merge branch 'sailfishos:master' into ofono-new 2021-09-17 06:57:45 +01:00
Slava Monich
352bdf5a39 [unit] Test DefaultDataModemChanged signal. JB#55575 2021-09-17 02:25:57 +03:00
Slava Monich
d73d3e2e7f [ofono] Fixed a problem with D-Bus signal not being emitted. JB#55575
Whenever slot_manager_update_modem_paths() returns something non-zero,
corresponding D-Bus signals must be emitted.
2021-09-17 02:25:43 +03:00
Slava Monich
38a83d3c18 [ofono] Added debug trace 2021-09-16 20:28:42 +03:00
Slava Monich
5b175c2877 [unit] Fixed coverage script
It was broken by removal of ril plugin.
2021-09-16 19:59:06 +03:00
Slava Monich
52bb7b3295 [unit] Added back test-conf
It was accidentally removed earlier.
2021-09-16 19:57:18 +03:00
Marcel Holtmann
024cce6145 Release 1.25 2021-09-15 19:26:53 +02:00
Pavel Machek
4d537b3234 udevng: Move debug print to more useful place
in setup_gobi()
2021-09-15 19:24:56 +02:00
Pavel Machek
a96228731f doc: Fix typo in location-reporting-api.txt 2021-09-15 19:24:21 +02:00
Pavel Machek
5023d59bc5 test: Better help for delivery reports
Explain "delivery report" parameter in send-sms.
2021-09-15 19:23:37 +02:00
Anirudh Gargi
51c83a9837 atmodem: add EUTRAN tech for creg read status
Add handling for CREG's status to get the technology type. CREG
notify URC does not need additional handling as 'AcT' is mapped
one-on-one to tech.
2021-09-15 19:22:54 +02:00
Giacinto Cifelli
d4599af851 atmodem/sms: no mms support for Gemalto 2021-09-15 19:21:58 +02:00
Giacinto Cifelli
67d401d1f8 gemalto: Use GEMALTO vendor for sms 2021-09-15 19:21:17 +02:00
Giacinto Cifelli
af7ba36e78 atmodem: change vendor CINTERION in GEMALTO in sms 2021-09-15 19:20:00 +02:00
Giacinto Cifelli
27ebe48759 gemalto: Use GEMALTO vendor instead of CINTERION
The sim atom is now created with the GEMALTO vendor instead of
CINTERION.  This is because GEMALTO has superceeded CINTERION and the
gemalto plugin will be updated to handle (legacy) modems from cinterion
as well as current gemalto devices.
2021-09-15 19:19:21 +02:00
Giacinto Cifelli
bafb4c2c31 atmodem: change vendor CINTERION to GEMALTO in sim 2021-09-15 19:17:54 +02:00
Giacinto Cifelli
7a12dd7ac7 atmodem: added Gemalto vendor to CBS CSCB logic 2021-09-15 19:17:15 +02:00
Giacinto Cifelli
61ea242ce6 lte: add implementation for ofono_lte_get_modem 2021-09-15 19:16:32 +02:00
Giacinto Cifelli
d4a0dd4efc include: add ofono_lte_get_modem global function
this function can be used in the drivers to query the functions
ofono_modem_get_* to retrieve modem-specific properties
2021-09-15 19:14:02 +02:00
Giacinto Cifelli
d6d0ee296d lte: clarify failed registration message 2021-09-15 19:13:01 +02:00
Marcel Holtmann
3575ce6a2d build: Remove setup of thread support 2021-09-15 19:10:42 +02:00
Giacinto Cifelli
f8bdf3cd4e gprs: make sure that the context is properly released 2021-09-15 19:00:01 +02:00
Giacinto Cifelli
b4f200efc7 atmodem/sms: Do not print an error message incorrectly
add missing return in at_cmt_notify.  Without it an error message was
generated in all cases, even successful ones.
2021-09-15 18:58:18 +02:00
Giacinto Cifelli
758210a774 mbim: fix calling mbim_sms_exit instead of _init 2021-09-15 18:57:26 +02:00
Giacinto Cifelli
75c85ee49a tools: remove calls to g_thread_init 2021-09-15 18:56:44 +02:00
Giacinto Cifelli
b7a3fce633 main: Remove call to g_thread_init
according to g_thread documentation, this call is no longer needed,
and starting from g_thread version 2.32 it must not be used
2021-09-15 18:56:00 +02:00
Giacinto Cifelli
3b2945f3ff gprs: Fix use of invalid operator for bitwise flags 2021-09-15 18:54:57 +02:00
Giacinto Cifelli
fa3875693b atmodem: added vendor Gemalto 2021-09-15 18:54:15 +02:00
Giacinto Cifelli
92e8e6604c doc: fix typo in doc/emergency-call-handling.txt 2021-09-15 18:53:15 +02:00
Anirudh Gargi
9ca9dc545e udev:fix seg fault in case of vid and pid is NULL
In some case linux report 'driver' as valid yet vid and pid as NULL.
Adding NULL check to prevent seg fault.

Log:
ofonod[23829]: plugins/udevng.c:udev_start()
ofonod[23829]: plugins/udevng.c:enumerate_devices()
ofonod[23829]: plugins/udevng.c:check_usb_device() hub [1d6b:0002]
ofonod[23829]: plugins/udevng.c:check_usb_device() usb [1d6b:0002]
ofonod[23829]: plugins/udevng.c:check_usb_device() usbhid [03f0:034a]
ofonod[23829]: plugins/udevng.c:check_usb_device() usbhid [03f0:034a]
ofonod[23829]: plugins/udevng.c:check_usb_device() usb [1d6b:0002]
ofonod[23829]: plugins/udevng.c:check_usb_device() cdc_acm [(null):(null)]
ofonod[23829]: Aborting (signal 11) [./src/ofonod]
2021-09-15 18:52:34 +02:00
Christophe Ronco
69b6338baa qmimodem: fix roaming status report
Problem seen with a MC7304 modem and a roaming SIM card.
Status in org.ofono.NetworkRegistration properties ends up in "registered"
instead of roaming. Both AT command and qmicli indicates we are roaming.

What's happening is the following:

1) first QMI_NAS_SS_INFO_IND indicating we are registered contains a
QMI_NAS_RESULT_ROAMING_STATUS parameter.
Parameter inside says we are roaming and qmimidem driver correctly reports
status NETWORK_REGISTRATION_STATUS_ROAMING.
2) other QMI_NAS_SS_INFO_IND arrive, saying we are registered without
QMI_NAS_RESULT_ROAMING_STATUS parameter.
Driver reports NETWORK_REGISTRATION_STATUS_REGISTERED.

Extract of traces with QMI binary debug interpreted (as far as I can...):
a) first "searching" indication
ofonod[855]: QMI: < 01 3b 00 80 03 01 04 00 00 24 00 2f 00
29 05 00 d0 00 14 00 00 MCC:208 MNC:20
22 05 00 01 02 00 01 00 Detailed Service Status:
                        QMI_NAS_SERVICE_STATUS_LIMITED,
                        QMI_NAS_NETWORK_SERVICE_DOMAIN_PS, ...
15 03 00 01 08 01 LTE, no roaming
12 05 00 d0 00 14 00 00 Current PLMN: MCC:208 MNC:20, no desc
11 01 00 00
10 01 00 01 No roaming
01 06 00 02 02 02 02 01 08 NAS_REGISTRATION_STATE_NOT_REGISTERED_SEARCHING,
                           CS detached, PS detached, NETWORK_TYPE_3GPP,
                           QMI_NAS_RADIO_INTERFACE_LTE
ofonod[855]: QMI: NAS_ind msg=36 len=47 [client=1,type=4,tid=0,len=59]
ofonod[855]: QMI: {type=41,len=5} {type=34,len=5} {type=21,len=3}
             {type=18,len=5}
ofonod[855]: QMI: {type=17,len=1} {type=16,len=1} {type=1,len=6}
ofonod[855]: ofono_netreg_status_notify modem /sierra_0 status 2 lac -1
             cellid -1 tech 7

b) second "searching" indication
ofonod[855]: QMI: < 01 21 00 80 03 01 04 00 00 24 00 15 00
22 05 00 03 03 00 01 00 Detailed Service Status:
                        QMI_NAS_SERVICE_STATUS_LIMITED_REGIONAL, CS_PS, ...
11 01 00 00
01 06 00 02 02 02 02 01 08 NAS_REGISTRATION_STATE_NOT_REGISTERED_SEARCHING,
                           CS detached, PS detached, NETWORK_TYPE_3GPP,
                           QMI_NAS_RADIO_INTERFACE_LTE

ofonod[855]: QMI: NAS_ind msg=36 len=21 [client=1,type=4,tid=0,len=33]
ofonod[855]: QMI: {type=34,len=5} {type=17,len=1} {type=1,len=6}

c) First indication while "registered"
ofonod[855]: QMI: < 01 5e 00 80 03 01 04 00 00 24 00 52 00
2a 01 00 00
29 05 00 d0 00 14 00 00 MCC:208 MNC:20
28 02 00 15 01 UMTS Primary Scrambling Code
26 08 00 03 00 00 00 03 00 00 00 CS: all calls allowed,
                                 PS: all calls allowed
22 05 00 02 03 00 01 00 Detailed Service Status:
                        QMI_NAS_SERVICE_STATUS_AVAILABLE, CS_PS, ...
1e 04 00 f7 00 95 04 CID 3GPP
1d 02 00 fb 50 LAC 3GPP
15 03 00 01 05 00 UMTS: roaming
12 05 00 d0 00 14 00 00 Current PLMN: MCC:208 MNC:20, no desc
11 04 00 03 03 04 05
10 01 00 00 ROAMING ON
01 06 00 01 01 01 02 01 05 NAS_REGISTRATION_STATE_REGISTERED, CS attached,
                           PS attached, NETWORK_TYPE_3GPP,
                           QMI_NAS_RADIO_INTERFACE_UMTS
ofonod[855]: QMI: NAS_ind msg=36 len=82 [client=1,type=4,tid=0,len=94]
ofonod[855]: QMI: {type=42,len=1} {type=41,len=5} {type=40,len=2}
             {type=38,len=8}
ofonod[855]: QMI: {type=34,len=5} {type=30,len=4} {type=29,len=2}
             {type=21,len=3}
ofonod[855]: QMI: {type=18,len=5} {type=17,len=4} {type=16,len=1}
             {type=1,len=6}
ofonod[855]: ofono_gprs_status_notify modem /sierra_0 status 1

==================> ROAMING status reported <==========================
ofonod[855]: ofono_netreg_status_notify modem /sierra_0 status 5 lac 20731
             cellid 76873975 tech 2

d) second indication while "registered"
ofonod[855]: QMI: < 01 31 00 80 03 01 04 00 00 24 00 25 00
29 05 00 d0 00 14 00 00 MCC:208 MNC:20
28 02 00 15 01 UMTS Primary Scrambling Code
12 05 00 d0 00 14 00 00 Current PLMN: MCC:208 MNC:20, no desc
11 04 00 03 03 04 05
01 06 00 01 01 01 02 01 05 NAS_REGISTRATION_STATE_REGISTERED, CS attached,
                           PS attached, NETWORK_TYPE_3GPP,
                           QMI_NAS_RADIO_INTERFACE_UMTS
ofonod[855]: QMI: NAS_ind msg=36 len=37 [client=1,type=4,tid=0,len=49]
ofonod[855]: QMI: {type=41,len=5} {type=40,len=2} {type=18,len=5}
                  {type=17,len=4}
ofonod[855]: QMI: {type=1,len=6}
==================> ROAMING information lost <==========================
ofonod[855]: ofono_netreg_status_notify modem /sierra_0 status 1 lac -1
             cellid -1 tech 2

I can't tell if not having the ROAMING_STATUS parameter in all indication
is something happening only on MC7304 or if it happens on all "QMI" modems.

I have also seen (on MC7430, with a roaming SIM card):
 - first notification indicating status
QMI_NAS_REGISTRATION_STATE_SEARCHING and roaming ON
 - following notifications indicating status
QMI_NAS_REGISTRATION_STATE_REGISTERED and no roaming notification

So we must handle roaming information even when not registered.
2021-09-15 18:51:39 +02:00
Denis Kenzior
bef7e690b5 AUTHORS: Mention Julien's contributions 2021-09-15 18:50:45 +02:00
Julien Tournier
5a4923261a atmodem: Handle cinterion modems compliant with 27.005 2021-09-15 18:45:17 +02:00
Martin Hundebøll
05c2185163 atmodem: add Quectel M95 special case for PIN query
The AT command reference for Quectel M95 specifies that remaining SIM
pin retires can be queried using AT+QTRPIN, which responds with one
count for each pin-type:

+QTRPIN: 3,3,10,10

After entering the PIN code, enable an extra AT+CPIN? for the M95
vendor.
2021-09-15 18:40:51 +02:00
Denis Kenzior
2da2e87b76 AUTHORS: Mention Martin's contributions 2021-09-15 18:39:12 +02:00
Martin Hundebøll
8ca429b2c1 udevng: fix removal of serial devices
Since the merge of udev.c into udevng.c all cleanup function must handle
both usb devices and serial devices. Add this distinction to
check_remove(), so that is doesn't try to iterate the .serial member as
if it were a .devices list.
2021-09-15 18:38:24 +02:00
Giacinto Cifelli
dbcf6e269d ublox: Add voicecall support 2021-09-15 18:37:30 +02:00
Christophe Ronco
061c743837 huawei: use VENDOR_HUAWEI quirk on gprs context creation 2021-09-15 18:35:47 +02:00
Christophe Ronco
b908289e32 atmodem: Add gprs-context quirk for HUAWEI vendor
When ofono dies while connected using PPP, modem AT channel is not put
back to command mode (tested with HUAWEI modems E3372 and MS2372).
If ofono is restarted, it won't be able to connect as it gets no answer
to AT commands on this AT channel.
This patch adds a quirk to immediately send escape sequence on modem
channel when gprs-context atom is removed.
2021-09-15 18:33:58 +02:00
Denis Kenzior
d4220f7223 udevng: Fix SIM900 detection 2021-09-15 18:22:41 +02:00
Denis Kenzior
4ddff7658f mbim: Remove useless debug 2021-09-15 18:21:46 +02:00
Slava Monich
09e6f35a23 [ofono] Replace built-in ril plugin with the external one. JB#55027 2021-09-15 03:02:16 +03:00
Slava Monich
6dddf527d5 Merge pull request #7 from monich/double-free
Fix double-free
2021-09-14 17:01:57 +03:00
Slava Monich
a9de07c2bb [ril] Fix double-free. JB#55547 2021-09-14 16:43:36 +03:00
Slava Monich
ecf14f5165 Merge pull request #4 from monich/ril-split
Make more APIs available to external plugins
2021-09-13 17:51:42 +03:00
Slava Monich
bc4c860a86 [ofono] Make more APIs available to external plugins. JB#55027
This allows to build Jolla ril driver as an external dynamically
loadable plugin.
2021-09-13 16:32:33 +03:00
Slava Monich
7684dd4295 Housekeeping 2021-09-13 14:32:44 +03:00
Slava Monich
f24a5be4ec Update upstream hash 2021-09-13 14:32:23 +03:00
Slava Monich
c45e207f12 Merge pull request #6 from PsychoGame/ofono-new
[ofono] Update baseline to 1.24. JB#54354
2021-09-13 14:26:53 +03:00
Marcel Holtmann
005f36bb89 Release 1.24 2021-09-07 21:48:50 +02:00
Marcel Holtmann
3d01485a05 gatchat: Use pragma to mask unknown pragma diagnostic options
gatchat/gatmux.c:33:32: error: unknown option after ‘#pragma GCC diagnostic’ kind [-Werror=pragmas]
 #pragma GCC diagnostic ignored "-Wcast-function-type"
                                ^~~~~~~~~~~~~~~~~~~~~~
2021-09-07 21:43:31 +02:00
Marcel Holtmann
cc7b30414f rilmodem: Use pragma to mask restrict buffer warnings
In file included from drivers/rilmodem/network-registration.c:40:
drivers/rilmodem/network-registration.c: In function ‘ril_cops_list_cb’:
./gril/gril.h:98:11: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
   sprintf(print_buf, x);  \
           ^~~~~~~~~
drivers/rilmodem/network-registration.c:583:3: note: in expansion of macro ‘g_ril_append_print_buf’
   g_ril_append_print_buf(nd->ril, "%s [lalpha=%s, salpha=%s, "
   ^~~~~~~~~~~~~~~~~~~~~~
./gril/gril.h:98:11: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
   sprintf(print_buf, x);  \
           ^~~~~~~~~
drivers/rilmodem/network-registration.c:593:2: note: in expansion of macro ‘g_ril_append_print_buf’
  g_ril_append_print_buf(nd->ril, "%s}", print_buf);
  ^~~~~~~~~~~~~~~~~~~~~~

In file included from drivers/rilmodem/call-forwarding.c:41:
drivers/rilmodem/call-forwarding.c: In function ‘ril_query_call_fwd_cb’:
./gril/gril.h:98:11: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
   sprintf(print_buf, x);  \
           ^~~~~~~~~
drivers/rilmodem/call-forwarding.c:114:3: note: in expansion of macro ‘g_ril_append_print_buf’
   g_ril_append_print_buf(fd->ril, "%s [%d,%d,%d,%s,%d]",
   ^~~~~~~~~~~~~~~~~~~~~~
./gril/gril.h:98:11: error: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Werror=restrict]
   sprintf(print_buf, x);  \
           ^~~~~~~~~
drivers/rilmodem/call-forwarding.c:124:2: note: in expansion of macro ‘g_ril_append_print_buf’
  g_ril_append_print_buf(fd->ril, "%s}", print_buf);
  ^~~~~~~~~~~~~~~~~~~~~~
2021-09-07 21:42:45 +02:00
Marcel Holtmann
1617b325de gatchat: Use pragma to mask GFunc casting warning
gatchat/gatmux.c: In function ‘watch_dispatch’:
gatchat/gatmux.c:454:17: error: cast between incompatible function types from ‘GSourceFunc’ {aka ‘int (*)(void *)’} to ‘gboolean (*)(GIOChannel *, GIOCondition,  void *)’ {aka ‘int (*)(struct _GIOChannel *, enum <anonymous>,  void *)’} [-Werror=cast-function-type]
  GIOFunc func = (GIOFunc) callback;
                 ^
2021-09-07 21:42:01 +02:00
Antara Borwankar
a8838c2287 atmodem: Support ETWS & CMAS on XMM series modems 2021-09-07 21:40:49 +02:00
Denis Kenzior
c8cd552851 sim: Fix not updating sim pin state
In case we try to enter the PIN/PUK and fail to enter a correct code,
the PIN/PUK retries are not rechecked as they should be.

Reported by: Florent Beillonnet <florent.beillonnet@gmail.com>
2021-09-07 21:39:55 +02:00
Denis Kenzior
6995d8c42c AUTHORS: Mention Florent's contributions 2021-09-07 21:38:21 +02:00
Florent Beillonnet
17052d41de atmodem: Fix at_pin_send_puk userdata use
It seems that the function at_pin_send_puk should have been changed
along with at_pin_send, because it's also refering to the
at_pin_send_cb callback

See this commit : ba9f126716db3ae0bf6a3139088d9657cfb8b851
2021-09-07 21:37:38 +02:00
Denis Kenzior
70a93dcc5b gemalto: Whitespace fixes 2021-09-07 21:36:40 +02:00
Denis Kenzior
e3ea3abaa0 AUTHORS: Mention Varun's contributions 2021-09-07 21:36:00 +02:00
Varun Gargi
f60c44b034 udevng: remove vendor ID to make it generic for intel modem 2021-09-07 21:35:00 +02:00
James Prestwood
a679258b4a plugins: fixed crash in udevng
The return value from ofono_modem_register was not being checked. If this fails
the modem object is not setup and causes a crash. This was specifically seen
when using the mbim driver without having configured with mbim support.

Now the modem object gets destroyed properly if the modem registration fails.
2021-09-07 21:33:59 +02:00
Bob Ham
0ed72bcffa sim7100: Specify vendor ID while creating voicecall driver
This enables the atmodem voicecall driver to handle SIMCom quirks like
not setting AT+COLP=1.
2021-09-07 21:30:55 +02:00
Bob Ham
7d5a660604 atmodem: Don't set AT+COLP=1 on SIMCom modems
On the SIMCom SIM7100E, setting AT+COLP=1 causes there to be no
response at all from "ATD...;" commands until the call is answered.
The results in oFono stalling rather than creating a new VoiceCall
object.

We fix this by adding SIMCOM to the list of vendors for whom we set
AT+COLP=0 rather than AT+COLP=1.
2021-09-07 21:30:08 +02:00
Denis Kenzior
d67240c717 AUTHORS: Mention Bob's contributions 2021-09-07 21:26:39 +02:00
Bob Ham
b12016eb45 plugins: Add support for SIM7100E by SIMCom
Add support for the SIM7100E modem.  We add a new "sim7100" plugin
because there's no other AT-based modem that has support for both GPRS
and voice calls.
2021-09-07 21:25:40 +02:00
Denis Kenzior
bfec98afdf unit: Fix gcc warning
In file included from unit/test-mbim.c:28:0:
unit/test-mbim.c: In function ‘parse_device_caps’:
unit/test-mbim.c:332:9: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
  assert(cellular_class = 1);
2021-09-07 21:14:10 +02:00
Mark van der Putten
7376781211 gemalto: signal sim initialized
Modem type PLS8-E, firmware 03.017
2021-09-07 21:11:23 +02:00
Christophe Ronco
732160519a qmi: report SIM not inserted when unable to get PIN type 2021-09-07 21:08:55 +02:00
Christophe Ronco
f71d2a2b70 qmi: report failure or retry in case of invalid pin type
QMI_UIM_GET_CARD_STATUS is retried in more error cases
when trying to get password type.
In case of failure, driver report an error instead of
OFONO_SIM_PASSWORD_INVALID. This avoids a crash.
2021-09-07 21:08:08 +02:00
Christophe Ronco
793e9fcae4 qmi: use right slot and application during SIM detection
Use right slot and application to get card status, PIN status and PIN
retries. Without this patch, SIMs where selected application and slot
numbers are different are not detected.
2021-09-07 21:07:08 +02:00
Jonas Bonn
ae204ebf82 qmi: make services always shared 2021-09-07 21:05:05 +02:00
Jonas Bonn
30b09b35af gobi: Update to the new version_list changes 2021-09-07 21:03:54 +02:00
Jonas Bonn
1495f222b0 qmi: make version_list private 2021-09-07 21:02:38 +02:00
Jonas Bonn
b9b2765b21 qmi: assume version_list is up to date
The way things are currently coded, the gobi plugin calls
qmi_device_discover and does nothing else until it succeeds.  As such,
we can safely assume that the version_list is set up when we go to
create a service.
2021-09-07 20:59:42 +02:00
Jonas Bonn
29ecf1a59a qmi: drop header output parameter from request_alloc
The only thing this output parameter is being used for now is for
getting the transaction ID.  Return the TID directly from
__submit_requesta and drop the 'head' parameter altogether.
2021-09-07 20:58:52 +02:00
Jonas Bonn
f1d3367e0a qmi: request_alloc has no meaningful failure path
The only way request_alloc can fail is if one of the memory allocation
routines fail to allocate memory.  However, Linux memory allocation
doesn't really fail in this manner; memory can be overcommited and the
out-of-memory reaper will take care of re-establishing the balance when
excess memory is actually accessed.

Given this, request_alloc will never return anything other than success
and the failure paths will never be exercised.
2021-09-07 20:58:07 +02:00
Jonas Bonn
7131403177 qmi: unify common request header setup
The service and control requests differ slightly in their headers, but
this difference is minor enough that we can handle it directly in the
request submission routine.  This patch unifies the header setup for the
two request types.
2021-09-07 20:54:58 +02:00
Jonas Bonn
ff99f16ccb qmi: remove headroom parameter from req_alloc
The headroom can be established from the service type, so it's redundant
to pass it as a parameter.
2021-09-07 20:54:12 +02:00
Jonas Bonn
ccec9504a5 qmi: remove unused fields of service_send_data
After setting up the request structure, qmi_service_send makes no
further use of the 'param' and 'service' fields of the service_send_data
structure.  This patch removes those fields and frees 'param'
immediately after the request has been allocated and the parameter data
thereby copied into the send buffer.
2021-09-07 20:52:21 +02:00
Bassem Boubaker
e37ca6d384 gemalto: Clarify supported modem family name
Some gemalto modem family share almost the same base except some very
specific AT command and some hardware changes like ALSx and PXSx family
2021-09-07 20:49:34 +02:00
Mariem Cherif
ab5b76d6cf gemalto: handle sim is inserted or removed URCs 2021-09-07 20:48:14 +02:00
Denis Kenzior
35ef8fb8a1 qmi: Fix uninitialized value use
==2870== Conditional jump or move depends on uninitialised value(s)
==2870==    at 0x4C2ED31: __memcmp_sse4_1 (vg_replace_strmem.c:972)
==2870==    by 0x4F451A: sim_pin_retries_query_cb (sim.c:462)
==2870==    by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870==    by 0x45544A: service_send_callback (qmi.c:2143)
==2870==    by 0x452D00: handle_packet (qmi.c:815)
==2870==    by 0x452E85: received_data (qmi.c:863)
==2870==    by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x4C680B: main (main.c:256)
==2870==  Uninitialised value was created by a stack allocation
==2870==    at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870==    at 0x4F451D: sim_pin_retries_query_cb (sim.c:462)
==2870==    by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870==    by 0x45544A: service_send_callback (qmi.c:2143)
==2870==    by 0x452D00: handle_packet (qmi.c:815)
==2870==    by 0x452E85: received_data (qmi.c:863)
==2870==    by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x4C680B: main (main.c:256)
==2870==  Uninitialised value was created by a stack allocation
==2870==    at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870==    at 0x4F3DFB: get_pin_retries (sim.c:278)
==2870==    by 0x4F4553: sim_pin_retries_query_cb (sim.c:467)
==2870==    by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870==    by 0x45544A: service_send_callback (qmi.c:2143)
==2870==    by 0x452D00: handle_packet (qmi.c:815)
==2870==    by 0x452E85: received_data (qmi.c:863)
==2870==    by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x4C680B: main (main.c:256)
==2870==  Uninitialised value was created by a stack allocation
==2870==    at 0x459B1A: query_pin_retries_cb (sim.c:531)
==2870==
==2870== Conditional jump or move depends on uninitialised value(s)
==2870==    at 0x4F3E65: get_pin_retries (sim.c:288)
==2870==    by 0x4F4553: sim_pin_retries_query_cb (sim.c:467)
==2870==    by 0x459BDD: query_pin_retries_cb (sim.c:544)
==2870==    by 0x45544A: service_send_callback (qmi.c:2143)
==2870==    by 0x452D00: handle_packet (qmi.c:815)
==2870==    by 0x452E85: received_data (qmi.c:863)
==2870==    by 0x508DB6C: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508DF47: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x508E271: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1)
==2870==    by 0x4C680B: main (main.c:256)
==2870==  Uninitialised value was created by a stack allocation
==2870==    at 0x459B1A: query_pin_retries_cb (sim.c:531)
2021-09-07 20:46:23 +02:00
Denis Kenzior
d0a617d469 qmi: Fix memory leak
==14399== 28 bytes in 4 blocks are definitely lost in loss record 151 of 390
==14399==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==14399==    by 0x209065: convert_gsm_to_utf8_with_lang (util.c:651)
==14399==    by 0x2091D1: convert_gsm_to_utf8 (util.c:690)
==14399==    by 0x22DDA7: ussd_decode (smsutil.c:4738)
==14399==    by 0x18BF71: qmi_ussd_request (ussd.c:233)
==14399==    by 0x2183EA: ussd_initiate (ussd.c:614)
==14399==    by 0x27B6C8: process_message (object.c:259)
==14399==    by 0x27D1CD: generic_message (object.c:1070)
==14399==    by 0x5170732: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.14)
==14399==    by 0x5161D83: dbus_connection_dispatch (in /lib/x86_64-linux-gnu/libdbus-1.so.3.14.14)
==14399==    by 0x27907C: message_dispatch (mainloop.c:72)
==14399==    by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
2021-09-07 20:06:26 +02:00
Denis Kenzior
1ba3b32273 qmi: Fix memory leak
==14399== 16 bytes in 8 blocks are definitely lost in loss record 132 of 390
==14399==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
==14399==    by 0x59E03D9: strndup (strndup.c:43)
==14399==    by 0x18277E: qmi_result_get_string (qmi.c:1794)
==14399==    by 0x184221: get_ids_cb (devinfo.c:129)
==14399==    by 0x18353B: service_send_callback (qmi.c:2286)
==14399==    by 0x18093C: handle_packet (qmi.c:831)
==14399==    by 0x180ADD: received_data (qmi.c:880)
==14399==    by 0x4E826A9: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399==    by 0x4E82A5F: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399==    by 0x4E82D81: g_main_loop_run (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.5000.3)
==14399==    by 0x201900: main (main.c:306)
2021-09-07 20:05:00 +02:00
Gabriel Lucas
14b764ac64 gemalto: support ALS3 in gemalto's plugin
Force serial port opening options
Wait for modem to be ready to start
initializing it
Handle LTE
2021-09-07 20:03:52 +02:00
Bassem Boubaker
b808bfad17 gemalto: Add more details in setup_gemalto comment
ALS3, PLS8-E and PLS8-X have same vid/pid with same enumeration process
2021-09-07 19:53:46 +02:00
Denis Kenzior
82d62a8f50 AUTHORS: Mention Bassem's contributions 2021-09-07 19:52:07 +02:00
Bassem Boubaker
23d6263e3c cdma-netreg: Fix emission of PropertyChanged 2021-09-07 19:51:01 +02:00
Denis Kenzior
ac3192204c AUTHORS: Mention Mariem's contributions 2021-09-07 19:49:54 +02:00
Mariem Cherif
5ad2617ecd gemalto: acquire the network technology 2021-09-07 19:48:21 +02:00
Gabriel Lucas
890842b3af gemalto: add detection of ALS3 modem
The product ID is added to the list of
modems to be detected by Ofono.
The gemalto plugin is used to handle the
ALS3 modem.
2021-09-07 19:47:25 +02:00
Denis Kenzior
06de44299a plugins: Update to the new LTE API 2021-09-07 19:39:51 +02:00
Denis Kenzior
77b2eec613 ubloxmodem: Update to the new LTE API 2021-09-07 19:37:07 +02:00
Denis Kenzior
12ccd7cd46 rilmodem: Update to the new LTE API 2021-09-07 19:35:59 +02:00
Denis Kenzior
8f09880d52 qmimodem: Update to the new LTE API 2021-09-07 19:31:48 +02:00
Denis Kenzior
ee5f91221b atmodem: Update to the new lte API 2021-09-07 19:29:08 +02:00
Denis Kenzior
c03c6f4215 lte: update to the new API 2021-09-07 19:25:27 +02:00
Denis Kenzior
c49e2d8723 include: Add missing vendor parameter to lte atom 2021-09-07 19:13:37 +02:00
Slava Monich
deecd829a6 Merge pull request #5 from sailfishos/jb55388
Remove incorrect hardcoded tech value.
2021-09-07 16:49:39 +03:00
Matti Lehtimäki
3acf91c6a9 [ril] Remove incorrect hardcoded tech value. JB#55388 2021-09-06 20:44:26 +03:00
Marcel Holtmann
85b61c8964 call-forwarding: Increase string buffer to avoid overflow 2021-08-26 03:03:55 +03:00
Jonas Bonn
8986749585 atmodem: enlarge command buffer
The ofono phone number max length is 80 so a buffer size of 64 is
obviously insufficient.  Expanding the buffer to 128 prevents a
potential failure and suppresses the folowing compiler warning:

../drivers/atmodem/sms.c: In function ‘at_csca_set’:
../drivers/atmodem/sms.c:108:40: warning: ‘%s’ directive output may be truncated writing up to 80 bytes into a region of size 55 [-Wformat-truncation=]
  snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type);
                                        ^~
../drivers/atmodem/sms.c:108:2: note: ‘snprintf’ output between 13 and 103 bytes into a destination of size 64
  snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-08-26 03:03:55 +03:00
Juho Hämäläinen
1c0f5094a6 Merge pull request #3 from jusa/jb55276
Be less pedantic about ordering of speech codecs.
2021-08-25 17:00:06 +03:00
Juho Hämäläinen
4208b6d9ea [bluetooth] Be less pedantic about ordering of speech codecs. Fixes JB#55276
HFP spec 1.7.1 (4.34.1) says:

The Codec ID for the mandatory narrow band codec (CVSD) shall
always be included.

If wide band speech is supported, then the mandatory codec (mSBC)
shall be included unless it is temporarily unavailable.

Any other optional wide band speech codecs may also be included
in this list as long as the mandatory codec is included first.

---

The wording in spec is slightly vague on what the ordering of
mandatory narrow band codec (CVSD) and - IF wide band speech
is supported - mandatory wide band coded (mSBC) should be.
oFono's take is that the mandatory narrow band codec should
be listed first, and when mSBC is there oFono will abort the
connection.

To fix this we can be less pedantic about the ordering of
codecs - as long as the mandatory ones are there.
2021-08-25 16:32:55 +03:00
Frajo
59e304d474 Merge pull request #2 from krnlyng/jb55233
[packaging] Use transfiletriggerin to restart ofono when a plugin is installed. JB#55233
2021-08-25 16:02:24 +03:00
Frajo Haider
30a2424507 [packaging] Use transfiletriggerin to restart ofono when a plugin is installed. JB#55233 2021-08-24 13:29:18 +03:00
Slava Monich
e4f3ec6322 Merge pull request #1 from monich/start_block
Fix SIM I/O mess
2021-07-30 15:12:59 +03:00
Slava Monich
95fd4efc37 [simfs] Fix SIM I/O mess. JB#54380
Apparently all simfs reads from any blocks other than the very first one
were badly broken and could even cause a crash :|
2021-07-30 01:50:07 +03:00
Slava Monich
ef5ee98508 [ofono] Set destination for Unsubscribed signal. JB#50816 2021-06-10 18:00:39 +03:00
Slava Monich
4220e7d5e8 Merge branch 'dbus-clients-fixes' into 'master'
Resolve a few issues with cell info notifications

See merge request mer-core/ofono!286
2021-06-10 13:54:42 +00:00
Slava Monich
33c067a75f [ofono] Resolved a few issues with cell info notifications. JB#50816
1. Disable notifications from modem on unsibscribe
2. Made all signals unicast
3. Fixed a memory leak
2021-06-10 16:23:52 +03:00
Slava Monich
29616c04d0 [ofono] Fixed signal emission, reworked D-Bus client list. JB#50816
1. Exposed D-Bus clients list to plugin as ofono_dbus_clients
2. Signal has to be properly declared, otherwise it's not emitted
3. Added missing unit tests
2021-06-10 05:10:16 +03:00
Slava Monich
beb997d914 Merge branch 'jb50608-ondemand' into 'master'
Disable cell info updates when no one listens for them

See merge request mer-core/ofono!274
2021-06-10 01:58:05 +00:00
Slava Monich
cefc03e5ed Merge branch 'pcscf' into 'master'
Expose P-CSCF address(es) over D-Bus

See merge request mer-core/ofono!285
2021-06-03 21:29:06 +00:00
Slava Monich
85d99536ee Merge branch 'mtu' into 'master'
Don't limit MTU for non-MMS contexts

See merge request mer-core/ofono!284
2021-06-03 21:28:08 +00:00
Slava Monich
ea36baa4c1 [ril] Don't limit MTU for non-MMS contexts
Larger MTU means better throughput, and the original problem for which
this workaround was implemented was specific to MMS. There's no reason
to limit MTU for other data connections.
2021-06-03 19:49:38 +03:00
Slava Monich
b95a089c00 [ril] Provide P-CSCF address to the core. JB#48905
Also optimized reporting of DNS addresses by not setting empty lists.
If nothing else, that slightly reduces the amount of D-Bus traffic.
2021-06-03 19:36:52 +03:00
Slava Monich
c8dbf5494b [ofono] Expose P-CSCF address(es) via D-Bus. JB#48905 2021-06-03 19:01:01 +03:00
Slava Monich
cfb75f473d [sim] Fixed AID comparison. JB#54048
It worked only because aid was the first field in the struct.
2021-06-03 04:24:46 +03:00
Slava Monich
edd91c94eb Merge branch 'auth' into 'master'
Implement org.ofono.SimAuthentication interface

See merge request mer-core/ofono!283
2021-06-02 14:15:27 +00:00
Slava Monich
af0ab142e1 [ril] Implement org.ofono.SimAuthentication interface. JB#54048 2021-06-01 02:12:35 +03:00
Slava Monich
dffc04d404 [sim-auth] Support short AIDs. JB#54048
They can be shorter than 16 bytes.
2021-06-01 02:11:36 +03:00
Slava Monich
97b5fcbd87 [sim-auth] Parse auth response according to TS 31.102 2021-05-30 14:09:32 +03:00
Slava Monich
d7e740347f [sim-auth] Fill unused part of AID with FFs 2021-05-30 14:09:32 +03:00
Slava Monich
1116ca2481 [ril] Append ROOTMF path by default
Empty path never works and some RILs/modems don't like it so much
that it causes a reset.
2021-05-30 14:01:02 +03:00
Denis Grigorev
3d147843c4 [ril] Make cell info updates unicast. JB#50608 2021-05-28 16:25:42 +03:00
Denis Grigorev
c01dc63cbc [ril] Cell info consumer can unsubscribe from updates. JB#50608
Add a new org.nemomobile.ofono.CellInfo.Unsubscribe method. If it is called
ofono excludes the client from cell info consumers. The updates will be
disabled if no one client left.
2021-05-28 16:25:42 +03:00
Denis Grigorev
297926ed24 [ril] Enable cell info updates only when requested. JB#50608 2021-05-28 16:25:42 +03:00
Denis Grigorev
6ef1174ea8 [ril] Cell info updates can be disabled. JB#50608 2021-05-28 16:25:42 +03:00
Slava Monich
4ad02792db Merge branch 'omp-jb54420' into 'master'
[ril] Use ofono_sim_read_path() in case of reading EFpbr from USIM. Fixes JB#54420

See merge request mer-core/ofono!282
2021-05-25 23:50:07 +00:00
Bogdan Migunov
eddcb88af4 [ril] Use ofono_sim_read_path() in case of reading EFpbr from USIM. Fixes JB#54420
There is an issue when some of the Mediatek modems do not accept empty
path to the EFpbr file on the USIM and do reset themselves.
This fix appends usim_path to the GET DATA command when it comes to
exporting phonebook from SIM card and prevents crashes like described
one.
2021-05-25 19:18:57 +03:00
Denis Kenzior
f91df7f0fd simutil: Fix EF structure bit processing
The intent here was to find the contents of the 3 low order bits
according to Table 11-5 in ETSI 102.221.  However, the mask ended up
only grabbing the contents of the 2 low order bits.
2021-05-03 16:59:02 +03:00
Slava Monich
9d220ff9be [sim-auth] Only close open sessions
Session has to be open in order to have a valid session_id
2021-04-26 02:51:15 +03:00
Slava Monich
deefa2c454 [sim-auth] Remove watch if open_channel fails
Otherwise open_channel won't be called again after a failure.
2021-04-26 02:51:15 +03:00
Slava Monich
80224b283d Merge branch 'pcscf' into 'master'
Keep track of P-CSCF address

See merge request mer-core/ofono!281
2021-04-23 12:53:54 +00:00
Slava Monich
07e07b6ddc [ril] Keep track of P-CSCF address. JB#48905
And use IMS data profile for IMS data calls.
2021-04-23 15:14:36 +03:00
Slava Monich
bd836b4499 Merge branch 'misc' into 'master'
Miscellaneous mobile data issues

See merge request mer-core/ofono!280
2021-04-23 12:12:42 +00:00
Slava Monich
6c289b1432 [ril] Do not submit RIL_REQUEST_ALLOW_DATA if it's disabled 2021-04-16 03:13:16 +03:00
Slava Monich
296e46487f [ril] Cancel RIL_REQUEST_ALLOW_DATA when SIM is removed 2021-04-15 20:19:21 +03:00
Slava Monich
09e98234aa [ril] Tweaked network state polling logic
grilio_channel_retry_request() returns FALSE if the request is pending,
i.e. has been submitted but there was no reply yet. In that case, in
order to retry right away, we need to cancel the already submitted
request (and ignore the reply when it arrives) and resubmit a fresh
new one.
2021-04-15 19:40:32 +03:00
Slava Monich
0f4cdba932 [ril] Documented umtsNetworkMode parameter 2021-04-02 20:59:52 +03:00
Slava Monich
870bac93e9 Merge branch 'jb53576' into 'master'
Sumbit a pending request from the DBus queue

See merge request mer-core/ofono!279
2021-03-17 14:58:19 +00:00
Denis Grigorev
246cd4e1d2 [unit] Fix the test for __ofono_dbus_queue_reply_all_error. JB#53576 2021-03-17 16:09:19 +03:00
Denis Grigorev
ca20b65098 [ofono] Sumbit a pending request from the DBus queue. JB#53576
Currently, the DBus queue stops working after an asynchronous request
has been completed while another request is pending. This commit adds
__ofono_dbus_queue_submit_next(), which fires a pending request after
the previous one completes.
2021-03-17 15:51:21 +03:00
Slava Monich
8e35a047da Merge branch 'omp-jb53535' into 'master'
Get rid of unwanted retries on manual network connection

See merge request mer-core/ofono!278
2021-03-12 15:57:59 +00:00
Bogdan Migunov
2b4b5a224d [ril] Get rid of unwanted retries on manual network connection. Fixes JB#53535
There is an issue when network operators return "allowed" flag no matter
which SIM card you are using currently. In that case, when user tries to
manually connect to such networks, it takes too long to have 2 (by
default) retries until device will get back to its home network.
So the solution is not to set additional retries to the
RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL request, as it has been done
in RILJ.
2021-03-12 18:10:50 +03:00
Slava Monich
50a5f2547e Merge branch 'hfp' into 'master'
Register HandsfreeAudioManager straight away at startup

See merge request mer-core/ofono!277
2020-11-19 22:36:22 +00:00
Slava Monich
d682fcd5fe [ofono] Request D-Bus name after initializing all plugins. JB#52107
To ensure that all D-Bus objects which should be available straight
after startup are there when the first incoming D-Bus call arrives.
2020-11-19 20:18:23 +02:00
Slava Monich
5799320480 [ril] Took out erroneous assert 2020-11-19 20:09:35 +02:00
Slava Monich
3eea7c868e [hfp_hf_bluez5] Removed __ofono_handsfree_audio_manager_ calls
Those functions are called by ofono_handsfree_audio_ref/unref which
ensure that initialization is only done once.
2020-11-19 19:20:50 +02:00
Slava Monich
4844fc6cf9 [hfp_ag_bluez5] Register HandsfreeAudioManager straight away at startup. JB#52107
Otherwise it's not clear how the client is supposed to wait for
org.ofono.HandsfreeAudioManager to appear and how to figure out
whether it's ever going to appear.
2020-11-19 17:06:05 +02:00
Juho Hamalainen
6976366051 Merge branch 'jb48911' into 'master'
Don't try to connect HFP AG if bluetooth service is not available.

See merge request mer-core/ofono!276
2020-11-12 08:15:36 +00:00
Juho Hämäläinen
d3d776837b [hfp_ag_bluez5] Don't try to connect if bluetooth service is not available. JB#48911
Trying to connect too soon will result in profile interface registration
failure with timeout error, effectively blocking for dbus timeout (25s
by default).
2020-11-12 10:13:44 +02:00
Slava Monich
f56c8a33b0 Merge branch 'jb50995' into 'master'
[ril] Calculate signal strength based on rsrp value correctly. JB#50995.

See merge request mer-core/ofono!275
2020-09-15 10:46:22 +00:00
Aleksei Berman
ed2f625b8b [ril] Calculate signal strength based on rsrp value correctly. JB#50995.
All the dBm values are converted to qdbm (multiply by 4) but rsrp which
results in incorrect signal strength representation on some devices.
2020-08-28 15:57:33 +03:00
Slava Monich
ed62d38632 Merge branch 'jb50608' into 'master'
[ril] Add config options for cell info update interval. JB#50608

See merge request mer-core/ofono!273
2020-07-27 22:12:17 +00:00
Denis Grigorev
3f433c97c5 [ril] Add config options for cell info update interval. JB#50608 2020-07-28 00:18:52 +03:00
Denis Grigorev
86d8149c79 [ril] Allow setting cell info update period to 0. JB#50608
According to ril.h, a value of 0 means invoke RIL_UNSOL_CELL_INFO_LIST when
any of the reported information changes.
2020-07-27 21:33:03 +03:00
Slava Monich
f3eb9b868b [aarch64] Print PLUGINDIR when compiling. JB#49681
It's not obvious where it actualy comes from, let's have it in the build log.
2020-07-22 14:46:21 +03:00
chriadam
4e067fa827 Merge branch 'jb50214' into 'master'
[ofono] Don't support '.' as a DTMF pause character. Contributes to JB#50214

See merge request mer-core/ofono!271
2020-07-13 00:36:38 +00:00
Chris Adams
2ee5e4c827 [ofono] Don't support '.' as a DTMF pause character. Contributes to JB#50214 2020-07-13 10:35:30 +10:00
Niels Breet
1366e426be Merge branch 'jb49681' into 'master'
[aarch64] Use macros for unitdir. Contributes to JB#49681

See merge request mer-core/ofono!272
2020-07-08 13:19:30 +00:00
Niels Breet
586c9b9262 [aarch64] Use macros for unitdir. Contributes to JB#49681 2020-07-08 13:19:30 +00:00
Slava Monich
83554e071a Merge branch 'cbs_retry' into 'master'
Tweak CBS request retry logic

See merge request mer-core/ofono!270
2020-06-25 21:12:01 +00:00
Slava Monich
dc41c2d003 [ril] Allow CBS PDU arrive from RIL as a plain blob. JB#5761
I swear I've seen such cases!
2020-06-25 20:21:09 +03:00
Slava Monich
550d41ae37 [ril] Tweaked CBS request retry logic. JB#5761
There's no need for RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG, since we
are not using its result anyway. Better just register for notifications
which would simply never arrive if CBS doesn't work at all.

Important requests, however, better be retried on RIL_E_INVALID_STATE.
2020-06-25 20:05:31 +03:00
Slava Monich
60e4246d93 Merge branch 'cbs' into 'master'
Allow the last CBS fragment to be truncated.

See merge request mer-core/ofono!269
2020-06-19 13:18:21 +00:00
Slava Monich
50619607b0 [cbs] Allow the last CBS fragment to be truncated. JB#5761
That does happen in real life.
2020-06-18 11:59:06 +03:00
Slava Monich
98b357f365 Merge branch 'recap' into 'master'
Refactring radio caps code

See merge request mer-core/ofono!261
2020-06-17 16:00:13 +00:00
Denis Grigorev
56c488d10c [ril] Select the best network for LTE. JB#49391
The radio caps manager will not do anything until the roles are assigned
to modems, so data manager must select the modem with highest capabilities
for LTE instead of the first one.
2020-06-17 18:03:40 +03:00
Denis Grigorev
944cd603e8 [ril] Fix typo. JB#49391 2020-06-17 17:52:41 +03:00
Denis Grigorev
77be0d5e98 [ril] Assert the network mode at startup. JB#49391
At startup, the device may have an inconsistency between data and voice
network modes, so it needs to be asserted.
2020-06-17 17:52:15 +03:00
Denis Grigorev
d8dd20092c [ril] Fix a memory leak in ril_plugin_shutdown_slot(). JB#49391 2020-06-17 17:49:11 +03:00
Slava Monich
c7faa21172 [ril] Refactored radio caps code. JB#49391 2020-06-13 13:29:24 +03:00
Slava Monich
98ffc61a03 Merge branch 'oemraw-access' into 'master'
OemRaw access control

See merge request mer-core/ofono!265
2020-06-11 22:08:55 +00:00
Slava Monich
f2b1625872 Merge branch 'scan' into 'master'
Workaround for bogus operator names in network scan

See merge request mer-core/ofono!152
2020-06-11 22:06:17 +00:00
Slava Monich
2d5a22284e Merge branch 'cbs' into 'master'
Fix parsing of NEW_BROADCAST_SMS packet

See merge request mer-core/ofono!268
2020-06-10 21:09:47 +00:00
Slava Monich
9d742180ab [ril] Fixed parsing of NEW_BROADCAST_SMS packet. JB#5761
It's 4-byte length followed by the specified number of bytes
zero-padded to 4-byte boundary. Kind of like a string.
2020-06-10 15:01:59 +03:00
Slava Monich
f8b0ccc1b4 [ril] Workaround for bogus operator names in network scan. JB#49900
Some RILs (e.g. Sony Xperia X, MediaTek) report bogus operator names
in response to QUERY_AVAILABLE_NETWORKS request. We can make user's
life easier by looking up possible operator name in MBPI database
based on MCC and MNC (assuming those are reported correctly) in case
if weirdness is detected.

To turn this feature on, add this to /etc/ofono/ril_subscription.conf
config file:

replaceStrangeOperatorNames=true
2020-06-05 20:15:35 +03:00
Slava Monich
7a54bb8cbe Merge branch 'jb49955' into 'master'
Provide SmsHistory interface for all modems.

See merge request mer-core/ofono!266
2020-05-20 11:04:49 +00:00
Denis Grigorev
56e0923dc3 [ril] Provide SmsHistory interface for all modems. JB#49955
The SmsHistory plugin uses a global variable to determine if it is already
registered. Because of that, Ofono provides org.ofono.SmsHistory only for
the first modem, and SMS delivery notifications do not work on the others.
After this commit is applied, the plugin will be registered for each modem.
2020-05-19 18:30:44 +03:00
Slava Monich
6dfce4b5e9 [ril] Housekeeping 2020-05-15 15:24:03 +03:00
Slava Monich
4ec3568d71 [ril] Added access control for OemRaw interface. JB#49309 2020-05-15 15:22:09 +03:00
Slava Monich
9b2b7127ef [unit] Added test for OemRaw access control. JB#49309 2020-05-15 15:20:35 +03:00
Slava Monich
1053577376 [ofono] Add OemRaw to D-Bus access control framework. JB#49309
Even though it's RIL specific, it makes sense to reuse the
existing access control mechanism.
2020-05-15 15:19:51 +03:00
Slava Monich
22197b5e04 Merge branch 'jb49798' into 'master'
Fix a memory leak on switching an active SIM card

See merge request mer-core/ofono!263
2020-05-05 14:59:51 +00:00
Denis Grigorev
3a358ddc9d [ril] Fix GRilIoTransportSocket object leak. JB#49798 2020-05-05 16:44:37 +03:00
Denis Grigorev
53929f9f1a [ril] Fix RilCellInfo object leak. JB#49798
On some devices RIL requires to reset the modem while switching radio
capabilities. During this procedure all associated objects should be
disposed and replaced by new instances. This patch fixes a memory
leak through RilCellInfo object.
2020-05-05 16:44:24 +03:00
Slava Monich
08bae57a2b Merge branch 'jb49714' into 'master'
Register settings atom as soon as we have IMSI

See merge request mer-core/ofono!262
2020-04-23 09:08:23 +00:00
Slava Monich
1915aeda76 [ril] Register settings atom as soon as we have IMSI. Fixes JB#49714
There's no need to wait for modem to get powered on. This is just a user
setting - if it can't be applied right away, it will be applied later at
appropriate time.
2020-04-23 04:20:28 +03:00
Slava Monich
51bfb17cbc Merge branch 'modem_offline' into 'master'
Take modem offline when ril_modem is deleted

See merge request mer-core/ofono!260
2020-04-01 16:33:23 +00:00
Slava Monich
a83b553032 [ril] Stop repeating requests on RADIO_NOT_AVAILABLE. JB#49471
If the modem is powered off, this error is repeated indefinitely,
causing unnecessary wakeups.
2020-03-30 21:19:40 +03:00
Slava Monich
ec00abd62d [ril] Tweaked power state confirmation logic. JB#49471
Changed ril_radio_confirm_power_on() to send RADIO_POWER request even if
we think that modem is powered on. Some RILs change power state without
letting us know and that's what this function is for - to make sure that
power is on when we think that it's on.
2020-03-29 01:38:58 +02:00
Slava Monich
80924d5787 [ril] Take modem offline when ril_modem is deleted. JB#49471
Also, mobile data need to be disallowed before deleting the modem
object, so that power keep-on request could be submitted before
bringing the modem offline, to keep power on while data call is
being deactivated (if there was one).
2020-03-29 01:34:39 +02:00
Slava Monich
2bdd05aa31 [ril] Fixed ref vs unref mixup.
RilRadioCapsManager was never freed :/

That was leaving 472 bytes in 8 blocks still reachable on exit.
2020-03-20 18:30:40 +02:00
Slava Monich
544f02e5a2 Merge branch 'jb49322' into 'master'
Improve network registration process

See merge request mer-core/ofono!256
2020-03-16 19:05:22 +00:00
Denis Grigorev
6d4638f9bf [ril] Do not trigger automatic PLMN selection if not needed. JB#49322
On some devices SET_NETWORK_SELECTION_AUTOMATIC takes significant time,
because it triggers a complete scan of available PLMNs. If applied, this
commit will make ofono to issue QUERY_NETWORK_SELECTION_MODE first and
check whether the mode actually needs to be changed.
2020-03-16 20:24:14 +03:00
Slava Monich
6584919e9d Merge branch 'configurable-netsel-timeout' into 'master'
Add networkSelectionTimeout config option

See merge request mer-core/ofono!257
2020-03-12 18:48:50 +00:00
Denis Grigorev
34fb44f4eb [ril] Add networkSelectionTimeout config option. JB#49322
On some devices (such as BQ Aquarius NS208) SET_NETWORK_SELECTION_AUTOMATIC
takes a long time and ofono fails with timeout. If applied, this commit
will make network selection timeout configurable.
2020-03-12 18:02:24 +03:00
Slava Monich
c98d2f41c5 Merge branch 'jb49175' into 'master'
Support combinations of device state tracking methods

See merge request mer-core/ofono!255
2020-03-10 13:28:27 +00:00
Slava Monich
b279be4528 [ril] Support combinations of device state tracking methods. JB#49175
In addition to specifying ss, ds or ur method, one can specify a
combination of methods, e.g. ds+ur
2020-03-06 22:02:23 +02:00
Slava Monich
a7912fea39 [ril] Added ril_config_get_mask. JB#49175 2020-03-06 19:25:19 +02:00
Slava Monich
f291cea905 Merge branch 'jb49175' into 'master'
Add a new device state management method

See merge request mer-core/ofono!253
2020-03-05 12:45:13 +00:00
Denis Grigorev
68f7d30b77 [ril] Add a new device state management method. JB#49175
If applied, this commit will add a new ril_devmon implementation which
controls network state updates by sending SET_UNSOLICITED_RESPONSE_FILTER.
This is useful for devices with RIL version >= 15 if they ignore
both SEND_DEVICE_STATE and SEND_SCREEN_STATE requests as some Qualcomm-
based devices do.
2020-03-04 12:19:55 +03:00
Slava Monich
890a2697fe Merge branch 'jb49163' into 'master'
Access control for SIM Toolkit agent

See merge request mer-core/ofono!254
2020-03-03 21:35:16 +00:00
Slava Monich
9568c8449b [ofono] Access control for SIM Toolkit agent. Fixes JB#49163
Non-privileged process will get org.ofono.Error.AccessDenied from
RegisterAgent. Other methods already check that D-Bus call is coming
from a registered agent.
2020-03-03 19:19:47 +02:00
Slava Monich
cf91be9742 Merge branch 'ims_ap' into 'master'
Support for provisioning and configuring IMS access point

See merge request mer-core/ofono!252
2020-02-21 09:24:25 +00:00
Slava Monich
087771dc0f [ril] Allocate context for IMS. JB#48905 2020-02-20 14:56:10 +02:00
Slava Monich
645dfe47e5 [ofono] Support for automatic creation of IMS context. JB#48905
The approach is quite generic, it's up to the driver to configure
contexts that it wants to be created automatically at startup.
2020-02-20 14:56:02 +02:00
Slava Monich
68e8b02d3b [ofono] Added support for provisioning IMS access points. JB#48905 2020-02-20 14:55:52 +02:00
Slava Monich
aa4309e8cb Merge branch 'once' into 'master'
Store one-time data SIM selection

See merge request mer-core/ofono!251
2020-02-13 17:05:02 +00:00
Slava Monich
cb6b24d950 [ofono] Store one-time data SIM selection. JB#48462
This way, automatic choice survives a reboot.
2020-02-13 18:53:32 +03:00
Slava Monich
6d1ab13c74 [ofono] Ignore known deprecation warnings
Apparently, the only way to get rid of "warning: G_ADD_PRIVATE" is to
completely disable all Glib deprecation warnings in the entire file.
G_GNUC_BEGIN/END_IGNORE_DEPRECATIONS macros don't help :/
2020-02-12 20:58:24 +03:00
Slava Monich
45424a3f96 Merge branch 'error55' into 'master'
Workaround for data call status 55

See merge request mer-core/ofono!250
2020-02-12 17:05:43 +00:00
Slava Monich
4f7398e39d [ril] Workaround for data call status 55. JB#40162
With some networks we sometimes start getting error 55 (Multiple
PDN connections for a given APN not allowed) when trying to setup
an LTE data call and this error doesn't go away until we successfully
establish a data call over 3G. Then we can switch back to LTE.
2020-02-11 17:08:01 +03:00
Slava Monich
cd118ce70b [qmimodem] Move lte.c to the right place 2020-02-11 12:51:15 +03:00
Slava Monich
99d4ce538e [ofono] Updated baseline to 1.23. Fixes JB#48840 2020-02-05 17:05:33 +02:00
Slava Monich
9b2c4bcf76 Merge branch 'v1.23' into 'master'
Update baseline to 1.23

See merge request mer-core/ofono!247
2020-02-05 14:59:54 +00:00
Slava Monich
0122db04a3 Revert "[unit] Fixed memory leak in test-simutil"
This reverts commit c04b14c49a.

It conflicts with commit f5971198 cherry-picked from upstream.
2020-02-05 16:10:42 +02:00
Marcel Holtmann
021db194cb Release 1.23 2020-02-05 15:49:23 +02:00
Jonas Bonn
e0a0896205 qmimodem: release DMS service on radio-settings atom removal 2020-02-05 15:49:23 +02:00
Jonas Bonn
49d0bbbb28 qmimodem: release WDS service on GPRS atom removal 2020-02-05 15:49:22 +02:00
Jonas Bonn
9193d06b77 qmimodem: get LTE default bearer APN from modem
When an LTE modem registers with the network, a default bearer is
automatically established.  The APN used for this bearer is taken from
whatever default settings the modem has.

The LTE atom takes cares of setting up the default context/profile with
the APN to use.  From there, a default bearer will be established when
the modem registers with the network.  This results in a call to 'Get
LTE Attach Parameters' which tells us what APN the gateway negotiated
with us.

If we can't get the APN, we do what the AT driver does:  pretend the
bearer wasn't established.  This is a reasonable fallback, currently,
because connman can't handle zero-length APN's anyway; the previous
approach of setting the APN to 'automatic' breaks connman badly when it
needs to switch between LTE and non-LTE networks.
2020-02-05 15:49:22 +02:00
Jonas Bonn
b0cd3e4544 gobi: add LTE atom
This atom needs to be created in post_sim so that the APN can be
written to the default profile before the modem attempts to use the
setting to connect to the network.
2020-02-05 15:49:22 +02:00
Jonas Bonn
29cce6969b qmi: add LTE atom driver
This patch adds an LTE atom for QMI modems.

This atom sets the APN that the LTE default bearer should use when
establishing its PDP context.  This APN needs to be set on the 'default'
profile so the atom queries which profile is the default and resets
it before allowing the APN to be set.

Once configured, the default profile settings are used when the
modem connects to the network; for this reason, the LTE atom needs
to be instantiated in post_sim, before the modem is set online.
2020-02-05 15:49:22 +02:00
Denis Kenzior
b87f666e4b sim-auth: Improve pending cleanup on sim_auth_remove 2020-02-05 15:49:21 +02:00
Denis Kenzior
1c1e4fa28b sim-auth: Do not leak nai
==31530== 88 bytes in 2 blocks are definitely lost in loss record 132 of 186
==31530==    at 0x4C2BF8F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==31530==    by 0x5847B97: vasprintf (in /lib64/libc-2.23.so)
==31530==    by 0x510AE38: g_vasprintf (gprintf.c:316)
==31530==    by 0x50D8BDF: g_strdup_vprintf (gstrfuncs.c:514)
==31530==    by 0x50D8CAA: g_strdup_printf (gstrfuncs.c:540)
==31530==    by 0x4F706B: build_nai (sim-auth.c:660)
==31530==    by 0x4F706B: sim_auth_register (sim-auth.c:738)
==31530==    by 0x4F706B: ofono_sim_auth_create (sim-auth.c:768)
==31530==    by 0x4ACBB4: modem_change_state (modem.c:525)
==31530==    by 0x4AD0CD: sim_state_watch.part.5 (modem.c:720)
==31530==    by 0x4CF6D0: call_state_watches (sim.c:366)
==31530==    by 0x4CF6D0: sim_set_ready (sim.c:1475)
==31530==    by 0x4CF6D0: sim_imsi_obtained (sim.c:1577)
==31530==    by 0x45D868: at_cimi_cb (sim.c:453)
==31530==    by 0x49CB5F: at_chat_finish_command (gatchat.c:459)
==31530==    by 0x49DAC7: at_chat_handle_command_response (gatchat.c:521)
==31530==    by 0x49DAC7: have_line (gatchat.c:600)
==31530==    by 0x49DAC7: new_bytes (gatchat.c:759)
2020-02-05 15:49:03 +02:00
Denis Kenzior
f597119845 unit: Use sim_app_record_free to avoid memleaks 2020-02-05 15:49:03 +02:00
Christophe Ronco
633888932d udevng: Add modem string SystemPath 2020-02-05 15:44:38 +02:00
Christophe Ronco
a37f325d4a modem: Add SystemPath dbus property 2020-02-05 15:44:38 +02:00
Christophe Ronco
0afceac554 doc: Add SystemPath to Modem interface 2020-02-05 15:44:38 +02:00
Philippe De Swert
109751bcc0 doc: add new DialMemory method to VoicecallManager 2020-02-05 15:44:38 +02:00
Denis Kenzior
30dfbf8fd7 hfpmodem: Don't use strcat 2020-02-05 15:44:37 +02:00
Philippe De Swert
c7aab2e790 hfpmodem: Add memory dialling support
Handle the request to dial from a memory index and send the
correct ATD> sequence to make it happen.
2020-02-05 15:44:37 +02:00
Philippe De Swert
412a2a0e7f voicecall: Add memory location dialing
Implement functionality to allow to  dial favourites/quick contacts over
bluetooth.
2020-02-05 15:44:37 +02:00
Philippe De Swert
f1aeedd113 voicecall: Add support for dialing number at a given memory location
Add a new function to be able to dial numbers from memory/favourites.

Conflicts:
	ofono/include/voicecall.h
2020-02-05 15:44:32 +02:00
Philippe De Swert
639fce8eca voicecall: Rename hfp dialing functions
Calling from memory index is very similar in functionality to dialing
the last called number. So we rename the functions so we can reuse them,
to deal with memory index calling. Function names now also reflect this
is for hfp.
2020-02-05 15:34:26 +02:00
Jonas Bonn
9cfd0a195e xmm7modem: drop executable bit from C source file 2020-02-05 15:34:25 +02:00
Slava Monich
cf2d8488cc Merge branch 'dbm' into 'master'
Add signalStrengthRange option

See merge request mer-core/ofono!246
2020-01-22 10:10:44 +00:00
Slava Monich
ab0ac10abd [ril] Added signalStrengthRange option. JB#46086
Allows to tweak conversion of dBm values returned by the modem
into signal strength percentage.
2020-01-21 19:15:52 +02:00
Slava Monich
b2df7de223 Merge branch 'auto-select-data' into 'master'
Add AutoSelectDataSim option.

See merge request mer-core/ofono!245
2020-01-16 18:39:03 +00:00
Slava Monich
b56930a87f [unit] Updated test-sailfish_manager. JB#48462 2020-01-16 03:35:07 +02:00
Slava Monich
f65e8dd5af [ofono] Added AutoSelectDataSim option. JB#48462
To change the default behavior in respect to selecting the data SIM, the
following option can be added to /etc/ofono/main.conf:

[ModemManager]
AutoSelectDataSim=on

And data SIM will be picked automatically if none is selected by the user.
All possible options:

   off = option is off (default)
   once = automatically select data SIM once
   always = make sure that data SIM is always selected

"on" is equivalent to "always"
2020-01-16 03:34:26 +02:00
Slava Monich
f2439243b2 [ofono] ril_config_merge_files => config_merge_files
And moved to the core, to make it usable from RIL independent code.
2019-12-26 15:56:54 +02:00
Slava Monich
93ff644856 [ofono] Added __ofono_set_config_dir() function
Allows to make configuration directory configurable.
Also, useful for unit tests.
2019-12-26 02:35:09 +02:00
Slava Monich
08f8555d51 [packaging] Remove sailfish headers from the ofono-devel
Those symbols are not exported by ofono anyway and can't be
referenced by external plugins. Built-in plugins can pull those
headers directly from the source tree.
2019-12-19 16:51:23 +02:00
Slava Monich
04b2a9b0f9 Merge branch 'ecclist' into 'master'
Add support for MediaTek specific ril.ecclist syntax

See merge request mer-core/ofono!244
2019-11-25 11:26:17 +00:00
Slava Monich
4d513b68d2 [unit] Added unit test for ril_ecclist. JB#47953 2019-11-22 20:03:40 +02:00
Slava Monich
36f971dc78 [ril] Support MTK specific ril.ecclist syntax. JB#47953
Some MediaTek adaptations use semicolon as a separator between
comma-separated phone number/service category pairs, e.g.

  112,31;911,31;112,-1;911,-1
2019-11-22 20:03:24 +02:00
Slava Monich
8ba2d96cff [ril] Hosekeeping
gcc 8.3 noticed this:

ril_data.c: In function 'ril_data_call_list_equal':
ril_data.c:437:19: warning: self-comparison always evaluates to true [-Wtautological-compare]
    if (l1->version == l1->version && l1->num == l2->num) {
                    ^~
2019-11-22 19:51:38 +02:00
Slava Monich
a76f50be67 Merge branch 'vendor_signal' into 'master'
Add vendor-specific parsing of SIGNAL_STRENGTH messages

See merge request mer-core/ofono!242
2019-10-31 14:18:45 +00:00
Slava Monich
43227086c0 [ril] Added vendor-specific parsing of SIGNAL_STRENGTH messages. JB#47880
MediaTek loves inventing non-standard message formats.
2019-10-25 15:48:07 +03:00
Slava Monich
e40811fbc6 Merge branch 'gsm_when_radio_off' into 'master'
Add forceGsmWhenRadioOff config option

On some phones (such as Jolla C), even if the slot which has been
using LTE gets powered off, we still need to explicitly set its
preferred mode to GSM, to make LTE machinery available to the other
slot.

Some RILs don't like it when we do this.

See merge request mer-core/ofono!241
2019-10-21 10:27:29 +00:00
Slava Monich
8c543b054a [ril] Added forceGsmWhenRadioOff config option. JB#47747
On some phones (such as Jolla C), even if the slot which has been
using LTE gets powered off, we still need to explicitly set its
preferred mode to GSM, to make LTE machinery available to the other
slot.

Some RILs don't like it when we do this.
2019-10-16 16:48:19 +03:00
Slava Monich
53233b4dc8 Merge branch 'force-gsm' into 'master'
Add ForceGsmForNonDataSlots configuration option

See merge request mer-core/ofono!239
2019-10-10 21:09:01 +00:00
Slava Monich
4458fbf844 Merge branch 'simfs-crash' into 'master'
[ofono] Fix simfs crash. JB#47678

See merge request mer-core/ofono!240
2019-10-11 00:06:36 +03:00
Denis Kenzior
542a086d93 simfs: Fix crash in sim_fs_op_free
If an operation is in progress and an operation is canceled, we don't
actually destroy it, but simply clear out the callback.  In the case of
a context being destroyed, the operation is left on the simfs op_q with
a dangling pointer to the already freed context.  So the current logic
in sim_fs_op_free tries to access invalid memory.

Fix this by performing the watch operations in sim_fs_end_current
instead and setting the context pointer appropriately.
2019-10-10 13:17:46 +03:00
Denis Kenzior
1176662a81 simfs: Fix crash
0  0x00007ffff7b20517 in g_queue_is_empty () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
1  0x00005555556adcdd in sim_fs_op_free (pointer=0x5555559cb990) at src/simfs.c:101
2  0x00007ffff7b205fc in g_queue_foreach () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
3  0x00007ffff7b2065b in g_queue_free_full () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
4  0x00005555556add81 in sim_fs_free (fs=0x5555559c0780) at src/simfs.c:125
5  0x00005555556828f3 in sim_remove (atom=0x5555559cb000) at src/sim.c:3175
6  0x000055555564f16f in flush_atoms (modem=0x555555a8fb00, new_state=MODEM_STATE_POWER_OFF) at src/modem.c:432
7  0x000055555564f3bd in modem_change_state (modem=0x555555a8fb00, new_state=MODEM_STATE_POWER_OFF)
    at src/modem.c:510
8  0x000055555564ff99 in set_powered (modem=0x555555a8fb00, powered=0) at src/modem.c:896
9  0x000055555565074c in modem_set_property (conn=0x55555596c8d0, msg=0x55555596e460, data=0x555555a8fb00)
    at src/modem.c:1120
2019-10-10 13:17:37 +03:00
Slava Monich
ae29a08a76 [ril] Added ForceGsmForNonDataSlots configuration option. JB#47663
By default, ril plugin would force GSM-only mode for non-data SIM.
This option allows to change that behavior.
2019-10-08 18:25:41 +03:00
Slava Monich
af1a569430 Merge branch 'jb36701' into 'master'
Report USSD request errors to the core

See merge request mer-core/ofono!238
2019-10-04 13:39:26 +00:00
Slava Monich
a75558031b [ril] Report USSD errors to the core. JB#36701 2019-10-04 12:09:18 +03:00
Slava Monich
139fff2e5d Merge branch 't8_pin' into 'master'
Fail PIN entry on receiving PASSWORD_INCORRECT

See merge request mer-core/ofono!237
2019-09-27 23:00:53 +00:00
Slava Monich
12614d377a [ril] Fail PIN entry on receiving PASSWORD_INCORRECT. Fixes JB#47494
There's no need to wait for anything in this case.

Also, call ofono_sim_initialized_notify() when completing pin entry
in ril_sim_pin_change_state_cb() to let the core know that we are
ready to accept further requests.
2019-09-26 20:21:59 +03:00
Slava Monich
463f4f183e Merge branch 'pin_recheck' into 'master'
Call ofono_sim_initialized_notify() earlier

See merge request mer-core/ofono!236
2019-09-25 20:04:47 +00:00
Slava Monich
0ba7505f1e [ril] Call ofono_sim_initialized_notify() before unlock. JB#47474
This way PIN retry count gets rechecked after each PIN entry, not
just after the successful one.
2019-09-25 17:09:34 +03:00
Slava Monich
c1156320ac [ril] Map RADIO_TECH_LTE_CA to ACCESS_TECHNOLOGY_EUTRAN 2019-09-25 14:57:12 +03:00
Slava Monich
afe4fc66f0 Merge branch 'fix_1.22' into 'master'
Follow-up to 1.22 update

See merge request mer-core/ofono!235
2019-09-24 14:59:23 +00:00
Slava Monich
c04b14c49a [unit] Fixed memory leak in test-simutil
==7578==    at 0x4C2AB80: malloc
==7578==    by 0x4E856D0: g_malloc
==7578==    by 0x4E9B2ED: g_slice_alloc
==7578==    by 0x4E9C0C5: g_slist_prepend
==7578==    by 0x40EC77: sim_parse_app_template_entries (simutil.c:1604)
==7578==    by 0x405AF6: test_application_entry_decode (test-simutil.c:487)
==7578==    by 0x4EA3D05: g_test_run_suite_internal
==7578==    by 0x4EA405A: g_test_run_suite
==7578==    by 0x4EA4090: g_test_run
==7578==    by 0x40714E: main (test-simutil.c:655)
2019-09-24 17:48:25 +03:00
Slava Monich
4d6aefcea5 [unit] Fixed memory leak in test-sms-root
==7219== 852 (16 direct, 836 indirect) bytes in 1 blocks are definitely lost in loss record 28 of 31
==7219==    at 0x4C2AB80: malloc
==7219==    by 0x4E856D0: g_malloc
==7219==    by 0x4E9B2ED: g_slice_alloc
==7219==    by 0x4E9C0C5: g_slist_prepend
==7219==    by 0x40EC05: sms_assembly_add_fragment_backup (smsutil.c:2666)
==7219==    by 0x40E0A3: sms_assembly_load (smsutil.c:2463)
==7219==    by 0x40E67D: sms_assembly_new (smsutil.c:2550)
==7219==    by 0x402C41: test_serialize_assembly (test-sms-root.c:104)
==7219==    by 0x4EA3D05: g_test_run_suite_internal
==7219==    by 0x4EA405A: g_test_run_suite
==7219==    by 0x4EA4090: g_test_run
2019-09-24 17:48:25 +03:00
Slava Monich
c3c4b21c32 [unit] Fixed memory leak in test-sms
==5231== 284 (16 direct, 268 indirect) bytes in 1 blocks are definitely lost in loss record 107 of 111
==5231==    at 0x4C2AB80: malloc
==5231==    by 0x4E856D0: g_malloc
==5231==    by 0x4E9B2ED: g_slice_alloc
==5231==    by 0x4E9C0C5: g_slist_prepend
==5231==    by 0x417E9C: sms_assembly_add_fragment_backup (smsutil.c:2666)
==5231==    by 0x417AE8: sms_assembly_add_fragment (smsutil.c:2580)
==5231==    by 0x40B70E: test_decode_unicode (test-sms.c:1836)
==5231==    by 0x4EA3D05: g_test_run_suite_internal
==5231==    by 0x4EA405A: g_test_run_suite
==5231==    by 0x4EA4090: g_test_run
==5231==    by 0x40C100: main (test-sms.c:1950)
==5231==
==5231== 284 (16 direct, 268 indirect) bytes in 1 blocks are definitely lost in loss record 108 of 111
==5231==    at 0x4C2AB80: malloc
==5231==    by 0x4E856D0: g_malloc
==5231==    by 0x4E9B2ED: g_slice_alloc
==5231==    by 0x4E9C0C5: g_slist_prepend
==5231==    by 0x417E9C: sms_assembly_add_fragment_backup (smsutil.c:2666)
==5231==    by 0x417AE8: sms_assembly_add_fragment (smsutil.c:2580)
==5231==    by 0x40BACA: test_decode_unicode (test-sms.c:1857)
==5231==    by 0x4EA3D05: g_test_run_suite_internal
==5231==    by 0x4EA405A: g_test_run_suite
==5231==    by 0x4EA4090: g_test_run
==5231==    by 0x40C100: main (test-sms.c:1950)
2019-09-24 17:48:25 +03:00
Slava Monich
5ffc3fc426 [simutil] Fix memory leak. JB#47380
==16702== 6 bytes in 1 blocks are definitely lost in loss record 5 of 63
==16702==    at 0x4C2AB80: malloc
==16702==    by 0x405782: convert_gsm_to_utf8_with_lang (util.c:651)
==16702==    by 0x4058F0: convert_gsm_to_utf8 (util.c:690)
==16702==    by 0x408606: sim_network_name_parse (simutil.c:801)
==16702==    by 0x408D32: sim_eons_add_pnn_record (simutil.c:1024)
==16702==    by 0x403A10: test_eons (test-simutil.c:377)
==16702==    by 0x4EA3D05: g_test_run_suite_internal
==16702==    by 0x4EA405A: g_test_run_suite
==16702==    by 0x4EA4090: g_test_run
==16702==    by 0x40522E: main (test-simutil.c:655)
2019-09-24 17:48:00 +03:00
Denis Kenzior
690d62820a sim: Do not leak aid_list
==31530== 366 (48 direct, 318 indirect) bytes in 3 blocks are definitely lost in loss record 165 of 186
==31530==    at 0x4C2BF8F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==31530==    by 0x50BB3A3: g_malloc (gmem.c:94)
==31530==    by 0x50D62B4: g_slice_alloc (gslice.c:1025)
==31530==    by 0x50D7A1E: g_slist_prepend (gslist.c:254)
==31530==    by 0x4DD0B3: sim_parse_app_template_entries (simutil.c:1590)
==31530==    by 0x4D2242: discover_apps_cb (sim.c:1509)
==31530==    by 0x45E364: at_discover_apps_cb (sim.c:1579)
==31530==    by 0x49CB5F: at_chat_finish_command (gatchat.c:459)
==31530==    by 0x49DAC7: at_chat_handle_command_response (gatchat.c:521)
==31530==    by 0x49DAC7: have_line (gatchat.c:600)
==31530==    by 0x49DAC7: new_bytes (gatchat.c:759)
==31530==    by 0x49FCEF: received_data (gatio.c:122)
==31530==    by 0x510C2F3: g_io_unix_dispatch (giounix.c:165)
==31530==    by 0x50B2D44: g_main_dispatch (gmain.c:3203)
2019-09-24 17:35:34 +03:00
Denis Kenzior
f1fbd04d66 sim: Fix crash
aid_sessions was not properly reset to NULL when freed:

Program received signal SIGSEGV, Segmentation fault.
__ofono_watchlist_free (watchlist=0x0) at src/watch.c:91
91		for (l = watchlist->items; l; l = l->next) {
(gdb) bt
    func=0x4ceca0 <aid_session_free>, user_data=0x0)
    at /var/tmp/portage/dev-libs/glib-2.50.3-r1/work/glib-2.50.3/glib/gslist.c:878
    free_func=0x4ceca0 <aid_session_free>)
    at /var/tmp/portage/dev-libs/glib-2.50.3-r1/work/glib-2.50.3/glib/gslist.c:172
    at src/sim.c:2605
    user_data=<optimized out>) at plugins/phonesim.c:511
    func=0x49c8a0 <at_notify_call_callback>, user_data=0x7fffffffdbc0)
    at /var/tmp/portage/dev-libs/glib-2.50.3-r1/work/glib-2.50.3/glib/gslist.c:878
    chat=0x7b70b0) at gatchat/gatchat.c:417
2019-09-24 17:35:33 +03:00
James Prestwood
8eaf694b9a simutil: fix bug when parsing AID type 2019-09-24 17:35:00 +03:00
Denis Kenzior
5087fd9dd7 simutil: Add sim_app_record free 2019-09-24 17:34:59 +03:00
Slava Monich
92aebc3ce8 [rpm] Bump version to 1.22 2019-09-24 13:57:29 +03:00
Slava Monich
c0a5b0fdf3 Merge branch 'v1.22' into 'master'
Update baseline to 1.22

See merge request mer-core/ofono!234
2019-09-24 10:51:45 +00:00
Slava Monich
587879b6c2 [voicecall-filter] Fixed memory leaks
==16709== 16 bytes in 1 blocks are definitely lost in loss record 139 of 377
==16709==    at 0x4C2AB80: malloc
==16709==    by 0x52966D0: g_malloc
==16709==    by 0x52AC2ED: g_slice_alloc
==16709==    by 0x52AD625: g_slist_append
==16709==    by 0x4049E9: voicecall_filter_request_init (voicecall-filter.c:81)
==16709==    by 0x404FE8: voicecall_filter_request_dial_new (voicecall-filter.c:315)
==16709==    by 0x4055D2: __ofono_voicecall_filter_chain_dial (voicecall-filter.c:556)
==16709==    by 0x403C5B: test_cancel1 (test-voicecall-filter.c:899)
==16709==    by 0x52B4D05: g_test_run_suite_internal
==16709==    by 0x52B505A: g_test_run_suite
==16709==    by 0x52B5090: g_test_run

==16709== 88 (16 direct, 72 indirect) bytes in 1 blocks are definitely lost in loss record 289 of 377
==16709==    at 0x4C2AB80: malloc
==16709==    by 0x52966D0: g_malloc
==16709==    by 0x52AC2ED: g_slice_alloc
==16709==    by 0x52AD625: g_slist_append
==16709==    by 0x4049E9: voicecall_filter_request_init (voicecall-filter.c:81)
==16709==    by 0x40533E: voicecall_filter_request_incoming_new (voicecall-filter.c:446)
==16709==    by 0x40571F: __ofono_voicecall_filter_chain_incoming (voicecall-filter.c:598)
==16709==    by 0x403AA7: test_restart (test-voicecall-filter.c:855)
==16709==    by 0x52B4D05: g_test_run_suite_internal
==16709==    by 0x52B505A: g_test_run_suite
==16709==    by 0x52B5090: g_test_run
2019-09-24 12:58:57 +03:00
Slava Monich
f9ca5c30a6 [ofono] Updated baseline to 1.22. Fixes JB#47380 2019-09-20 19:12:48 +03:00
Slava Monich
3f9dff449f [voicecall] Moved new callback to the end of the driver structure
This is part of plugin API which must be kept backward compatible.
2019-09-20 19:11:52 +03:00
Slava Monich
d554061955 [ril] Added missing ofono_sim_initialized_notify() call. JB#47380
It's a new API appeared in ofono 1.22
2019-09-20 17:47:08 +03:00
Slava Monich
3ae306ed57 Fix build
include/storage.h was mentioned twice in Makefile.am
2019-09-19 19:45:42 +03:00
Slava Monich
6448c0c270 [unit] Added tests for __ofono_dbus_queue_reply_all_error() 2019-09-19 19:38:46 +03:00
Slava Monich
e521938d95 [dbus-queue] Added __ofono_dbus_queue_reply_all_error() 2019-09-19 19:38:23 +03:00
Slava Monich
80158ea5bc simfs: Add missing sim_fs_read_info_cb_t 2019-09-19 18:37:33 +03:00
Marcel Holtmann
bfba3e2312 Release 1.22 2019-09-19 18:35:25 +03:00
Denis Kenzior
e4fc7b9b0c simutil: Fix copiler warning
src/simutil.c:1573:3: warning: dereferencing type-punned pointer will break
strict-aliasing rules [-Wstrict-aliasing]
	app.type = GUINT16_FROM_BE(*((unsigned short *)(app.aid + 5)));
2019-09-19 18:35:25 +03:00
James Prestwood
f1ec346941 unit: fix test-simutil failure
A fixup was made in simauth to fix the AUTS length
and the simutil unit test was never updated to reflect
the length change.
2019-09-19 18:35:25 +03:00
Alexander Couzens
9f9bb11a66 qmi: add USSD support for MO services 2019-09-19 18:34:53 +03:00
Denis Kenzior
cf3143bb69 build: Add voice.h to qmi_sources 2019-09-19 18:34:53 +03:00
Alexander Couzens
56f46a80c0 add qmimodem/voice.h to add USSD defines
USSD is part of the QMI voice service.
2019-09-19 18:34:53 +03:00
Philippe De Swert
6fb02515f0 voicecall: Fix issue with invalid dbus path
Fix an error message from dbus about the path supplied not being valid.
Related to commit f58e7685b0078df470300b99cd89fb9b3c45d1c0

ofonod[19107]: src/voicecall.c:voicecall_dial_shortcut() check position
ofonod[19107]: src/voicecall.c:synthesize_outgoing_call() Registering new call: 1
process 19107: arguments to dbus_message_iter_append_basic() were incorrect, assertion "_dbus_check_is_valid_path (*string_p)" failed in file ../../../dbus/dbus-message.c line 2759.
This is normally a bug in some application using the D-Bus library.
2019-09-19 18:34:23 +03:00
Alexander Couzens
4efb502fad qmimodem: convert register_net_cb errors into CMEs
Certain modems doesn't support manual registering (gobi 2000).
Translate the error code into ofono error to report a
more detailed debug error message.
2019-09-19 18:34:23 +03:00
Alexander Couzens
842331f701 qmimodem: add translator qmi_error_to_ofono_cme()
Translates qmi error codes into ofono cme errors
2019-09-19 18:34:23 +03:00
Alexander Couzens
f743c89bc8 qmimodem: add define CALLBACK_WITH_CME_ERROR(cb, err, args..) 2019-09-19 18:34:23 +03:00
Alexander Couzens
20d9835aed network: allow drivers to generate more specific error codes
For certain modems it's not clear if they support all actions or not.
In such cases use CME errors which allows generate NotSupported
messages.

Conflicts:
	ofono/src/network.c
2019-09-19 18:34:20 +03:00
Alexander Couzens
f4c24f5f83 plugins/gobi: reset the qmi interface when enabling the modem 2019-09-19 18:17:42 +03:00
Alexander Couzens
6c07b110c7 qmi: implement the control sync command
The sync command resets the QMI interface state. It will flushs all
previous assigned sessions and transactions.
2019-09-19 18:17:42 +03:00
Alexander Couzens
6205fad90f qmi: include the CTL in the debug output
The CTL version is important for certain calls. This is
a useful information for debugging.
2019-09-19 18:17:42 +03:00
Alexander Couzens
9b7358e5e5 qmi/discovery: remove useless code 2019-09-19 18:17:42 +03:00
Slava Monich
502cd55c4e sim-auth: Avoid using dbus_message_iter_get_element_count
It's the only thing in ofono that requires dbus 1.9.16 or later and it's
not worth it.

And don't leak DBusMessage on format error.
2019-09-19 18:17:42 +03:00
Slava Monich
103b20bcfd include: Add storage.h
To expose ofono directories to dynamically loadable plugins.
2019-09-19 18:17:08 +03:00
Denis Kenzior
8b083e0121 mbimmodem: fix crash
==12340== Invalid read of size 1
==12340==    at 0x4C2F9A0: __strncpy_sse2_unaligned (vg_replace_strmem.c:548)
==12340==    by 0x4A3520: strncpy (string3.h:126)
==12340==    by 0x4A3520: mbim_current_operator_cb (network-registration.c:178)
==12340==    by 0x49DC5D: dispatch_command_done (mbim.c:529)
==12340==    by 0x49DC5D: dispatch_message (mbim.c:594)
==12340==    by 0x49DC5D: command_read_handler (mbim.c:701)
2019-09-19 18:08:31 +03:00
Denis Kenzior
8b1fc771ea unit: Add ip configuration query sanity check 2019-09-19 18:08:31 +03:00
Denis Kenzior
7bb19531cd mbim: Keep track of max_sessions
Also set the CID range 0..max sessions.  This forces the default context
into cid 0
2019-09-19 18:08:31 +03:00
Denis Kenzior
252df1349a test: Fix up process-context-settings 2019-09-19 18:08:31 +03:00
Denis Kenzior
5a2d64371c include: add ofono_gprs_context_set_ipv4_prefix_length
This is a short-hand version of using set_ipv4_netmask
2019-09-19 18:08:31 +03:00
Denis Kenzior
6995849600 mbimmodem: Add provisioned context query (debug only) 2019-09-19 18:08:31 +03:00
Denis Kenzior
69149b3039 unit: Add mbim packet service notification test 2019-09-19 18:08:31 +03:00
Denis Kenzior
77eb51bc39 mbim: Instantiate gprs-context atom 2019-09-19 18:08:31 +03:00
Denis Kenzior
d05b1137d5 mbimmodem: Add gprs-context driver 2019-09-19 18:08:31 +03:00
Denis Kenzior
9eae00b28b mbim: Add IPv4/v6 Element & Address extractors
The IP Configuration data structure does not match any of the existing
data structure serialization conventions in the rest of the MBIM
specification.  So add IPv4 / v6 specific extractors for IPV4 address
and IPV4 Element structures.
2019-09-19 18:08:31 +03:00
Denis Kenzior
48a6492a68 gprs: Add implementation of set_ipv4_prefix_length 2019-09-19 18:08:31 +03:00
Denis Kenzior
443898d8ef mbim: Add mbim context type UUIDs 2019-09-19 18:08:31 +03:00
Denis Kenzior
23718794cc mbim: Add gprs atom 2019-09-19 18:08:31 +03:00
Denis Kenzior
450c5f9b69 gprs: Set Attached if no .read_settings
Some protocols (like MBIM) do not properly support default bearer
semantics.  Instead they want everything to function like UMTS/GSM where
the context has to be explicitly attached / activated.
2019-09-19 18:07:54 +03:00
Denis Kenzior
4f6b8b7243 mbimmodem: Add GPRS atom driver 2019-09-19 17:56:07 +03:00
Denis Kenzior
3eec92ec7a mbim: Properly write values in little endian format 2019-09-19 17:56:07 +03:00
Denis Kenzior
4216026a7c mbim: Add support for 64-bit integers 2019-09-19 17:56:07 +03:00
James Prestwood
9eb2820397 plugins: updated plugins using simauth module
The simauth creation API changed to not take the driver structure
2019-09-19 17:56:07 +03:00
James Prestwood
f33550f37f simauth: remove driver code from core simauth atom 2019-09-19 17:56:07 +03:00
James Prestwood
020dc3020e simauth: remove driver API definitions from simauth include 2019-09-19 17:56:07 +03:00
Denis Kenzior
ad0b9e6303 mbimmodem: Move available_data_classes_to_tech
to util.[ch] so it can be used from other drivers
2019-09-19 17:56:07 +03:00
Denis Kenzior
d773d28dad mbim: Silence unused variable warning 2019-09-19 17:56:07 +03:00
James Prestwood
4d9fea27ea atmodem: removed simauth.c from atmodem 2019-09-19 17:56:07 +03:00
James Prestwood
c4a8186f7a make: remove atmodem simauth driver 2019-09-19 17:56:07 +03:00
James Prestwood
2c5f1a6626 atmodem: removed simauth init 2019-09-19 17:56:07 +03:00
Denis Kenzior
dcb057802f atmodem: Rework at_pin_send_cb
Instead of delaying the cpin entry callback until the sim is found to be
'ready', call back into the core right away.  The core will wait until
the initialized notification is called from the driver before proceeding
with the rest of the initialization procedure.

The sim state query is now being done in the background and potential
leaking of cbd is now fixed.
2019-09-19 17:56:07 +03:00
Denis Kenzior
fd889b3fac xmm7xxx: Use sim_initialized_notify 2019-09-19 17:56:07 +03:00
Denis Kenzior
fe3f46f29b ifx: Use sim_initialized_notify 2019-09-19 17:56:07 +03:00
Denis Kenzior
b8eae5f967 atmodem: Remove XSIM handling from sim driver
This will be covered by ifx/xmm7xxx modem drivers using
sim_initialized_notify
2019-09-19 17:56:07 +03:00
Denis Kenzior
d818544d92 telit: signal sim initialized 2019-09-19 17:56:07 +03:00
Denis Kenzior
dc1377eb0a sim: Remove QSS handling
The telit plugin will use sim_initialized_notify instead
2019-09-19 17:56:07 +03:00
Denis Kenzior
06599ff36d ste: signal sim initialized on EPEV 2019-09-19 17:56:07 +03:00
Denis Kenzior
4d2ef8b2da mbm: Signal sim initialized on EPEV 2019-09-19 17:56:07 +03:00
Denis Kenzior
cc7f5796bb atmodem: Remove EPEV handling
This will be moved to ste & mbm modem drivers
2019-09-19 17:56:07 +03:00
Denis Kenzior
65d2b1306a mbim: Set the subscribe list
Some devices don't seem to enable incoming SMS notifications.  So set
the notifications we're interested in at modem startup.
2019-09-19 17:56:07 +03:00
Denis Kenzior
b484003494 unit: Add Device Subscribe List set build test 2019-09-19 17:56:07 +03:00
Denis Kenzior
8a6ec5e645 mbim: Support variable struct signatures in arrays
DEVICE_SUBSCRIBE_LIST uses an array of structures.  The structure
contains the UUID of the service and then a variable number of CIDs that
are enabled.
2019-09-19 17:56:07 +03:00
Denis Kenzior
fdc4b27b05 mbim: Add sms atom 2019-09-19 17:56:07 +03:00
Denis Kenzior
9b338c4055 mbimmodem: Add SMS atom 2019-09-19 17:56:06 +03:00
Denis Kenzior
fbaf86d862 unit: Add SMS Send parse test 2019-09-19 17:56:06 +03:00
Denis Kenzior
d5c6316a13 mbim: Support embedded databuffers
SMS_SEND uses an embedded databuffer inside MBIM_SET_SMS_SEND which
wants to use a local offset (local to the databuffer structure) as
opposed to the offset from the start of the static buffer.
2019-09-19 17:56:06 +03:00
Denis Kenzior
bf092b518c mbim: Fix incorrectly generating arrays 2019-09-19 17:56:06 +03:00
Denis Kenzior
9de95af924 unit: Add SMS Read response tests 2019-09-19 17:56:06 +03:00
Denis Kenzior
5988c88968 unit: Fix fragmenting messages < frag_size 2019-09-19 17:56:06 +03:00
Denis Kenzior
354793cbe3 mbim: Add additional sanity checking
For zero element arrays we might inadvertently run past the end of the
iov buffer.  Fix this by adding additional checks that n_elem > 0 and
don't call _iter_get_data unless needed.
2019-09-19 17:56:06 +03:00
Denis Kenzior
259c6e2617 mbim: Support appending byte arrays 2019-09-19 17:56:06 +03:00
Denis Kenzior
aa88654d09 mbim: Fix iterator advance logic 2019-09-19 17:56:06 +03:00
Denis Kenzior
50499bc69d mbim: Turn radio off before disabling 2019-09-19 17:56:06 +03:00
Denis Kenzior
8c64f94743 mbim: Add netreg atom 2019-09-19 17:56:06 +03:00
Denis Kenzior
0eabc3ea79 mbimmodem: Add netreg driver 2019-09-19 17:56:06 +03:00
Denis Kenzior
8116bd13d1 mbim: Add MBIM_DATA_CLASS enum 2019-09-19 17:56:06 +03:00
Denis Kenzior
30bbccfd91 udevng: Save off MBIM modem's VID/PID 2019-09-19 17:56:06 +03:00
Denis Kenzior
028a6ab1c7 sim: Remove stale comment 2019-09-19 17:56:06 +03:00
Denis Kenzior
32607771b5 mbimmodem: Support PIN/PUK operations 2019-09-19 17:56:06 +03:00
Denis Kenzior
d37dfc1ad1 sim: Introduce ofono_sim_initialized_notify
This change is likely to break multiple drivers.  One can easily emulate
the current behavior (pre-this commit) by calling
ofono_sim_initialized_notify after ofono_sim_inserted_notify.
2019-09-19 17:56:06 +03:00
Denis Kenzior
e0bfba6fbe include: Introduce ofono_sim_initialized_notify 2019-09-19 17:56:00 +03:00
Denis Kenzior
414791a6f0 mbim: Fix comment typo 2019-09-19 17:36:18 +03:00
Denis Kenzior
3fa059a027 mbim: Add support for registering to notifications 2019-09-19 17:36:18 +03:00
Denis Kenzior
540b558147 sim: Compact all booleans into the bitfield 2019-09-19 17:36:18 +03:00
Denis Kenzior
6bfb0d07ab sim: Use gcc's bitfield instead of managing flags 2019-09-19 17:36:18 +03:00
Denis Kenzior
19a8a137c1 hfpmodem: Make sure to NULL terminate 2019-09-19 17:36:18 +03:00
James Prestwood
11913b2a44 simauth: use new sim atom functionality for simauth
All the functionality for the simauth driver was moved
into the sim atom. This patch transitions the simauth
atom to using those API's instead of the simauth driver
API's.

With this change it made more sense to store each AID
as its own object structure so the AID and object path
could be re-used rather than generating it on the fly.

Renamed the simauth 'sim' variable to 'sa' to keep it
consistent now that the simauth structure references
the sim atom as 'sim'.
2019-09-19 17:36:18 +03:00
James Prestwood
2a1e29ab9e atmodem: implemented logical access driver API
This moves the logical access API from the simauth
driver to the sim atmodem driver.
2019-09-19 17:36:18 +03:00
James Prestwood
a64cc4d5b9 sim: logical access API implementation
Implemented wrapper for the sim drivers logical
access API
2019-09-19 17:36:17 +03:00
James Prestwood
f464a7c6c1 sim: logical access API
Moved logical access API from simauth to sim atom. This removes
the need for a simauth driver completely, as the rest of the
functionality was moved in previous commits.
2019-09-19 17:36:17 +03:00
Denis Kenzior
daceb07bb1 atmodem: Disambiguate simcom/cinterion spic use 2019-09-19 17:36:17 +03:00
Denis Kenzior
f9ef31cd5c AUTHORS: Mention Gabriel's contributions 2019-09-19 17:36:17 +03:00
Gabriel Lucas
c3c3bab6a2 gemalto: add PIN retries support in plugin
In SimManager, the Retries property isn't used for gemalto modems.
The at command AT^SPIC is used to get the remaining retries left
for the current required password type.

This commit enable the use of the driver in the gemalto plugin
2019-09-19 17:36:17 +03:00
Gabriel Lucas
08f0bb08f1 gemalto: add PIN retries support in driver
In SimManager, the Retries property isn't used for gemalto modems.
The at command AT^SPIC is used to get the remaining retries left
for the current required password type.

This commit adds the implementation in the SIM driver of the retries
queries.
2019-09-19 17:36:17 +03:00
James Prestwood
ce2b18ede2 sim: added ImsPrivateIdentity to SimManager
If the ISIM AID is found a new AID based context will be
created and the EFIMPI file will be read from the SIM
which contains the ImsPrivateIdentity.
2019-09-19 17:36:17 +03:00
James Prestwood
5f9e43c2da docs: ImsPrivateIdentity property documentation 2019-09-19 17:36:17 +03:00
James Prestwood
2ee038a457 sim: implement create ISIM context
API to create a sim context for the ISIM application, if found.
During AID discovery, if an ISIM AID is found, a new fs object is
initialized for the ISIM which will be used for any future
ISIM context creation.
2019-09-19 17:36:17 +03:00
James Prestwood
3a4f63171f sim: header definitions for ISIM context API
This will allow an atom to create a SIM context to an ISIM
AID (if available). It is then possible to access EF's on the
ISIM using this SIM context.
2019-09-19 17:36:17 +03:00
James Prestwood
64878cced6 simfs: read files from specific AID's
The simfs atom could not read EF's that did not exist on the
'default' ADF directory. This implements a new way to read EF's
that exist on a given AID. A new fs object/context can be
initialized for a given AID. Using this fs context with
the existing read file API will read from that AID rather than
the default ADF.
2019-09-19 17:36:17 +03:00
James Prestwood
3f115b2d0d atmodem: implement new driver APIs for AID sessions
Implementation for open/close channel, list applications,
and session based file read.
2019-09-19 17:36:17 +03:00
James Prestwood
c66eec1b1e atmodem: helper for appending the file path to a command
Several file read API's were re-using the same code to append
a file path. This code was moved into a helper API.
2019-09-19 17:36:17 +03:00
James Prestwood
85d1eda7c9 sim: AID session management
Accessing an AID requires opening a channel to that application.
This patch implements session management API's so that other atoms
can access a given AID. Now any atom can get a session ID from the
sim atom. This will either reuse an existing session or open a new
channel. Once done, the atom should release the session which will
automatically close the channel when no atoms are using it.

The major functional change to the sim atom is the AID discovery
phase of initialization. Now, the sim atom is not 'ready' until AID
discovery finishes where before, the sim was 'ready' after the IMSI
had been obtained. If application discovery is not supported then
the the sim atom behaves as it did before.
2019-09-19 17:36:10 +03:00
James Prestwood
08d8d5de73 include: Add sim ops for session based sim access
ISIM and newer AID's require opening a logical channel to read
their EF's. This requires new driver API's to discover AID's,
open/close a channel, and reading the EF's from an opened channel.

This functionality was moved from the simauth module.
2019-09-19 17:32:40 +03:00
Denis Kenzior
172c97df83 AUTHORS: Mention Philippe's contributions 2019-09-19 17:32:40 +03:00
Philippe De Swert
1e3e413714 doc: Document the new DialLast voicecallmanager API addition
The new DialLast method to call the last dialled number for HFP needs
to be added to the documentation.
2019-09-19 17:32:40 +03:00
Philippe De Swert
15ef3c9c0e hfpmodem: Send last call dialled request
Handle the last call dialled request and send the required AT+BDLN command
for bluetooth HFP profile.
2019-09-19 17:32:40 +03:00
Denis Kenzior
e9eb113a22 voicecall: Fix up dial_last_callback error paths
Error conditions were not properly handled
2019-09-19 17:32:40 +03:00
Philippe De Swert
abdfb38006 voicecallmanager: Handle last number dialled DBUS call
Handle the new DialLast method on the voicecallmanager interface
2019-09-19 17:32:40 +03:00
Philippe De Swert
79e22d4570 include/voicecall : update ofono_voicecall_driver to support call last dialled number
Add new DBUS method to enable calling the last dialled number.
2019-09-19 17:32:40 +03:00
James Prestwood
aab791f2ad simutil: Added ISIM elementary file ID's 2019-09-19 17:32:40 +03:00
James Prestwood
90c0ffddea simutil: Made UMTS/GSM authenticate more consitent
The Le parameter in the AUTHENTICATE command was not being
set for GSM authentication. This did work, but explicitly
setting it to 0 as UMTS does was more consitent.
2019-09-19 17:32:40 +03:00
Christophe Ronco
a3149c53d9 qmi: remove request when it timeouts
When modem does not answer or answers slowly to a discovery request,
a timeout occurs.
In timeout callback, request should be removed from queues to avoid
treating answer if it arrives later.
2019-09-19 17:32:40 +03:00
Denis Kenzior
b02a37a9c5 test: Add list-applications
This calls SimAuthentication.GetApplications
2019-09-19 17:31:55 +03:00
Denis Kenzior
eecf9fde2c mbm: Add sim-auth 2019-09-19 17:31:55 +03:00
Denis Kenzior
f2bb5d08ba voicecall: expand synthesize_outgoing_call
synthethize_outgoing_call was only used once from dial_handle_result.
So move all the logic of registering the call to D-Bus and adding it to
the voicecalls list to that function.

This will allow synthethize_outgoing_call to be used from other
callbacks where the dial callback is guaranteed to return before any
call state notifications, e.g. in the case of +BLDN.
2019-09-19 17:31:55 +03:00
James Prestwood
d44a1af644 simauth: Fixed incorrect AUTS length
The initial SimAuth implementation incorrectly parsed
the AUTS value as 16 bytes, not 14.
2019-09-19 17:29:49 +03:00
Jonas Bonn
50fbd5351b qmi: support SMS receive on Quectel EC21
The Quectel EC21 does not provide the SMS PDU on the message event
notification.

This patch adds a call to 'raw read' on the message ID from the event
notification if the event notification does not already contain the
message data.

The message data begins with the SMSC length, type, and address so
the TPDU length is adjusted accordingly in the raw_read callback.  This
differs from the way the raw message data is handled in the case
that it is included in the event notification itself.  As I don't have
access to any other QMI modem at this time, I'm can not confirm that
this difference is reasonable.
2019-09-19 17:29:49 +03:00
James Prestwood
9c8700b5c6 simauth: fixup adding more dbus return checks 2019-09-19 17:29:49 +03:00
James Prestwood
9221153db9 phonesim: Added sim-auth to phonesim plugin 2019-09-19 17:29:49 +03:00
James Prestwood
8997e02997 xmm7xxx: add sim-auth driver to xmm7xxx plugin 2019-09-19 17:29:49 +03:00
James Prestwood
7121855966 atmodem: implemented sim-auth functionality in atmodem
Implemented the core API's needed for sim-auth:

list_apps: already implemented
open_channel: Opens a logical channel with +CCHO
close_channel: Closes logical channel with +CCHC
logical_access: Access an opened channel with +CGLA
2019-09-19 17:29:49 +03:00
James Prestwood
0d013c3f9b sim-auth: implementation of core sim-auth atom
The sim-auth module atom can now be used for SIM application discovery
and authentication. The atom will automatically discover SIM
applications available on the SIM and register a new DBus object under
the modem, whos name is the AID string e.g.

/modem1/A0000000871004FFFFFFFF8906190000

A list of discovered AID object paths and types can be retrieved by
calling GetApplications() under the modems (new)
org.ofono.SimAuthentication interface which returns "a{oa{sv}}" where

o = path (e.g. above)

and the dictionary contains the following properties:

Type: "Umts" or "Ims"
Name: "USim" or "ISim"

The Type signifies which interfaces the AID object will have:

Umts = org.ofono.USimApplication
Ims = org.ofono.ISimApplication

These interfaces will contain the supported USIM/ISIM authentication
algorithms. Where:

org.ofono.USimApplication has:
    GetProperties()
    GsmAuthenticate()
    UmtsAuthenticate()

org.ofono.ISimApplication has:
    GetProperties()
    ImsAuthenticate()
2019-09-19 17:29:49 +03:00
James Prestwood
e2299cbddc test: added tests for GSM/UMTS auth algorithms 2019-09-19 17:29:49 +03:00
James Prestwood
34cd275117 doc: documentation for SimAuth dbus interfaces 2019-09-19 17:29:48 +03:00
James Prestwood
2396ead477 sim-auth: prep simauth/dbus headers
Added new dbus interfaces for SimAuth module as well as
function prototype definitions to simauth header.

org.ofono.SimAuthentication:
   Interface to hold the auth object to type mapping property

org.ofono.USimApplication:
   Application with USim functionality (GSM/UMTS auth)

org.ofono.ISimApplication:
   Application with ISim functionality (IMS auth)
2019-09-19 17:29:48 +03:00
James Prestwood
32dc1d1806 sim: new API to check for a UST service only
The existing service check API takes both SST and UST services
and could inadvertently return success on a service if one
(SST or UST) service did not exist. This adds an API specifically
for checking for a UST service, and if the UST dir is not available
it will return FALSE, rather than possibly returning true on some
other SST service.
2019-09-19 17:29:48 +03:00
Denis Kenzior
aed679d6da unit: Fix up style issues 2019-09-19 17:29:48 +03:00
James Prestwood
baea6fb7e9 unit: add gsm and umts parse/build unit tests 2019-09-19 17:29:48 +03:00
James Prestwood
ba64ce870f simutil: Added authenticate builder/parser API
Used to compose/parse non-TLV formatted authenticate commands
for GSM and UMTS authentication.
2019-09-19 17:29:48 +03:00
James Prestwood
1e25fbbcbf simutil: Added app type to application parser
Parsing a SIM application only copied the 16 byte AID
portion, which included the application type. Parsing out
the type makes sorting much easier for modules using the
parser.
2019-09-19 17:29:48 +03:00
Denis Kenzior
d13339af6c mbim: Set device online and offline properly
At initialization time set the radio off and implement .set_online
to toggle the radio state.
2019-09-19 17:29:48 +03:00
Denis Kenzior
890f3235cb mbim: Add sim atom to mbim modem driver 2019-09-19 17:29:48 +03:00
Denis Kenzior
2603419fa4 mbim: Add basic SIM driver 2019-09-19 17:29:48 +03:00
Denis Kenzior
1abdcc9226 AUTHORS: Mention Ankit's contributions 2019-09-19 17:29:48 +03:00
Ankit Navik
928a905cce doc: Add IMS interface to Interfaces list 2019-09-19 17:29:48 +03:00
Ankit Navik
f241580817 xmm7modem: Add support for ims 2019-09-19 17:29:48 +03:00
Ankit Navik
26826c15c9 xmm7modem: Add ims atom driver 2019-09-19 17:29:48 +03:00
Denis Kenzior
5b3a045e6c ims: Rework initialization
We should bootstrap the registration status prior to registering the
interface with D-Bus
2019-09-19 17:29:48 +03:00
Denis Kenzior
c8a08bd815 ims: Remove logic checking presence of SIM atom
This part is not required
2019-09-19 17:29:48 +03:00
Ankit Navik
53d1f1ce03 ims: add implementation for IMS atom
This implementation includes:
* D-Bus interface
* interaction with driver
2019-09-19 17:29:39 +03:00
Ankit Navik
1aec6df272 test: add scripts to test ims registration 2019-09-19 17:16:48 +03:00
Ankit Navik
b43df906ca include: added IpMultimediaSystem interface
Conflicts:
	ofono/Makefile.am
2019-09-19 17:16:34 +03:00
Ankit Navik
1d42a2a6a9 doc: add ims atom documentation 2019-09-19 17:13:18 +03:00
Clayton Craft
bab1cb2479 nokia-gpio: do not create links to gpios in /dev/cmt
The nokia-gpio plugin should not try to create symlinks to relevant gpio
pins under /dev/cmt, since the location it is looking is no longer
correct on newer kernels and it might change again in the future. This
patch removes code from nokia-gpio that tries to create a symlink.

Users will now need to symlink the modem gpios to /dev/cmt themselves.
On the 4.13 kernel, this can be done by, for example, adding a udev rule
to:
 # ln -sf /sys/bus/hsi/devices/n900-modem /dev/cmt
2019-09-19 17:13:18 +03:00
Denis Kenzior
a8be51ceef AUTHORS: Mention Richard's contributions 2019-09-19 17:12:40 +03:00
Richard Röjfors
a658ec7e77 ublox: Disable DCD to avoid HUP when leaving data mode.
The HUP results in errors in gatio which will deref parts
of the AT channel. This makes it impossible to recover and
send further AT commands after the HUP.
2019-09-19 17:12:40 +03:00
John Ernberg
960db7cf2b doc: Add missing LTE interface to Interfaces list 2019-09-19 17:12:40 +03:00
Denis Kenzior
842fe25bcd mbim: Add CIDs from the specification 2019-09-19 17:12:17 +03:00
Denis Kenzior
7aa2cbb8cb mbim: Support all types in _mbim_message_build 2019-09-19 17:12:17 +03:00
Denis Kenzior
612b295eae mbim: Instantiate devinfo atom 2019-09-19 17:12:17 +03:00
Denis Kenzior
168919770d mbim: Add devinfo driver
Querying Manufacturer and Model is still not supported
2019-09-19 17:12:17 +03:00
Denis Kenzior
b603be82ee devinfo: Implement ofono_devinfo_get_modem 2019-09-19 17:12:17 +03:00
Denis Kenzior
bbeaadd191 include: add ofono_devinfo_get_modem 2019-09-19 17:12:17 +03:00
Denis Kenzior
99d7c4e884 mbim: Add mbim_device_cancel_group 2019-09-19 17:12:17 +03:00
Denis Kenzior
9753700d58 mbim: Add mbim_device_cancel 2019-09-19 17:12:17 +03:00
Denis Kenzior
7772c8971b mbim: Add basic enable/disable 2019-09-19 17:12:17 +03:00
Denis Kenzior
13b39ba633 mbim: Implement receiving responses 2019-09-19 17:12:17 +03:00
Denis Kenzior
77ac688c5e mbim: Implement sending commands 2019-09-19 17:12:17 +03:00
Denis Kenzior
f4bbba9547 mbim: Close IO in an idle event 2019-09-19 17:12:17 +03:00
Denis Kenzior
17f5b9faa5 mbim: Add is_ready flag 2019-09-19 17:12:17 +03:00
Denis Kenzior
4b266cfbfd mbim: Add message_assembly utilities 2019-09-19 17:12:17 +03:00
Denis Kenzior
e56998d640 unit: Add device caps query build test 2019-09-19 17:12:17 +03:00
Denis Kenzior
b87fb13b7b mbim: Add header & body accessors for mbim-message 2019-09-19 17:12:17 +03:00
Denis Kenzior
32753de8a7 mbim: Implement MBIM_CLOSE_MSG 2019-09-19 17:12:17 +03:00
Denis Kenzior
331c6e98d2 mbim: Implement MBIM_OPEN_MSG 2019-09-19 17:12:17 +03:00
Denis Kenzior
69f1b7b36f mbim: Add mbim_device_set_ready_handler 2019-09-19 17:12:17 +03:00
Denis Kenzior
ca6447102f mbim: Rework constructor 2019-09-19 17:12:17 +03:00
Denis Kenzior
9b3dc8143d mbim: Get rid of fd and close_on_unref members
l_io already does this for us
2019-09-19 17:12:17 +03:00
Denis Kenzior
919df873f3 mbim: Add mbim_device_set_max_outstanding 2019-09-19 17:12:17 +03:00
Denis Kenzior
7aed70b642 mbim: Add mbim_message_get_uuid 2019-09-19 17:12:17 +03:00
Denis Kenzior
0776d5b19b mbim: Add mbim_message_get_cid 2019-09-19 17:12:17 +03:00
Denis Kenzior
ca4c2c4a07 mbim: Rework mbim_message_new 2019-09-19 17:12:17 +03:00
Denis Kenzior
eab88cd6cb mbim: Add mbim_message_get_error 2019-09-19 17:12:17 +03:00
Denis Kenzior
0be2675072 unit: Add phonebook read build test 2019-09-19 17:12:17 +03:00
Denis Kenzior
d226729730 unit: Add subscriber ready build test 2019-09-19 17:12:17 +03:00
Denis Kenzior
417bbaa963 unit: print mbim messages for easier debugging 2019-09-19 17:12:17 +03:00
Denis Kenzior
9974013cce unit: Add device_caps build test 2019-09-19 17:12:16 +03:00
Denis Kenzior
53e07c0932 mbim: Add mbim_message_set_arguments 2019-09-19 17:12:16 +03:00
Denis Kenzior
edce8b06c6 mbim: Support for building variable-sized structs 2019-09-19 17:12:16 +03:00
Denis Kenzior
8d72007e95 mbim: Add support for building arrays 2019-09-19 17:12:16 +03:00
Denis Kenzior
ffa0e801a3 mbim: Add _mbim_message_to_bytearray 2019-09-19 17:12:16 +03:00
Denis Kenzior
f6c7117097 mbim: Add _mbim_message_set_tid 2019-09-19 17:12:16 +03:00
Denis Kenzior
3d9013eea8 mbim: Add _mbim_message_new_command_done
This is for unit testing purposes
2019-09-19 17:12:16 +03:00
Denis Kenzior
b76517559b mbim: Add basic message builder support 2019-09-19 17:12:16 +03:00
Denis Kenzior
6bdb51dc29 mbim: Add MBIM service UUID constants 2019-09-19 17:12:16 +03:00
Denis Kenzior
4f066a2133 unit: Add phonebook read parse test 2019-09-19 17:12:16 +03:00
Denis Kenzior
61d87e5cf9 mbim: Support parsing structures 2019-09-19 17:12:16 +03:00
Denis Kenzior
3d33bea585 mbim: Add support for arrays of fixed-size elements
Variable-sized arrays are handled by using an Element Count followed by
OL_PAIR_LIST.  For fixed size arrays, an Offset followed by Length is
used.
2019-09-19 17:12:16 +03:00
Denis Kenzior
a741db6087 mbim: Don't assume 4-byte alignment
This change would make it possible to read individual bytes from ay type
structures.
2019-09-19 17:12:16 +03:00
Denis Kenzior
f9a175b1a8 unit: Add subscriber ready status test 2019-09-19 17:12:16 +03:00
Denis Kenzior
04133f8316 mbim: Parse variable sized item arrays 2019-09-19 17:12:16 +03:00
Denis Kenzior
2e6ae0f001 unit: Add test-mbim 2019-09-19 17:12:12 +03:00
Denis Kenzior
432c05928b mbim: Add mbim_message_get_arguments 2019-09-19 17:10:48 +03:00
Denis Kenzior
38054818ed mbim: Handle extraction of strings 2019-09-19 17:10:48 +03:00
Denis Kenzior
f3e4550d67 mbim: add _mbim_information_buffer_length_offset 2019-09-19 17:10:48 +03:00
Denis Kenzior
a91c8de5c2 mbim: Add basic message payload parser 2019-09-19 17:10:48 +03:00
Denis Kenzior
9c29518418 mbim: Add skeleton mbim-message class 2019-09-19 17:10:48 +03:00
Denis Kenzior
951e9439d4 mbim: Parse MBIM descriptors
This is needed to find out the maximum fragment size that this device
supports.  The minimum length specified in the spec is 64, however 512
bytes is recommended.

We also attempt to parse how many simultaneous commands can be
outstanding at a given time.  In theory MBIM supports multiple
outstanding commands through the use of transaction-id matching, but it
seems some devices only support a single outstanding command at a time.
2019-09-19 17:10:48 +03:00
Denis Kenzior
7cd984aa1a udevng: Store MBIM descriptors file 2019-09-19 17:10:48 +03:00
Denis Kenzior
06227e5e50 mbim: Add MBIM descriptor utilities
Used to find MBIM Functional and MBIM Extended Functional descriptors
2019-09-19 17:10:48 +03:00
Denis Kenzior
bba23c3095 mbim: Add skeleton mbim_device object 2019-09-19 17:10:48 +03:00
Denis Kenzior
a892edaea5 udevng: Add basic detection for MBIM
Currently only Telit LN930 has been tested to work
2019-09-19 17:10:48 +03:00
Denis Kenzior
2ede8f2464 mbim: Add skeleton mbim modem driver 2019-09-19 17:10:48 +03:00
Denis Kenzior
1759502c96 mbimmodem: Add skeleton driver 2019-09-19 17:10:48 +03:00
Denis Kenzior
134efba989 build: Add optional ell dependency 2019-09-19 17:10:48 +03:00
Slava Monich
9331cc1ecb Merge branch 'online' into 'master'
Never fail online requests

See merge request mer-core/ofono!232
2019-09-17 11:59:46 +00:00
Slava Monich
7c8da34a38 [ril] Never fail online requests. JB#46974
If we do so, the core will think that modem's online state
hasn't changed when in fact it does eventually change.
2019-09-17 02:13:21 +03:00
Slava Monich
a05523974e Merge branch 'device_state' into 'master'
Improve device state management

See merge request mer-core/ofono!228
2019-08-29 21:44:58 +00:00
Slava Monich
71ef390b4a [ril] Improved device state management. JB#46836
Use RIL_REQUEST_SEND_DEVICE_STATE on newer devices, take charger
and battery state into account.
2019-08-28 19:07:17 +03:00
Slava Monich
717f6452aa Merge branch 'master' into 'master'
[build] Always require libglibutil and dbus-glib-1. JB#42254

See merge request mer-core/ofono!230
2019-08-28 10:19:53 +00:00
Herrie
0803c21840 configure.ac: always require libglibutil and dbus-glib-1
There are tests that are compiled even when not using sailfish_rilmodem, which still require libglibutil and dbus-glib-1. Without it, tests would fail to build.

Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-08-27 22:26:45 +02:00
Slava Monich
095060b001 Housekeeping
Indentation fixes
2019-08-23 19:57:35 +03:00
Slava Monich
c2971da092 [ril] Defined more RIL command codes. JB#46836 2019-08-15 18:48:21 +03:00
Slava Monich
f07424f0aa Merge branch 'sim_reset' into 'master'
Disable STK after SIM reset

See merge request mer-core/ofono!227
2019-07-28 13:40:23 +00:00
Slava Monich
266a52a40a [ril] Disable STK after SIM reset. JB#42589
As a workaround for STK reset loop.
2019-07-27 16:51:32 +03:00
Slava Monich
eeea5476d1 Merge branch 'fix_make' into 'master'
Fix RIL-less build

See merge request mer-core/ofono!226
2019-07-25 11:46:49 +00:00
Sergey Chupligin
e38a63d179 [packaging] Fixup build without rild. Fixed JB#46736 2019-07-25 13:16:17 +03:00
Slava Monich
0ff8608ac3 Merge branch 'mo_ssn' into 'master'
Hook up MO intermediate SSN (+CSSI)

See merge request mer-core/ofono!225
2019-07-11 11:23:24 +00:00
Slava Monich
5a330b9852 [ril] Hook up MO intermediate SSN (+CSSI). Fixes JB#46578 2019-07-11 14:21:37 +03:00
Slava Monich
78a9323619 Merge branch 'power_off' into 'master'
Send power off request at startup

See merge request mer-core/ofono!224
2019-07-10 11:55:22 +00:00
Slava Monich
8267e206eb [ril] Send power off request at startup. JB#46294
Some RILs like to receive power off request at startup even if radio
is already off.
2019-07-06 00:53:02 +03:00
Slava Monich
fac7684958 [ofono] Bumped libgrilio version requirement 2019-07-02 14:03:15 +03:00
Slava Monich
6ba3170ce2 Merge branch 'enabled' into 'master'
Pass enabled/disabled attribite to GRilIoChannel

See merge request mer-core/ofono!223
2019-07-02 11:01:47 +00:00
Slava Monich
b29730b268 [ril] Pass enabled/disabled attribite to GRilIoChannel. JB#46324 2019-06-28 16:57:25 +03:00
Slava Monich
e095636c97 Merge branch 'get_set_pref_mode' into 'master'
Avoid GET/SET_PREFERRED_NETWORK_TYPE loop

See merge request mer-core/ofono!222
2019-06-21 11:39:51 +00:00
Slava Monich
6fef5444fb [ril] Avoid GET/SET_PREFERRED_NETWORK_TYPE loop. JB#45343
Some RILs accept one RAT in SET_PREFERRED_NETWORK_TYPE but return
a different one in response to GET_PREFERRED_NETWORK_TYPE. If both
RATs belong to the same family (2G, 3G or LTE), just leave it as is,
there's no need to repeat SET_PREFERRED_NETWORK_TYPE request.
2019-06-20 18:34:56 +03:00
Slava Monich
0e62e613e8 Merge branch 'mms-settings' into 'master'
Report full IP settings for MMS context

See merge request mer-core/ofono!221
2019-06-13 10:03:54 +00:00
Slava Monich
c08be69130 Merge branch 'profiles' into 'master'
Support for data profiles

See merge request mer-core/ofono!220
2019-06-13 09:59:10 +00:00
Slava Monich
419caedc2c [ofono] Report full IP settings for MMS context. MER#903
"If we have a Proxy, no other settings are relevant" was a wrong assumption.
Proxy host name may require DNS resolution, which in turn requires at least
addresses of DNS servers.
2019-06-12 01:57:21 +03:00
Slava Monich
ee6a307804 [ril] Use data profiles is needed. JB#45344
By default, data profiles are off because in most cases everything
works without them. In those cases when they are needed, they can
be turned on with the following options in the config file:

  useDataProfiles
  mmsDataProfileId
2019-06-11 17:12:01 +03:00
Slava Monich
412d8c3d4d [ofono] Added __ofono_gprs_context_get_assigned_type(). JB#45344
Note that it's different from ofono_gprs_context_get_type() which
typically returns OFONO_GPRS_CONTEXT_TYPE_ANY no matter what's the
current usage of the context.
2019-06-11 16:04:49 +03:00
Slava Monich
0efebd16d9 Merge branch 'stk_disable' into 'master'
Make STK functionality configurable

See merge request mer-core/ofono!219
2019-06-05 21:38:10 +00:00
Slava Monich
7a6928c02f [ril] Made STK functionality configurable. JB#42589
With enableSimToolkit option in ril_subscription.conf

Defaults to true.

It's more of a workaround than a solution to the "SIM removed" problem,
but better to have at least that than nothing at all.
2019-06-04 15:21:58 +03:00
Slava Monich
ec134e68d2 [build] Undefine _FORTIFY_SOURCE in debug build
To avoid these compilation warnings with newer gcc:

/usr/include/features.h:381:4: warning:
2019-05-20 18:22:46 +03:00
Slava Monich
a8be769c87 Merge branch 'initial_attach' into 'master'
Set initial attach APN for LTE

See merge request mer-core/ofono!217
2019-05-13 23:04:06 +00:00
Slava Monich
a2d87f64c4 [unit] Added ril_vendor test 2019-05-09 14:51:52 +03:00
Slava Monich
3ecd55a205 [unit] Improved ril_util.c coverage 2019-05-09 14:50:45 +03:00
Slava Monich
d8ea82b2f1 [ril] Set initial attach APN for LTE. JB#45341
Qualcomm doesn't require it but MediaTek apparently does.
Also, slightly refactored RIL vendor support.
2019-05-09 14:50:30 +03:00
Slava Monich
c95fe16a9b Merge branch 'watch' into 'master'
Watch API extension

See merge request mer-core/ofono!216
2019-04-30 13:55:37 +00:00
Slava Monich
55e923250a [ofono] Fixed crash on exit in __ofono_modem_remove_online_watch 2019-04-26 12:26:16 +03:00
Slava Monich
f5653ae240 [ofono] Added gprs field to ofono_watch. JB#45342
And these two new functions:

    ofono_watch_add_gprs_changed_handler
    ofono_watch_add_gprs_settings_changed_handler
2019-04-24 12:23:39 +03:00
Slava Monich
ecf23c1333 [ofono] Added registration info to ofono_watch
Particularly, these four new fields:

  enum ofono_netreg_status reg_status;
  const char *reg_mcc;
  const char *reg_mnc;
  const char *reg_name;

and the corresponding callback registration functions:

  ofono_watch_add_reg_status_changed_handler()
  ofono_watch_add_reg_mcc_changed_handler()
  ofono_watch_add_reg_mnc_changed_handler()
  ofono_watch_add_reg_name_changed_handler()
2019-04-24 12:18:05 +03:00
Slava Monich
e71036f7d7 Merge branch 'context_by_type' into 'master'
Add ofono_gprs_context_settings_by_type() API

See merge request mer-core/ofono!215
2019-04-18 15:08:13 +00:00
Slava Monich
b8e8b930f8 [ofono] Added ofono_gprs_context_settings_by_type() API. JB#44551 2019-04-18 12:50:37 +03:00
Slava Monich
65a3f7ee46 Merge branch 'access' into 'master'
D-Bus access control

See merge request mer-core/ofono!213
2019-04-12 12:04:59 +00:00
Slava Monich
26c5c4bfa3 Merge branch 'plus_0' into 'master'
Add networkSelectionManual0 configuration option

See merge request mer-core/ofono!214
2019-04-12 08:22:28 +00:00
Slava Monich
2d35e5e28d [ril] Added networkSelectionManual0 config option. JB#42812
It makes +0 suffix for RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL
configurable.
2019-04-11 18:44:59 +03:00
Slava Monich
ae78d9a946 [ofono] Access control for RadioSettings interface. JB#44705 2019-04-05 18:06:49 +03:00
Slava Monich
243dd7d17c [ofono] Access control for Modem interface. JB#44705 2019-04-05 18:05:24 +03:00
Slava Monich
acaafafbb9 [ofono] Access control for SimManager interface. JB#44705 2019-04-05 18:04:54 +03:00
Slava Monich
4f378c806b [unit] Test for D-Bus access control plugin. JB#44705 2019-04-05 18:04:54 +03:00
Slava Monich
bd33ff471c [ofono] D-Bus access control plugin. JB#44705 2019-04-05 18:04:54 +03:00
Slava Monich
d423608e46 [unit] Test for access control API. JB#44705 2019-04-05 18:04:54 +03:00
Slava Monich
3b708effd9 [ofono] Access control API. JB#44705 2019-04-05 18:04:26 +03:00
Slava Monich
f01722cca5 [ofono] Don't use __DATE and __TIME__ macros
They make every build unique and we don't want that.
2019-04-05 16:44:11 +03:00
Slava Monich
f62d53fbd0 [ofono] Fixed compilation warnings with gcc 4.9
src/gprs-filter.c:117:56: warning: right-hand operand of comma expression has no effect [-Wunused-value]
 #define gprs_filter_request_ref(req) ((req)->refcount++, req)
                                                        ^
src/voicecall-filter.c:121:61: warning: right-hand operand of comma expression has no effect [-Wunused-value]
 #define voicecall_filter_request_ref(req) ((req)->refcount++, req)
                                                             ^
2019-04-05 16:29:33 +03:00
Slava Monich
942aee3f25 Merge branch 'python3' into 'master'
python => python3

See merge request mer-core/ofono!212
2019-03-21 14:20:37 +00:00
Slava Monich
ecc83568fd [test] python => python3. Fixes JB#45222 2019-03-21 15:17:50 +02:00
Slava Monich
c911c05fcb Merge branch 'tdscdma_dbm' into 'master'
Take TD_SCDMA_SignalStrength into account (when it's present)

See merge request mer-core/ofono!211
2019-03-19 11:22:15 +00:00
Slava Monich
680979f782 [ril] Take TD_SCDMA_SignalStrength into account. JB#44551
And use it when no other signal strength information is available.
2019-03-18 14:14:55 +02:00
Slava Monich
250a6abb71 Hosekeeping
warning: Macro expanded in comment on line 20: %license requires reasonably fresh rpm
2019-03-13 16:38:00 +02:00
Slava Monich
6c5d2ab803 Merge branch 'modem_path' into 'master'
Add "modem" entry to RIL transport parameters

See merge request mer-core/ofono!209
2019-03-05 14:48:53 +00:00
Slava Monich
bf8cb3995c [ril] Add "modem" entry to RIL transport parameters. JB#44551
The value is modem's D-Bus path. RIL transport plugins may (and most
likely will) need it to access per-modem parameters such as SPN, IMSI
and so on.
2019-03-05 15:23:21 +02:00
Slava Monich
8973e52e45 Merge branch 'umts_network_mode' into 'master'
Make UMTS network mode configurable

See merge request mer-core/ofono!208
2019-03-04 22:10:24 +00:00
Slava Monich
0e8dc3605e [ril] Make UMTS network mode configurable. JB#44551
Some devices don't understand GSM_WCDMA_AUTO and want to see
GSM_WCDMA instead. Now we can make those happy by configuring
UMTS mode in /etc/ofono/ril_subscription.conf like this:

  umtsNetworkMode=0
2019-03-04 21:50:07 +02:00
Slava Monich
537a39f94a Merge branch 'jb38580' into 'master'
Delay sending SMS by 0.1s

See merge request mer-core/ofono!207
2019-02-27 12:06:35 +00:00
Santtu Lakkala
c3d93e83d7 [ofono] Delay sending SMS by 0.1s. Contributes to: JB#38580
When sending an SMS message to multiple recipients, multiple calls to
SendMessage are received in rapid succession. Delay sending the first
one in such a batch slightly so that we hopefully have at least the next
one queued up to start sending in "MMS" mode, otherwise it seems
messages can be lost or erroneously sent twice.
2019-02-27 13:25:14 +02:00
Slava Monich
7cdf3db124 Merge branch 'jb44709' into 'master'
Interpret , and . as pause in tone string.

See merge request mer-core/ofono!206
2019-02-25 15:00:37 +00:00
Santtu Lakkala
398942c78e [ofono] Interpret , and . as pause in tone string. Contributes to: JB#44709 2019-02-25 09:35:26 +02:00
Slava Monich
26e39508ad [packaging] Require rpm >= 4.11
For %license macro
2019-01-16 17:17:49 +02:00
Slava Monich
a16fcd0d37 Merge branch 'ofono_watch' into 'master'
sailfish_watch -> ofono_watch

See merge request mer-core/ofono!204
2019-01-16 15:08:28 +00:00
Slava Monich
432e700272 Merge branch 'jb24119' into 'master'
Add ofono-doc subpackage. JB#24119

See merge request mer-core/ofono!205
2019-01-16 15:07:56 +00:00
Tomi Leppänen
aa694b592f [packaging] Add ofono-doc subpackage. Contributes to JB#24119
Signed-off-by: Tomi Leppänen <tomi.leppanen@jolla.com>
2019-01-15 15:17:41 +02:00
Slava Monich
c5c8b72761 [ofono] sailfish_watch -> ofono_watch. JB#44067
This exposes sailfish_watch object to ofono plugins. Also, removed
dependency on glib headers from the header file.

Lots of changes but those are mostly mechanical.

Since upstream ofono started migrating away from glib and losing
its value for us as upstream project, it's ok now to start dropping
sailfish prefixes in the source code. This code is ours now to maintain.
2019-01-15 01:08:12 +02:00
Slava Monich
2ab7aa0f97 Merge branch 'roaming_issues' into 'master'
Roaming issues

See merge request mer-core/ofono!202
2019-01-02 14:06:55 +00:00
Slava Monich
549fe2355f [netreg] Re-assert automatic operator selection at startup. JB#42820
It wasn't done if the status at startup was "searching".
2018-12-23 17:31:51 +01:00
Slava Monich
7493187e47 [ril] Never fail deactivate requests. JB#42820
Failed connection request doesn't release ofono context id but we don't
need to worry about those ids because the real ones are allocated by rild.
We just need to release ofono ids whenever we no longer need them.
2018-12-23 17:30:28 +01:00
Slava Monich
9a3d8d671c [gprs] Make debug trace slightly more informative 2018-12-23 17:29:52 +01:00
Slava Monich
39eac13743 [ril] Retry registration requests. JB#42820
And use a long timeout. It may take a minutes in roaming.
2018-12-23 17:28:14 +01:00
Slava Monich
6329bb8639 [ril] Specify timeout for SETUP_DATA_CALL requests. JB#42820
Completion routine must be invoked even if rild never replies.
The timeout (5 min) may seem ridiculously long but sometimes it
does take minutes in roaming.
2018-12-23 17:26:23 +01:00
Slava Monich
75b07c5c80 Merge branch 'hfp_ag' into 'master'
HFP AG BlueZ5 plugin reconnects to daemon if daemon restarts.

See merge request mer-core/ofono!201
2018-11-30 13:59:21 +00:00
Juho Hämäläinen
4f6f964ca4 [hfp_ag_bluez5] Remove DBUS_TYPE_UNIX_FD check. 2018-11-30 12:46:26 +02:00
Juho Hämäläinen
7af95f6db5 [hfp_ag_bluez5] Follow BlueZ in system bus. JB#42087
Close interface on BlueZ exit and reconnect to BlueZ and re-create
interfaces when the daemon appears again. Now HFP AG is usable with
wanted or crash caused restarts of BlueZ daemon without needing to
restart oFono.
2018-11-30 12:45:43 +02:00
Juho Hämäläinen
99f4667eb7 [handsfree-audio] Set freed agent to NULL on exit. JB#42087 2018-11-29 14:36:27 +02:00
Slava Monich
c1c3ecab31 Merge branch 'context' into 'master'
Added "singleDataContext" configuration option

See merge request mer-core/ofono!200
2018-11-28 17:55:01 +00:00
Slava Monich
83dc99658c [ril] Added "singleDataContext" configuration option. JB#42837
Normally we should be able to have two simultaneously active
data contexts - one for mobile data and one for MMS. However
some devices may require that mobile data is disconnected
before we can send or receive MMS.
2018-11-28 13:54:51 +02:00
Slava Monich
9a7b538087 Merge branch 'jb42297' into 'master'
Handle multi-modem cases better in emulator and plugins.

See merge request mer-core/ofono!199
2018-11-14 23:30:42 +00:00
Juho Hämäläinen
9f7a1ffe3f [bluez5] Use updated emulator. Fixes JB#42297
Instead of using arbitrary modem in multiple modems scenario, pass all
applicaple modems to emulator.
2018-11-13 09:29:46 +02:00
Juho Hämäläinen
1f81ec7d9d [bluez4] Use updated emulator.
Instead of using arbitrary modem in multiple modems scenario, pass all
applicaple modems to emulator.
2018-11-13 09:29:46 +02:00
Juho Hämäläinen
6e833401cc [examples] Use updated emulator. 2018-11-13 09:29:46 +02:00
Juho Hämäläinen
d9c68c4fb9 [ofono] Support multiple modems in emulator. JB#42297
With more than one modem we don't play indicators etc correctly to
headset if the call is coming to a modem we are not watching. As the
modem is picked arbitrarily in hfp plugins, it is better to be able to
follow multiple modems at the same time.

When modems disappear they automatically are removed from the emulator,
with two or more modems it is possible that only one remains for a while
and new modems appear, to handle these cases add functionality to add
modems to the emulator.
2018-11-13 09:29:43 +02:00
Slava Monich
9e6f7721a0 Merge branch 'stray_call' into 'master'
Fix data connection dying after switching radio tech

See merge request mer-core/ofono!198
2018-10-26 15:50:09 +00:00
Slava Monich
9c529dcdcc [ril] Disconnect stray data calls. JB#42752
Sometimes data calls survive change of radio technology and just get
disassociated from ofono context and we may end up trying to activate
another context, thinking that the previous one is gone, even though
it's still alive. This is something that (at least some) operators
don't like, and start start rejecting our data calls.
2018-10-26 13:15:41 +03:00
Slava Monich
41814c6e6a [ril] Don't take LTE caps away from the only SIM 2018-10-25 01:01:05 +03:00
Slava Monich
cf99a5769f Merge branch 'restrict' into 'master'
Respect state restrictions

See merge request mer-core/ofono!197
2018-09-11 21:48:16 +00:00
Slava Monich
076e2f0ef1 [ril] Respect state restrictions. JB#42752
Do not allow mobile data connections if packet data access is blocked
due to restriction.
2018-09-11 17:01:09 +03:00
Slava Monich
fd76cb72ad Merge branch 'mtk2_incoming_call_fix' into 'master'
Fix incoming call indication on mtk2 vendor.

See merge request mer-core/ofono!196
2018-09-10 09:33:12 +00:00
Sergey Chupligin
554e4ab8e5 [ril] Fix incoming call indication on mtk2 vendor. Fixes JB#40790 2018-09-10 12:22:44 +03:00
NeKit
08f3da7577 [ril] Respond to INCOMING_CALL_INDICATION with SET_CALL_INDICATION. Fixes JB#40950
This is needed to make incoming calls to work on Gemini PDA (and noy only)
2018-09-04 12:55:57 +03:00
Slava Monich
2cbd3b6050 Merge branch 'cell_info_dbg' into 'master'
Improved cell info debug log

See merge request mer-core/ofono!194
2018-07-25 15:16:22 +00:00
Slava Monich
78d3d1892d [ril] Improved cell info debug log. JB#42359 2018-07-25 15:22:32 +03:00
Slava Monich
1448bd2320 Merge branch 'transport' into 'master'
Add interface for RIL transport plugins

See merge request mer-core/ofono!193
2018-07-24 08:05:12 +00:00
Slava Monich
ea8dfb48ab plugin: Don't unload external plugins too early
Plugins may reference data structures allocated by each other.
They all need to be deinitialized first, only then it should be
safe to unload the libraries.
2018-07-24 11:00:12 +03:00
Slava Monich
80921e8b7e [ofono] Add interface for RIL transport plugins. JB#42359
Intended to be used for integrating binder support.
2018-07-21 23:39:53 +03:00
Slava Monich
e4cc912719 [ril] Pull phone number type from SUPP_SVC_NOTIFICATION event
It was left uninitialized which wasn't good.
2018-07-21 23:38:41 +03:00
Slava Monich
c5f736d3c3 [ril] Housekeeping 2018-07-21 17:05:12 +03:00
Slava Monich
ddf4cec9b8 [ril] Do not wait for radio power request to complete
... after the power state has changed to the requested one.
There's no guarantee that rild is going to reply at all.
2018-07-21 17:04:02 +03:00
Slava Monich
685d0b34d7 [ril] Do not submit unnecessary radio power requests
Some RILs don't bother to reply to such a request which
blocks the request queue until such request expires.
2018-07-21 17:00:07 +03:00
Slava Monich
896f2f7a71 [ril] Added confirmRadioPowerOn configration entry
Modern RILs don't need and don't like it. The default
remains on for historical reasons.
2018-07-21 16:57:14 +03:00
Slava Monich
e96aacb9e7 [ril] Added radioPowerCycle configration entry.
With modern RILs radio power cycle shouldn't be necessary, it only
slows down the startup.
2018-07-18 23:37:48 +03:00
Slava Monich
91560afeec Merge branch 'fac_lock' into 'master'
Fix broken QUERY_FACILITY_LOCK packets

See merge request mer-core/ofono!192
2018-07-17 20:34:11 +00:00
Slava Monich
09fb8635c9 [ril] Fix broken QUERY_FACILITY_LOCK packets. Fixes JB#42428
I'm surprised that it worked at all - rild was probably ignoring
the broken part.
2018-07-17 16:27:38 +03:00
Slava Monich
1cb80d7d2f Merge branch 'voicecall_filter3' into 'master'
Allow to filter existing calls

See merge request mer-core/ofono!191
2018-07-05 08:54:46 +00:00
Slava Monich
7db5552e79 [ofono] Allow to filter existing calls. JB#41404
Plugins can request it by invoking ofono_voicecall_filter_notify().
Calls that don't pass the filter will be terminated.
2018-07-02 20:16:54 +03:00
Slava Monich
d87e40d0ff modem: Implement ofono_modem_get_voicecall 2018-07-02 20:15:33 +03:00
Slava Monich
35131ff56b include: Add ofono_modem_get_voicecall 2018-07-02 20:15:33 +03:00
Slava Monich
c5cc678b2b Merge branch 'voicecall-filter2' into 'master'
Voicecall filter tweaking

See merge request mer-core/ofono!190
2018-06-29 08:11:36 +00:00
Slava Monich
31be9a099b [ofono] Don't filter emergency calls. JB#41404 2018-06-29 11:09:46 +03:00
Slava Monich
ccaf993977 [ofono] Return AccessDenied if voice call is blocked by the filter. JB#41404 2018-06-28 19:49:01 +03:00
Slava Monich
74d633c58e dbus: Add D-Bus mapping for OFONO_ERROR_TYPE_ERRNO 2018-06-28 19:48:48 +03:00
Slava Monich
f870880cf9 emulator: Handle OFONO_ERROR_TYPE_ERRNO in switch 2018-06-28 19:48:48 +03:00
Slava Monich
50c06afc73 include: Add OFONO_ERROR_TYPE_ERRNO 2018-06-28 19:48:48 +03:00
Slava Monich
e4e0ccd51d [ofono] Housekeeping
Removed unused OFONO_EINVAL and OFONO_NO_ERROR macros
2018-06-28 19:19:25 +03:00
Slava Monich
ee052af454 dbus: Make cme_errors_mapping static const 2018-06-28 19:11:16 +03:00
Slava Monich
296b272274 Merge branch 'voicecall-filter' into 'master'
Voice call filter

See merge request mer-core/ofono!189
2018-06-28 09:35:33 +00:00
Slava Monich
9b9e5159f5 [ofono] Hooked up voicecall-filter. JB#41404 2018-06-27 16:45:22 +03:00
Slava Monich
fa8002200c [ofono] Added voicecall-filter. JB#41404 2018-06-27 16:45:06 +03:00
Slava Monich
4cc71c78ec [ril] Implement hangup_active in voicecall driver 2018-06-27 16:43:13 +03:00
Slava Monich
27b31e65bb [ril] set_udub should be implemented as RIL_REQUEST_UDUB 2018-06-26 11:50:07 +03:00
Slava Monich
e26d365a94 voicecall: Implement ofono_voicecall_get_modem 2018-06-26 11:49:04 +03:00
Slava Monich
63f06cd11c include: Add ofono_voicecall_get_modem 2018-06-26 11:49:03 +03:00
Slava Monich
96ca3aa907 [gprs-filter] Removed unnecessary forward declaration 2018-06-21 11:55:34 +03:00
Slava Monich
11a84853fe Merge branch 'jb41925' into 'master'
Make sure that USSD cancel callback is invoked

See merge request mer-core/ofono!188
2018-05-24 15:28:47 +00:00
Slava Monich
a393cf0b11 [ril] Make sure that USSD cancel callback is invoked. JB#41925
Some RILs don't bother to reply. But if we don't invoke the callback
provided by ofono core, its USSD machinery gets stuck in active state.
2018-05-24 15:17:30 +03:00
Slava Monich
6f263ee8d5 ussd: Cancel pending requests when unregistering
And reset state to idle before unregistering the D-Bus interface.
This may occur e.g. when we receive REFRESH from STK.
2018-05-23 20:48:27 +03:00
Slava Monich
92a4760f46 Merge branch 'nettime' into 'master'
Handle NITZ string without DST part

See merge request mer-core/ofono!187
2018-05-16 08:20:05 +00:00
Slava Monich
c43d41829f [ril] Handle NITZ string without DST part. Fixes JB#41890 2018-05-16 00:09:13 +03:00
Slava Monich
25638a30c0 [ril] netreg: Housekeeping 2018-05-15 23:55:36 +03:00
Slava Monich
ed669bf66c Merge branch 'jb41508' into 'master'
Don't wait for SIM state change after enabling/disabling pin

See merge request mer-core/ofono!186
2018-05-14 15:46:46 +00:00
Slava Monich
e01dbd2b21 [ril] Don't wait for SIM state change after enabling/disabling pin. JB#41508
There's no real need for that, but most importantly no SIM state change
event is generated by MTK RIL in such cases.
2018-05-14 16:10:37 +03:00
Slava Monich
a8f0f26df8 Merge branch 'mdm_deactivate' into 'master'
Add filter_check to ofono_gprs_filter

See merge request mer-core/ofono!185
2018-05-04 13:26:55 +00:00
Slava Monich
56c84395ba [ofono] Added filter_check to ofono_gprs_filter. JB#41665
It checks if ofono_gprs_filter allows mobile data in general,
not just for the particular context.
2018-05-03 19:35:04 +03:00
Slava Monich
3bf2b1df5c [ofono] Expose gprs_attached_update() to plugins. JB#41665
ofono_gprs_filter plugins implementing API version 1 or later
should call this function when their configuration changes and
mobile data may have become disallowed for the current SIM.
2018-05-03 19:14:28 +03:00
Slava Monich
75041ccc37 modem: Implement ofono_modem_get_gprs 2018-05-03 19:14:28 +03:00
Slava Monich
e91ef8a701 include: Add ofono_modem_get_gprs 2018-05-03 19:14:28 +03:00
Slava Monich
620a20abdc [coverage] Remove *.gcda and *.gcno files on clean 2018-05-03 19:13:57 +03:00
Slava Monich
d85fa8a64d Merge branch 'mtk_caps' into 'master'
Capability switch issues

See merge request mer-core/ofono!183
2018-04-25 13:02:30 +00:00
Slava Monich
d33b20889b [ril] Made SET_PREFERRED_NETWORK_TYPE timeout configurable. JB#41570 2018-04-25 15:55:18 +03:00
Slava Monich
cb8801752c [ril] Destroying ril_radio_caps cancels its pending requests. JB#41570
Mediatek rild restarts in the middle of the caps switch transaction,
destroying ril_radio_caps in the process. That should terminate the
transaction.
2018-04-25 12:29:00 +03:00
Slava Monich
a0722f8538 [ril] Don't retry SET_PREFERRED_NETWORK_TYPE too often. JB#41570
That has a disastrous effect with some RILs, slowing things down
to almost a complete stop.
2018-04-25 12:29:00 +03:00
Slava Monich
e016281b86 Merge branch 'lte_mode' into 'master'
Make LTE mode configurable

See merge request mer-core/ofono!184
2018-04-25 09:23:45 +00:00
Sergey Chupligin
781a528625 [rild] make lte mode configurable 2018-04-25 12:02:21 +03:00
Slava Monich
5b1ab91b77 ussd: Don't ignore data from TERMINATED response
Typically responses to USSD requests are coming with status
zero (NOTIFY) but some are coming with status 2 (TERMINATED).
If those contain data, the data should be presented to the user.

[ussd] Don't ignore data from TERMINATED response. Fixes JB#41734
2018-04-23 22:05:03 +03:00
Slava Monich
9604d9ef0a Merge branch 'sim_caps_fix' into 'master'
Fix a few issues with caps switch

See merge request mer-core/ofono!181
2018-04-20 13:05:28 +00:00
Slava Monich
598acaa1a8 [ril] Some events triggering caps switch, were missed. Fixes JB#41583
As a result, the data slot could be left with GSM caps and the other
slot (possibly empty) would keep enjoying LTE caps which it doesn't
really need.
2018-04-19 12:00:08 +03:00
Slava Monich
60193032f5 [ril] Make sure cancelled I/O doesn't remain marked as active. JB#41583
Otherwise capability switch may never start after a rild crash
waiting forever for SIM I/O to calm down.
2018-04-18 15:57:53 +03:00
Slava Monich
9faf27ec28 Merge branch 'initial_apn' into 'master'
Fix SET_INITIAL_ATTACH_APN crash on some MTK devices

See merge request mer-core/ofono!180
2018-04-11 15:20:17 +00:00
Slava Monich
32c26c5a35 [ril] Fix SET_INITIAL_ATTACH_APN crash on some MTK devices. Fixes JB#41587
This may break some other devices but let's give it a try.
2018-04-11 17:43:30 +03:00
Slava Monich
79fb591342 Merge branch 'query_available_band_mode' into 'master'
Don't use QUERY_AVAILABLE_BAND_MODE with MTK RILs

See merge request mer-core/ofono!179
2018-04-03 15:29:26 +00:00
Slava Monich
f6e46f78e3 [ril] Don't use QUERY_AVAILABLE_BAND_MODE with MTK RILs. Fixes JB#41506
Most MTK RIL implementations don't support this request and don't even
bother to reply which slows things down because we wait for this request
to complete at startup.
2018-04-03 16:11:10 +03:00
Slava Monich
7c587772d1 [ofono] Return AccessDenied if filter disallows a data call. JB#41405 2018-03-29 20:51:54 +03:00
Slava Monich
0d0728593b Housekeeping 2018-03-27 13:10:35 +03:00
Slava Monich
fd3916b2c7 Merge branch 'jb41496' into 'master'
Deduce signal strength from RSRP

See merge request mer-core/ofono!178
2018-03-27 10:05:29 +00:00
Slava Monich
c35557c2ed [ril] Deduce signal strength from RSRP. Fixes JB#41497
Some RILs report zero signal strength AND a valid LTE RSRP value in
RIL_UNSOL_SIGNAL_STRENGTH. In that case, calculate signal strength
from RSRP.
2018-03-26 20:48:12 +03:00
Slava Monich
bb07543dd6 Merge branch 'jb41474' into 'master'
Fixed parsing of data call list

See merge request mer-core/ofono!177
2018-03-26 14:07:16 +00:00
Slava Monich
d346f1289c [ril] Fixed parsing of data call list. Fixes JB#41474
The code was incorrectly assuming that each data call block has the
same size. This is an absolutely wrong assumption. It's especially
wrong if one data call has IPv6 addresses assigned and the other one
doesn't - in this case one block may be several times bigger than
the other.

The regression was introduced by commit 8c9e3704
2018-03-26 13:09:57 +03:00
Slava Monich
e170b6df4c [unit] Added test-dbus-queue. JB#38932
Lines:     112/112  100.0%
    Functions:   17/17  100.0%
    Branches:    56/56  100.0%
2018-03-23 17:19:05 +02:00
Slava Monich
761cd320bb [ofono] Fixed a few corner cases in D-Bus queue 2018-03-23 17:16:37 +02:00
Slava Monich
60bc47aea2 Merge branch 'gprs-filter' into 'master'
Add support for mobile data filter plugins

See merge request !176
2018-03-23 15:12:59 +00:00
Slava Monich
183e4dab4b [unit] Added test-gprs-filter
Tests gprs-filter.c

Lines:     128/128  100.0%
Functions:   17/17  100.0%
Branches:    61/64   95.3%
2018-03-23 12:41:30 +02:00
Slava Monich
d6cdfc92ad [ofono] Added support for gprs filter plugins. JB#41405
Such plugins can selectively disallow mobile data connections
or modify the actual access point settings sent to the driver
2018-03-22 13:53:06 +02:00
Slava Monich
b68752640c voicecall: Use dbus_validate_path
Instead of __ofono_dbus_valid_object_path which is no more
2018-03-21 15:05:02 +02:00
Slava Monich
a53fc6ea7e dbus: Use dbus_validate_path
Instead of __ofono_dbus_valid_object_path
2018-03-21 11:17:54 +02:00
Slava Monich
63fe971077 Merge branch 'config_merge' into 'master'
Allow multiple RIL config files

See merge request !175
2018-03-13 14:01:04 +00:00
Slava Monich
011f3b74d1 [ril] Allow multiple RIL config files. Fixes JB#41276
In addition to the usual /etc/ofono/ril_subscription.conf config file,
additional *.conf files from /etc/ofono/ril_subscription.d directory
will be merged in.
2018-03-13 16:59:52 +03:00
Slava Monich
4d2e314ad6 [ril] Unit test for ril_config.c 2018-03-13 12:10:33 +03:00
Slava Monich
d846618057 [ril] Added ril_config_merge_files utility 2018-03-13 11:53:13 +03:00
Slava Monich
38115199f7 [ril] Allow comments in int array config values 2018-03-13 11:52:50 +03:00
Slava Monich
f88c7ce919 [ril] Explicitely include <glib-object.h> where it's needed. MER#1437
Don't rely on gutil_types.h to pull it in
2018-02-25 16:48:39 +02:00
Slava Monich
9d6b3ec124 Merge branch 'mtk' into 'master'
Detect MTK variant based on events codes

See merge request !174
2018-02-23 08:55:58 +00:00
Slava Monich
6dcf5cebc1 [ril] Detect MTK variant based on events codes. JB#40397
The same (or very similar) kinds of hardware may be (and are!)
running different MTK adaptation software, totally incompatible
with each other. The new approach is an attempt to figure it out
based on the unsolicited events we are receiving from rild.

It's still possible to exlicitely choose the variant (e.g. mtk2)
2018-02-22 22:59:54 +02:00
Slava Monich
0e87392c90 phonebook: Fixed double deletion of merge_list 2018-02-22 22:58:32 +02:00
Slava Monich
dab76692db Merge branch 'uuid_sub' into 'master'
Fix UICC subscription

See merge request !173
2018-02-22 12:32:20 +00:00
Slava Monich
21bc90f638 [ril] Fix UICC subscription. JB#41130
The previous commit slightly broke it. Under certain circumstances
UICC subscription was never attempted.
2018-02-21 16:18:50 +02:00
Slava Monich
d8707d52be Merge branch 'uicc_sub_stop' into 'master'
Support for dual-IMSI SIMs

When subscription gets switched via STK, rild generates SIM_REFRESH
event and we need  to reinitialize the SIM, i.e. re-read all the
EFs, at least under GSM/Telecom DF. Currently, reinitialization
is performed by simulating a SIM swap. That, however, has an
unpleasant side effect - the phones which don't support hot-swap
ask the user to reboot the phone (in this case, unnecessarily).

A better way of reinitializing the SIM should be implemented,
which wouldn't generate this misleading warning, but in the
meantime let's merge this one because it at least appears to work.

See merge request !172
2018-02-20 13:33:00 +00:00
Slava Monich
fa0abf892d [ril] Give SIM card 10 seconds to activate USIM app. JB#41130
And only then poke rild with SET_UICC_SUBSCRIPTION request.
2018-02-20 13:25:45 +02:00
Slava Monich
8a28d4eea8 [ril] A better way to reset the SIM state
It's better to simulate SIM card removal at RilSimCard level.
That way the presence of the SIM card won't be reported until
we fetch the actual SIM status (which may require a few retries
if the reset was initiated by STK).
2018-02-15 18:05:33 +02:00
Slava Monich
4f0be99683 [gprs] Disable special treatment of LTE
In Sailfish OS the Attached flag is used by connman to check whether
context activation is possible. There won't be any context activation
if Attached stays false.
2018-02-15 18:03:42 +02:00
Slava Monich
95933beb2d [ril] Handle RIL_UNSOL_SIM_REFRESH 2018-02-15 12:33:55 +02:00
Slava Monich
018a712e29 [ril] Make sure that SET_UICC_SUBSCRIPTION is not repeated forever. 2018-02-12 16:52:08 +03:00
Slava Monich
e6777f1ecc Merge branch 'cbs' into 'master'
Make CBS support configurable

See merge request !171
2018-02-09 13:49:40 +00:00
Slava Monich
a58e1a5e9b [ril] Make CBS support configurable. Fixes MER#1873
By default it's enabled. To disable CBS, set enableCellBroadcast=false
in /etc/ofono/ril_subscription.conf
2018-02-09 01:20:24 +03:00
Slava Monich
61be41240f Merge branch 'mtk_call' into 'master'
Handle INCOMING_CALL_INDICATION event

See merge request !170
2018-01-30 10:46:03 +00:00
Slava Monich
dbb40560c6 [mtk] Handle INCOMING_CALL_INDICATION event. JB#40950
MTK RILs (at least some of them) are not bothering to submit
the standard CALL_STATE_CHANGED event when a new incoming call
is received. Let's do it for them.

Even if they suddenly change their mind and start sending
CALL_STATE_CHANGED events, there's no harm in receiving
multiple events - we will handle that just fine.
2018-01-29 18:41:09 +02:00
Slava Monich
9bf50bb3e3 Merge branch 'mtk_4g' into 'master'
Make 4G work on MTK tablet

See merge request !169
2018-01-29 15:08:06 +00:00
Slava Monich
d2353c46a8 [ril] Make 4G work on MTK tablet. Fixes JB#40923
It seems to require initial attach APN to be set before it can
register with a 4G network.
2018-01-29 16:56:28 +02:00
Slava Monich
6701b53737 Merge branch 'mtk_reg' into 'master'
Poll registration state on PS_NETWORK_STATE_CHANGED

See merge request !168
2018-01-26 09:45:20 +00:00
Slava Monich
6612bfa1da [ril] Poll registration state on PS_NETWORK_STATE_CHANGED. Fixes JB#40937
MTK rild appears to send this event (with 3 integers as the payload),
whenever data registration state changes. That's a good time to poll
the current state.
2018-01-26 01:21:07 +02:00
Slava Monich
c732d5192d [unit] Added test-sailfish_watch
Tests sailfish_watch.c

  Lines:     336/336 100.0 %
  Functions:   52/52 100.0 %
  Branches:  142/180  78.9 %
2018-01-24 23:20:39 +02:00
Slava Monich
6815772b17 [ofono] sailfish_watch should reset online flag when modem is removed 2018-01-24 23:17:22 +02:00
Slava Monich
e4766ef2c4 [rpm] Made dbus unit tests work with older versions of dbus (e.g. 1.6) 2018-01-24 15:57:15 +02:00
Slava Monich
7aa396636b Merge branch 'cid' into 'master'
Use the right cid to signal context settings change

See merge request !167
2018-01-24 09:08:31 +00:00
Slava Monich
096cd04044 [ril] Use the right cid to signal context settings change. Fixes JB#40845 2018-01-23 18:19:35 +02:00
Slava Monich
5eabe96602 [ril] INT_MAX -> SAILFISH_CELL_INVALID_VALUE where appropriate
They are numerically equivalent but the latter has a clearer semantics.
2018-01-23 17:51:56 +02:00
Slava Monich
05dec021c0 [ril] Updated netmon implementation
Report new values which appeared in 1.21
Don't report invalid values
2018-01-23 13:58:46 +02:00
Slava Monich
6f7209b045 Merge branch 'v1.21' into 'master'
Upgrade ofono baseline to 1.21

See merge request !166
2018-01-23 10:49:29 +00:00
Slava Monich
a766281a02 [ofono] Upgrade baseline to 1.21. Fixes JB#40876 2018-01-23 12:28:48 +02:00
Marcel Holtmann
13b4802bec Release 1.21 2018-01-23 12:25:39 +02:00
Christophe Ronco
e1547fdaf4 huawei: add LTE support
Huawei LTE modems use AT^SYSCFGEX and AT^SYSINFOEX instead of
AT^SYSCFG and AT^SYSINFO.
If we want to be able to attach on LTE with this modem, we must use
AT^SYSCFGEX to configure rat mode and band. Using AT^SYSCFG, mode any
means UMTS or GSM.
2018-01-23 12:25:39 +02:00
Ankit Navik
08c36b2885 udevng/xmm7xxx: Allow to detect xmm7xxx series modems
The Intel xmm7xxx series modem uses id as 8087:0930
2018-01-23 12:25:39 +02:00
Ankit Navik
0180c9febf Add support for Intel xmm7xxx series modems
This adds plugin for xmm7xxx series modems

Conflicts:
	ofono/Makefile.am
2018-01-23 12:25:36 +02:00
Denis Kenzior
49034cfc69 ifxmodem: Fix minor style issues 2018-01-23 12:14:49 +02:00
Ankit Navik
4685e3f0de ifxmodem: support automatic context activation
Add support for automatic context activation by adding read_settings.
It also adds detach_shutdown to make sure context is cleaned up when
network registration is lost.
2018-01-23 12:14:49 +02:00
Ankit Navik
72be5bdff2 atutil: Add logic for cgcontrdp to get address and netmask 2018-01-23 12:14:49 +02:00
Jonas Bonn
79c1abfdd3 gobi: create NetworkMonitor atom 2018-01-23 12:14:49 +02:00
Jonas Bonn
c88cffaa2e qmi: add NetworkMonitor interface
This is a rudimentary implementation that contains technology and RSSI
and BitErrorRate, plus RSRQ/RSRP for LTE networks.  More data can be
added as needed.

This implementations uses the 'Get Signal Strength' QMI method to retrieve
the data.  Operator fields (MNC, LAC, etc) can be gotten from the 'Serving
Cell' method if needed, but since this data is already provided in the
NetworkRegistration object it doesn't seem necessary to repeat it here
when an additional communication to the modem is required.
2018-01-23 12:14:49 +02:00
Jonas Bonn
17e66090ec Fix out of tree build 2018-01-23 12:14:49 +02:00
Denis Kenzior
100cf7df1d AUTHORS: Mention Joey's contributions 2018-01-23 12:14:49 +02:00
Joey Hewitt
280ed19215 gobi: enable message waiting atom 2018-01-23 12:14:49 +02:00
Joey Hewitt
ae0f5b0ff6 qmimodem: implement SIM write functions 2018-01-23 12:14:49 +02:00
Nishanth V
dbfc642eb3 netmonagent: fix unnecessary function declaration 2018-01-23 12:14:49 +02:00
Jonas Bonn
e5e5108913 udev: isi modems do not use 'Device' property
Neither the n900 nor u8500 drivers use this property so there's currently
no need to set it in the setup function.
2018-01-23 12:14:49 +02:00
Jonas Bonn
9035db3129 udev: fixes for detection of non-USB modems
This patch fixes up some fallout from the merging of the udev and udevng
modules.

i)  The 'serial' modems in question are not necessarily serial modems at
all; for example, the N900 ISI modems appear as network devices and don't
have a devnode.  This patch relaxes the requirement that a devnode exist.

ii)  The modem driver was being set to 'legacy', which is a remnant of
an earlier approach to merging these modules.  The driver needs to be
properly set to the value of the OFONO_DRIVER property in order for the
setup function to be found.

iii)  The serial modem's private data was being added to the modem
structure incorrectly...

In particular point iii) above shows that there is essentially nobody
using these devices which makes modifications in this area tricky.
2018-01-23 12:14:49 +02:00
Alexander Couzens
81391a4101 qmimodem: register callbacks after netreg_register
When registering callbacks before ofono_netreg_register(), callbacks
will use the netreg api which might lead into undefined behaviour,
because certain fields aren't yet initilized.
2018-01-23 12:14:49 +02:00
Alexander Couzens
60d449c01d network.c: notify_status_watches: check for NULL
In rare cases when ofono_netreg_status_notify() is called before
ofono_netreg_register() netreg->status_watches is NULL.
2018-01-23 12:14:49 +02:00
Nishanth V
b0ccc39866 rilmodem: netmon fix missing notify for g_ril_send 2018-01-23 12:14:49 +02:00
Clayton Craft
bd2aa28405 isimodem: Use correct callback for pin status 2018-01-23 12:14:49 +02:00
Denis Kenzior
67e31bb519 doc: Mark ServingCellInformationChanged as noreply 2018-01-23 12:14:49 +02:00
Denis Kenzior
b848827976 netmonagent: Fix typo 2018-01-23 12:14:49 +02:00
Nishanth V
ab6764dcc0 test: added script to test serving cell agent 2018-01-23 12:14:49 +02:00
Nishanth V
da42039c80 rilmodem: driver changes for netmon agent
Rilmodem driver updated to handle enabling
and disabling periodic serving cell updates
2018-01-23 12:14:49 +02:00
Nishanth V
392c00c65e gril: added RIL constants for cell info list
added RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE and
RIL_UNSOL_CELL_INFO_LIST and corresponding string
conversion
2018-01-23 12:14:49 +02:00
Nishanth V
7a0fe98d95 netmon: core changes for network monitor agent
Added implementation for RegisterAgent and UnregisterAgent in
NetworkMonitor interface and added netmonagent source file for agent
implemention.

Conflicts:
	ofono/src/ofono.conf
2018-01-23 12:14:45 +02:00
Nishanth V
d508a2f2bb include: added NetworkMonitorAgent interface 2018-01-23 12:09:01 +02:00
Nishanth V
8f070cf583 include: added enable_periodic_update in netmon driver
Defining new method in ofono_netmon_driver,
enable_periodic_update useful to get periodic update
on serving cell information.
2018-01-23 12:09:01 +02:00
Nishanth V
d2d8117723 netmon: modified api.txt for network monitor agent
added new DBUS methods RegisterAgent and UnregisterAgent to
Networkmonitor interface so that any client of ofono can register for
serving cell updates. Added new agent interface NetworkMonitorAgent
with two methods, ServingCellInformationChanged and Release.
2018-01-23 12:09:01 +02:00
Denis Kenzior
6897e57353 AUTHORS: Mention Clayton's contributions 2018-01-23 12:09:01 +02:00
Clayton Craft
6a8c2aa9c1 gril: Fix compilation on armhf/Musl
The following patch is needed to successfully build ofono on armhf with
musl (in place of libc)
2018-01-23 12:09:01 +02:00
Clayton Craft
076e388d45 plugins: Fix compilation on armhf/Musl
The following patch is needed to successfully build ofono on armhf with
musl (in place of libc)
2018-01-23 12:09:01 +02:00
Jonas Bonn
bcafe0dc3d udev: fix quectelqmi gps interface
Using location-reporting requires both the 'aux' and 'gps' interfaces;
the GPS interface is interface 1, not 2.
2018-01-23 12:09:01 +02:00
Denis Kenzior
9272075f55 qmimodem: Fix whitespace issue 2018-01-23 12:09:01 +02:00
Jonas Bonn
526072d7a3 doc: RSSI is also an LTE property 2018-01-23 12:09:01 +02:00
Jonas Bonn
0680063527 qmi: provide AvailableTechnologies in radio-settings
This provides the list of available technologies in the radio-settings
atom.  The list is queried by the DMS Get Capabilities method; ofono
takes care of caching the available technologies for us so we don't need
to worry about this method being called excessively.
2018-01-23 12:09:01 +02:00
Alexander Couzens
4e08680e5f voicecall: use ofono_call_status_name in DBG messages
status names are more readable then integer values.
2018-01-23 12:09:01 +02:00
Alexander Couzens
1d85caa7f9 voicecall,common: move call_status_to_string() to common
call_status_to_string() is useful for debug output.
Change signature to contain enum call_status
Replace default case to get compiler warning when new enums added
2018-01-23 12:09:01 +02:00
Alexander Couzens
db0ef91c81 plugins/udevng: use else if instead of if
The same variable is checked in two `if's.
2018-01-23 12:09:01 +02:00
Alexander Couzens
54d8c78a50 gprs: use registration_status_to_string in debug messages 2018-01-23 12:09:01 +02:00
Alexander Couzens
905c886269 qmimodem: extract network time from serving system 2018-01-23 12:09:01 +02:00
Alexander Couzens
f0c7a373ae qmimodem: add strength (in %) to the debug output 2018-01-23 12:09:01 +02:00
Alexander Couzens
4673da16d5 udevng: use first cdc-wdm interface for sierra qmi
Using the voice firmware on a mc7304 the modem
stopped accepting qmi messages on the second
cdc-wdm interface.
2018-01-23 12:09:01 +02:00
Jonas Bonn
0dc2acee4e qmi: add helper to get int16_t result 2018-01-23 12:09:01 +02:00
Jonas Bonn
f749284029 qmi: implement RAT selection
The QMI radio-settings atom was just a skeleton and did not even implement
the mandtory property TechnologyPreference.  As such, it probably should
never even have been registered for the modem.  Nonetheless, this patch
puts this mandatory property into place.

This is implemented via the 'Set System Selection' method by way of the
'mode' parameter.  This seems to best reflect the intention of the Ofono
API and works as expected when tested with a Quectel EC21.

Some notes:
i)  There is an alternative function called 'Set Technology Preference'
    which provides similar functionality.  This 'technology preference'
    is updated automatically when the 'system selection mode' is modified
    so everything seems to be in order.
ii) For the EC21, switching the underlying technology works seamlessly.
    There are indications, however, that some modems _might_ require a
    reset before changes take effect; that bridge will need to be crossed
    if reached.
2018-01-23 12:09:01 +02:00
Christophe Ronco
778b9f08aa atmodem: correctly report lte bearer for huawei modems 2018-01-23 12:09:01 +02:00
Ankit Navik
40db3f7067 Add support for Intel xmm7xxx series modem driver
This adds driver as xmm7modem for radio-settings
2018-01-23 12:09:01 +02:00
Ankit Navik
e198cf04c0 atmodem: Add lte atom driver
Adds atmodem driver for setting the default APN command.
The default APN is manage by config storage.
2018-01-23 12:09:01 +02:00
Alexander Couzens
fbd59ba56f common: move strlen(apn) check into is_valid_apn() 2018-01-23 12:09:01 +02:00
Alexander Couzens
cff9ded7e6 include/gprs-context.h: declare struct ofono_modem
Fix a warning.
./include/gprs-context.h:99:61: error: ‘struct ofono_modem’ declared
inside parameter list will not be visible outside of this definition
or declaration...
2018-01-23 12:09:01 +02:00
Denis Kenzior
c74386b5e6 AUTHORS: Mention Matthijs' contributions 2018-01-23 12:08:51 +02:00
Matthijs Kooijman
028f54c26f at/cdma/ifxmodem: Use /dev/net/tun to check for TUN support
Previously, these drivers would check /sys/devices/virtual/misc/tun to
see if TUN is supported, and bail out otherwise. However, the tun module
can sometimes be autoloaded by opening the /dev/net/tun file. In this
case the /dev file already exists, but the /sys file only gets created
after the modul is loaded.

Additionally, the ppp code does not use the /sys file, but only the
/dev file, so checking for the existence of the latter seems a better
indicator of expected success.
2018-01-23 12:08:50 +02:00
Alexander Couzens
c066f34ea1 qmi/sms: require WMS version >= 1.2 for bearer calls
I've never seen a major 0 service. The gobi2000 comes with
WMS 1.0 and doesn't support the bearer command. Guessing
it's 1.2 required.
2018-01-23 12:08:50 +02:00
Denis Kenzior
b1c79d5cae include: Add a quote from primary source document 2018-01-23 12:08:37 +02:00
Alexander Couzens
0cc61dcfe8 gprs-context: set apn length to 100 bytes
According to ETSI TS 123 003 version 9.15.0 Chapter 9.1
2018-01-23 12:08:37 +02:00
Alexander Couzens
5852bebda0 qmimodem: use a default RAT when registering
When registering to an operator ofono uses the old RAT.
In the case the modem is not connected to any network, this would use
QMI_NAS_NETWORK_RAT_NONE which results in the error OP_DEVICE_UNSUPPORTED.

Use QMI_NAS_NETWORK_RAT_NO_CHANGE instead to not define any preference.
2018-01-23 12:08:21 +02:00
Alexander Couzens
768c028a11 plugins: Remove AllowedAccessPoints interface
Without this patch, a modem that has been removed still shows the
AllowedAccessPoints interface
2018-01-23 12:08:21 +02:00
Alexander Couzens
6b93ea0cc6 voicecall.h: declare struct ofono_modem
Fix a warning when only voicecall.h is included:
'struct ofono_modem declared' inside parameter list will not be visible
outside of this definition or declaration struct ofono_voicecall
*ofono_voicecall_create(struct ofono_modem *modem,...
2018-01-23 12:08:21 +02:00
John Ernberg
4a485a7aa0 radio-settings: Fix typo in radio_band_umts_from_string 2018-01-23 12:08:21 +02:00
Marcel Holtmann
f6fb277cf4 build: Don't report format truncation as warnings 2018-01-23 12:08:21 +02:00
Marcel Holtmann
03f150838b ril_intel: Fix wrong pointer derference for power status 2018-01-23 12:08:21 +02:00
Marcel Holtmann
9731ca1a87 ublox: Add missing break statement 2018-01-23 12:08:21 +02:00
Marcel Holtmann
a09f4c070d u8500: Add missing fall through statement 2018-01-23 12:08:21 +02:00
Marcel Holtmann
f018f5a255 phonebook: Add missing fall through statement 2018-01-23 12:08:21 +02:00
Marcel Holtmann
286396bf91 voicecall: Reword fall through statement to avoid compiler warning 2018-01-23 12:08:21 +02:00
Marcel Holtmann
5d6baccced stk: Add missing break statement for inkey duration 2018-01-23 12:08:21 +02:00
Marcel Holtmann
514f4cf9cc gatchat: Reword the fall through cases to avoid compiler warnings 2018-01-23 12:08:21 +02:00
Marcel Holtmann
ff8408e6dd ifxmodem: Fix GPRS activation command string buffer size 2018-01-23 12:08:21 +02:00
Marcel Holtmann
df1294d77c telitmodem: Fix GPRS activation command string buffer size 2018-01-23 12:08:21 +02:00
Marcel Holtmann
2323ebacb3 atmodem: Fix missing break statement for ublox driver 2018-01-23 12:08:21 +02:00
Alexander Couzens
c780eff0ce qmimodem/sms: don't check for free ME space on receive
If the ME storage is full, the modem will reject new messages
with a SMPP RP-Error 'Protocol error, unspecific'.
It seems the qmimodem is first checking the ME storage for
free space, then deliver the SMS via QMI and not saving it
to the ME anyway.
Using QMI_WMS_STORAGE_TYPE_NONE it doesn't check for free space.

Tested-on: Quectel EC20
2018-01-23 12:07:55 +02:00
Alexander Couzens
373248a35b qmimodem: add debug helper qmi_result_print_tlvs
qmi_result_print_tlvs prints the type and length field
of a result to DBG()
2018-01-23 12:07:55 +02:00
Vincent Cesson
fe219b648d gemalto: Implement HardwareMonitor method
Use Gemalto commands ^SCTM and ^SBV to monitor temperature and voltage.
Use a single method GetStatistics to read and return both values.
2018-01-23 12:07:55 +02:00
Denis Kenzior
33f55c569f build: Add cinterion-hardware-monitor-api.txt 2018-01-23 12:07:55 +02:00
Vincent Cesson
d6cf954354 doc: gemalto: add cinterion.HardwareMonitor api
add documentation about interface cinterion.HardwareMonitor.

This interface exposes a single method to access temperature and supply
voltage of the modem.
2018-01-23 12:07:55 +02:00
Vincent Cesson
d8e852cb5e gemalto: Prepare new interface for hardware monitoring
Gemalto modems have hardware related commands, allowing to monitor voltage
and temperature. These parameters will be accessible on DBus interface:
org.ofono.HardwareMonitor.

 - Create the DBus method table with one entry: GetStatistics. This method
would return temperature and voltage values.
 - Create a dedicated structure to handle the DBus methods.
 - Create enable/disable functions to handle DBus interface registration.
2018-01-23 12:07:55 +02:00
Denis Kenzior
83e3ec0e98 qmi: Fix invalid memory access
When qmi_device_shutdown is used and the callback provided utilizes
qmi_device_unref, an access into already freed memory is triggered.

Sequence of events is:

1. timeout fires
2. glib calls timeout callback (e.g. shutdown_callback) which in turn
calls shutdown_func (gobi shutdown_cb) which in turn calls
qmi_device_unref()
3. qmi_device_unref calls g_source_remove, which doesn't call the
destroy callback (it is blocked)
4. qmi_device_unref then frees the memory used by device
5. glib then calls the source destroy callback (e.g. shutdown_destroy)
which results in just freed memory being used.

glib appears to always call the destroy callback, even if the source has
been removed previously.  So to work around the issue, delay the actual
g_free until the destroy callback is invoked.
2018-01-23 12:06:41 +02:00
Denis Kenzior
e35f537f72 gprs: Don't use pri_set_apn for auto activated cids
There are two problems with using pri_set_apn.  The first issue is that
this function was built to be used by the set_property handler and
assumes the presence of a pending DBusMessage.

The second issue is that it touches the settings store.

In the case of auto-activated contexts no pending message exists.  Also,
we should not be touching the settings store as the APN might
potentially be a value that has not been provisioned.  Or in some cases
bogus.
2018-01-23 12:06:41 +02:00
Denis Kenzior
c7daf5aa43 gprs: Return after releasing pri_ctx 2018-01-23 12:06:41 +02:00
Slava Monich
490a9c06f4 [unit] Improved ril_util.c test coverage 2018-01-22 11:57:17 +02:00
Slava Monich
320b3f4605 Merge branch 'sim_info' into 'master'
A few corner cases for cached SIM info

See merge request !165
2018-01-22 09:40:40 +00:00
Slava Monich
e35dae17d9 Merge branch 'aid_pin' into 'master'
Don't require AID for SIM pin requests

See merge request !164
2018-01-22 09:39:55 +00:00
Slava Monich
f4522f4a00 [unit] Added test-sailfish_sim_info_dbus
Tests sailfish_sim_info_dbus.c

  Lines:     93/96  96.9 %
  Functions: 16/16 100.0 %
  Branches:  16/20  80.0 %
2018-01-22 02:02:29 +02:00
Slava Monich
ce85c94426 [unit] Improved test coverage for sailfish_sim_info.c 2018-01-21 20:03:40 +02:00
Slava Monich
4027bdc04e [ril] A few corner cases for cached SIM info
Cached SPN needs to be reset too when SIM card is removed.
2018-01-21 20:02:10 +02:00
Slava Monich
c57f99bf01 [ril] Don't require AID for SIM pin requests. Fixes JB#40837
Some adaptations (namely, MTK) don't provide AID for GSM app but
don't seem to require it either.
2018-01-19 20:56:15 +02:00
Slava Monich
54d610ce6a Merge branch 'vendor' into 'master'
MTK support

See merge request !156
2018-01-18 21:34:14 +00:00
Slava Monich
f7f9e32743 unit: Improve idmap.c unit test coverage
This brings function, line and branch coverage for idmap.c to 100%
2018-01-18 23:29:21 +02:00
Slava Monich
8c9e370486 [ril] Support for vendor extensions. JB#39612 2018-01-18 17:34:41 +02:00
Slava Monich
19b80236f6 [ofono] gprs: Add __ofono_gprs_context_settings_by_type 2018-01-18 17:34:40 +02:00
Slava Monich
2ec6fc749d [unit] Added test-sailfish_cell_info_dbus
Tests sailfish_cell_info_dbus.c

  Lines:     215/220  97.7 %
  Functions: 25/25   100.0 %
  Branches:  72/88    81.8 %
2018-01-18 13:34:41 +02:00
Slava Monich
0a3bdd20f4 [ril] Validate dbus_bool_t
libdbus crashes and burns when boolean value is not 0 or 1
2018-01-18 13:27:46 +02:00
Slava Monich
284919e76a Merge branch 'jb40756' into 'master'
Don't repeat cell info requests indefinitely

See merge request !163
2018-01-17 15:14:20 +00:00
Slava Monich
ddcbb89fa1 [ril] Don't repeat cell info requests indefinitely. Fixes JB#40756
If they fail, they typically keep on failing forever. Repeating the
requests doesn't do any good, it's just draining the battery.
2018-01-17 17:11:59 +02:00
Slava Monich
5ec6b8e7ec [test] Improve sailfish_manager.c test coverage 2018-01-04 12:09:34 +02:00
Slava Monich
f94681f6f6 Merge branch 'iccid_watch' into 'master'
Properly reset cached SIM info after removal

See merge request !162
2018-01-04 10:08:35 +00:00
Slava Monich
de8edc84fa [ofono] Properly reset cached SIM info after removal. Fixes JB#39810
sailfish_watch expected to be notified by ofono of every ICCID or IMSI
change, however it wasn't happening when SIM card was getting removed.
That messed things up.
2018-01-03 16:45:39 +02:00
Slava Monich
90faf1b3a5 Merge branch 'fac_timeout' into 'master'
Make sure SIM_IO and QUERY_FACILITY_LOCK requests get completed

See merge request !161
2018-01-02 09:40:11 +00:00
Slava Monich
2b139b6974 [ril] Make sure SIM_IO and QUERY_FACILITY_LOCK get completed
ofono becomes very unhappy if they don't. Also, completion
is required in order to eventually reset SIM I/O active flag.
If doesn't make sense to keep it on forever.
2017-12-25 18:23:57 +02:00
Slava Monich
168f193efb Merge branch 'refresh' into 'master'
Handle SIM reset

See merge request !160
2017-12-08 21:09:15 +00:00
Slava Monich
32d8b5ccfc sim: Don't submit parallel EFpl reads
In addition to not doing unnecessary SIM I/O, this fixes memory leaks
like this one:

==10096== 74 (56 direct, 18 indirect) bytes in 2 blocks are definitely lost in loss record 1,252 of 1,342
==10096==    at 0x4841BF0: calloc (vg_replace_malloc.c)
==10096==    by 0x4B03117: g_malloc0 (gmem.c)
==10096==    by 0xF83DF: concat_lang_prefs (sim.c)
==10096==    by 0xF8697: sim_efpl_read_cb (sim.c)
==10096==    by 0x12CBF7: sim_fs_op_read_block_cb (simfs.c)
2017-12-09 00:06:26 +03:00
Slava Monich
f400ceff80 Merge branch 'sms-filter-api-version' into 'master'
sms-filter: Add api_version field

See merge request !159
2017-12-08 12:37:05 +00:00
Slava Monich
2186c60630 [ril] Handle SIM reset. Fixes JB#40010
This happens when we receive a proactive Refresh command from SIM Tookit
which is generated by some SIMs when people are moving between home and
roaming networks.
2017-12-08 15:26:44 +03:00
Slava Monich
d5fb195e2f [ofono] sms-filter: Added api_version field. JB#37478
This makes it possible to keep using old plugins even if
struct ofono_sms_filter gets extended with new callbacks.
2017-12-08 15:22:16 +03:00
Slava Monich
cbb08079d2 [ril] Housekeeping
Removed some unused stuff
2017-12-07 17:23:22 +03:00
Slava Monich
0583a831fb Merge branch 'sfos_bt_crash' into 'master'
Handle multiple EMULATOR_HFP atoms

See merge request !158
2017-12-01 15:02:32 +00:00
Slava Monich
a8a0758e90 [sailfish_bt] Handle multiple EMULATOR_HFP atoms. Fixes JB#40530
It appears that in some rare cases a new (second) instance can be
created before the old one is destroyed. This was causing a crash.
2017-12-01 16:44:57 +02:00
Slava Monich
9e267487f4 Merge branch 'devel' into 'master'
Add more stuff to ofono devel package

See merge request !157
2017-11-27 20:15:16 +00:00
Slava Monich
c8a774dfee [ofono] Add gdbus.h to the devel package. JB#37478
External (dynamically loadable) plugins need it.
2017-11-27 21:53:25 +02:00
Slava Monich
b88518d0f3 [ofono] Adapt Sailfish OS plugins to newly introduced <ofono/storage.h> 2017-11-27 21:53:25 +02:00
Slava Monich
b223ccc675 storage: Implement ofono_config_dir and ofono_storage_dir 2017-11-27 21:53:25 +02:00
Slava Monich
947a41a5fc include: Add storage.h
To expose ofono directories to dynamically loadable plugins.

Conflicts:
	ofono/Makefile.am
2017-11-27 21:53:25 +02:00
Slava Monich
e0b4e8694d [ril] Fixed a few compilation warnings 2017-11-14 12:47:49 +02:00
Slava Monich
c8db770c99 [ril] Don't retry REQUEST_GET_CURRENT_CALLS on RADIO_NOT_AVAILABLE
Assume that in this case there's no active voice calls.
2017-11-14 12:41:08 +02:00
Slava Monich
1534143e31 [ril] Don't retry REQUEST_DATA_CALL_LIST on RADIO_NOT_AVAILABLE
Assume that in this case there's no active calls.
2017-11-14 12:38:49 +02:00
Slava Monich
d9ad9caf30 Merge branch 'get_imei' into 'master'
Add legacyImeiQuery configuration option.

See merge request !155
2017-11-14 10:33:56 +00:00
Slava Monich
71de574e87 [ril] Added legacyImeiQuery configuration option. JB#39612
MTK ril doesn't understand RIL_REQUEST_DEVICE_IDENTITY
2017-11-13 22:28:31 +02:00
Slava Monich
11efbd68e6 Bumped spec version to 1.20 2017-11-08 20:48:38 +03:00
Slava Monich
9981f07797 Merge branch 'v1.20' into 'master'
[ofono] Upgrade baseline to 1.20. Fixes JB#40330

See merge request !153
2017-11-08 17:47:17 +00:00
Marcel Holtmann
24733f776e Release 1.20 2017-11-08 18:20:52 +03:00
Alexander Couzens
50ec234239 plugins/gobi: add the qmi type to the debug output of discover_cb() 2017-11-08 18:20:52 +03:00
Alexander Couzens
b4991076c6 udevng/gobi: allow to detect ec20 tty devices
The Quectel EC20 uses the same usb id as some gobi 2000 modules (05c6:9215).
2017-11-08 18:20:52 +03:00
Alexander Couzens
8b02884696 udevng/gobi: use subsystem as first identification
Using kernel 4.10 with systemd 232 on archlinux the detection of
a gobi 2000 doesn't detect the qmi/cdc-wdm interface.

The device is detected as follows:

[devnode interface number label sysattr subsystem]
/dev/cdc-wdm1 255/255/255 00 (null) (null) usbmisc
wwan1 255/255/255 00 (null) (null) net
/dev/ttyUSB5 255/255/255 01 (null) (null) tty
/dev/ttyUSB6 255/255/255 02 (null) (null) tty
/dev/ttyUSB7 255/255/255 03 (null) (null) tty
2017-11-08 18:20:52 +03:00
Alexander Couzens
8e224a21f6 udevng/gobi: improve debug output
Add info->sysattr and info->subsystem to the log message.
2017-11-08 18:20:52 +03:00
Luiz Augusto von Dentz
96e191b2d2 handsfree-audio: Add Acquire implementation
This adds Acquire method which can be used by agents that require
pulling the fd directly instead of waiting a NewConnection.
2017-11-08 18:20:52 +03:00
Luiz Augusto von Dentz
7ae3aad622 doc/handsfree-audio-api: Add Acquire method
This adds Acquire method which can be used by agents that require
pulling the fd directly instead of waiting a NewConnection.

Note: sounds servers like PulseAudio do auto suspend streams when idle
for a certain amount of time and once anything happens it will resume
the stream, though this all happens in the so called IO thread in a
blocking fashion making it impossible to receive the fd via NewConnetion
causing the stream to fail to resume. There are other forms to work
around but this seems to be most convenient as we do want the auto
suspend feature to work properly but letting the stream to fail to
resume may create unexpected artifacts while the NewConnection is
handled in main thread.
2017-11-08 18:20:52 +03:00
Luiz Augusto von Dentz
3d5d88241e hfp_hf_bluez5: Rework code handling device changes
This splits the handling of device changes and modem registration so
they can be uses separately.
2017-11-08 18:20:52 +03:00
Jonas Bonn
31e62567e6 qmimodem: set APN for LTE default bearer
Apparently, an empty APN in an ofono context means that that the context
cannot be activated.  connman definitely interprets it this way.

This patch sets a default name of "automatic" for the default bearer if
no other LTE APN is supplied (which is currently the case as the LTE
atom is not in place yet).  Without this, connman happily ignores the
context, even though it has been activated by ofono.
2017-11-08 18:20:52 +03:00
Jonas Bonn
8c3127ef21 qmi: activate default bearer context for LTE networks
When the modem attaches to an LTE network, a default bearer is
automatically negotiated using the "defalt profile" settings.  The
QMI modem, however, does not given any explicit indication that
the bearer exists; instead, we must assume its existence based on
the network registration state.

This patch extends the GPRS atom to signal the presence of a
default bearer when it detects network connectivity on an LTE
network.
2017-11-08 18:20:51 +03:00
Jonas Bonn
1c1fc4199e qmi: use named status values 2017-11-08 18:20:51 +03:00
Jonas Bonn
bfe2f95c4c qmi: use shared services
Apparently it's not legal to create a QMI service multiple times for
a device.  I've been testing with a Quectel EC21 and here it works fine
to do so, but the general case would require "shared" services across
atoms.

This patch switches the users of the NAS and WDS services over to using
a "shared" service instead of each instatiating their own instance.
2017-11-08 18:20:51 +03:00
Jonas Bonn
7e4d99236b qmi: watch packet status for spontaneous disconnection only
There are three principal ways for a context to become disconnected:

i)  deactivate_primary() is called
ii)  the network registration is lost and the context is cleaned up
via _detach_shutdown() (via release_all_contexts())
iii) the network decides to disconnect the context

We need to watch the packet status in order to detect case iii).  For
case i) and ii), stop_net will be called, the pkt_handle will be
cleared, and subsequent packet status notifications be ignored.

This patch makes it so that the packet status "disconnected" event
is only propagated when the pkt_handle has not been cleared, indicating
an unrequested disconnection.

This should fix a race reported by Christophe Ronco whereby the packet
status disconnect notification is called between activate_primary
(start_net) and it's callback (start_net_cb).
2017-11-08 18:20:51 +03:00
Luiz Augusto von Dentz
0935a227be hfp_hf: Handle ServicesResolved signal
This adds handling for ServicesResolved signal which tells when BlueZ
is done resolving the device services so the code will no longer ignore
devices that got its services resolved after Paired signal.
2017-11-08 18:20:51 +03:00
Luiz Augusto von Dentz
ffdeb3692c hfp_hf: Fix not creating modem during NewConnection
In case the UUIDs are not updated, as they are still being resolved, when
Paired property changes a modem will never be registered.

In order to fix this problem allow modems to be registered directly
during NewConnection.
2017-11-08 18:20:51 +03:00
Vincent Cesson
627904e382 gemalto: Set vendor for sms atom 2017-11-08 18:20:51 +03:00
Vincent Cesson
0ab0677765 atmodem: Fix SMS reception for Gemalto modems
SMS reception is not working for Gemalto modems because of +CMT parsing.
PDU length is the first argument of +CMT URCs in Gemalto modems.

Add a switch case on vendor info to handle Gemalto case.
Also handle acknowledgment, +CNMA takes only one parameter.

CMT parsing is moved from at_parse_cmt() to at_cmt_notify(). This
function is modified to match the style of at_cmgr_notify() and it
includes a switch case for CINTERION modems.
2017-11-08 18:20:51 +03:00
Jonas Bonn
fe6af108ca Add support for Quectel EC21/25 modems
This follows the same pattern as the Telit QMI modems, routing the
setup through a QMI driver.  I think this can be cleaned up somehow,
but for now this at least provides support for these two modem models
so that others can aid in testing.
2017-11-08 18:20:51 +03:00
Vincent Cesson
650ff3642f gemalto: Use sim_state_query for sim detection
Populate gemalto_data structure.
Add sim_state callbacks.
Fix enable/disable return value.
2017-11-08 18:20:51 +03:00
Jonas Bonn
41d310aa61 qmi: move rat_to_tech() into own module
We want to use this function from multiple atoms so this patch moves
it out to its own module for NAS-related helper functions.
2017-11-08 18:20:51 +03:00
Jonas Bonn
27adf83a4b ofono: add missing header inclusions
This is a "leaf" header and doesn't even have header guards, but
it still seems natural that the header should pull in its own declarations
rather than relying on the including source file to ensure that they
are included.
2017-11-08 18:20:51 +03:00
Jonas Bonn
55d227ba46 qmi: add missing header inclusion 2017-11-08 18:20:51 +03:00
Jonas Bonn
dcc1d366f0 qim: use named status value 2017-11-08 18:20:51 +03:00
Jonas Bonn
83cf94824d qmi: implement detach_shutdown method
The detach_shutdown method is invoked to unconditionally release
an active context.  For QMI, this is equivalent to a call to
deactivate_primary.

This patch makes the callback to deactivate_primary optional and
implements detach_shutdown to simply call it.  When there is no
callback, the stop_net callback notifies ofono about the context
release via an asynchronous ofono_gprs_context_deactivated() call.
2017-11-08 18:20:51 +03:00
Jonas Bonn
3a0c598805 qmi: free cb_data on error
...and move allocation of structure up to variable declarations to
match the pattern used elsewhere in the code.
2017-11-08 18:20:51 +03:00
Jonas Bonn
b098314251 qmi: read_settings needs to call start network
For LTE networks, a default bearer is automatically activated when
the modem registers to the network.  QMI modems, however, do not
automatically enable the network interface just because the bearer
exists; a call to "start network" needs to be made in order to
get the packet handle before get_settings will return any data and
the network interface can be configured.

This patch makes read_settings call "start network" in order to
enable the interface for the default bearer.  No new bearer will
be created with this call and the settings for the bearer will come
from the default profile, irregardless of what parameters are passed
to the "start network" method.
2017-11-08 18:20:51 +03:00
Jonas Bonn
4ae6c6c0b1 gprs: set driver_attached when activating automatic contexts
The ofono_gprs_cid_activated attachment machinery cannot go through
ofono_gprs_status_notify for getting the attached property set because
that would result in the automatic contexts that were just set up
being released.  As such, it needs to call gprs_set_attached_property
manually.  Doing so, however, means that the driver_attached property
never gets set, resulting in all contexts being released when the
network transitions between registered states (roaming/non-roaming).
2017-11-08 18:20:51 +03:00
Jonas Bonn
d5f0f3b32d gprs: _cid_activated is an 'attaching' state
ofono_gprs_status_notify is an asynchronous notification that messes
with the 'attached' state of the GPRS atom.  This method is normally
prevented from running while an attach is in progress because the
attachment machinery wants to finish up and make it's own determination
of attach state.

When automatic context activation is relevant, as for LTE networks,
the ofono_gprs_cid_activated machinery replaces the usual set_attach
machinery for attaching to the network.  The cid_activated variant,
however, does not guard against simulatenous invocations of
ofono_gprs_status_notify.  This causes a race whereby status_notify
sets the state to 'attached' before the context is fully constructed
and set to active.  If the connection manager sees the 'attached'
state before there are any 'active' contexts, it may decide to
activate a context manually which is not the correct behaviour for
this type of network.

This patch makes the *_cid_activated machinery an 'attaching' state,
introducing the same guards that set_attached has to prevent
ofono_gprs_status_notify from running concurrently.
2017-11-08 18:20:51 +03:00
Jonas Bonn
0209e9847b qmi: fix typo 2017-11-08 18:20:51 +03:00
Jonas Bonn
a499ac07ca qmi: duplicate callback data correctly 2017-11-08 18:20:51 +03:00
Vincent Cesson
04342bbe69 gemalto: Change offline mode, keep USIM available
Gemalto has two airplane mode:
CFUN=0 disables USIM
CFUN=4 keeps USIM connected
2017-11-08 18:20:51 +03:00
Vincent Cesson
d0d3e4f2f1 gemalto: Clean post init functions
Remove inappropriate interfaces.
Move GPRS init from post_online to post_sim.
2017-11-08 18:20:51 +03:00
Denis Kenzior
edcbc5c7e3 AUTHORS: Mention Jonas' contributions 2017-11-08 18:20:51 +03:00
Denis Kenzior
1df55e3042 qmi: Use destroy callback for context activate 2017-11-08 18:20:51 +03:00
Denis Kenzior
df93fceb4f qmi: Use destroy callback for context deactivate
This ensures that cbd will be freed even if the device is hot-unplugged.
Also, this fixes a memory leak on the failure path inside stop_net_cb
2017-11-08 18:20:51 +03:00
Jonas Bonn
d21d1a166f qmi: implement read_settings for automatic contexts
For LTE, a context is created automatically when the modem registers
to the network.  The read_settings function is called for these
automatic contexts to get their configuration.
2017-11-08 18:20:51 +03:00
Jonas Bonn
458f905262 qmi: retrieve GPRS context parameters
The GPRS context needs to be configured with connection parameters when
the bearer has been established.  This was only partially implemented, so
this patch adds additional parameters to those passed to the context.
2017-11-08 18:20:51 +03:00
Jonas Bonn
9f474ba723 qmi: add WDS parameter definition 2017-11-08 18:20:51 +03:00
Jonas Bonn
a3b4421422 qmi: NAS definitions adjustment
Calling the ps_state/cs_state alternatives *ATTACH_STATUS* was confusing
because there is also a status field in the *serving_system structure.
This patch does a minor rename and adds the appropriate definitions for
the status field.
2017-11-08 18:20:50 +03:00
Denis Kenzior
28bc1e37ed qmi: Fix qmi_device_shutdown
qmi_device_shutdown allocated a new orphaned data structure and kicked
off a timeout to wait for the shutdown to complete.  The logic was quite
racy, but the main issue was that the timeouts could not be canceled
when the underlying qmi_device object was destroyed.  This resulted in
crashes.

This patch switches to first-past-the-gate mechanism.  Since only the
modem driver should be issuing a qmi_device_shutdown call, this should
not be a limitation.  The shutdown source is then tracked on the
qmi_device object itself and is canceled when the qmi_device object is
freed.

As an added bonus, the shutdown_destroy callback should now actually
function.  Before it was simply never called.
2017-11-08 18:20:50 +03:00
Denis Kenzior
c0b96a4319 qmi: Optimize structure allocations
struct discovery was allocated for every discovery procedure that was
kicked off, which itself allocated a structure.  This patch uses a
class/subclass concept to only allocate a single structure per discovery
procedure.
2017-11-08 18:20:50 +03:00
Jonas Bonn
4296616d00 modem: set_online is valid for AlwaysOnline modems
Calling set_online(TRUE) for an AlwaysOnline modem should succeed; the
modem is, after all, in the requested state when the call returns.
Returning not_implemented is not necessarily wrong, but it's a bit ugly.
2017-11-08 18:20:50 +03:00
Jonas Bonn
3a43f96fe4 qmi: fix bad lookup and double free
This function was never removing discovery instances because it was looking
them up in the wrong list.  This led to some strangeness with the discovery
callbacks being invoked after the "failure" timeout of 5 seconds and
consequent failures with everything getting out of sync.

With this patch we fix the lookup to use the correct queue.  There's also
a double-free in the function that was never being hit before because the
lookups never succeeded; fix that as well.

With this, service discovery and creation work as expected when testing with
an EC21.
2017-11-08 18:20:50 +03:00
Jonas Bonn
b82a1001e2 qmi: add service ID's 2017-11-08 18:20:50 +03:00
Jonas Bonn
84dc7e2016 udevng: remove 'option' driver setup
No driver named 'option' exists so this device can never be instantiated.
2017-11-08 18:20:50 +03:00
Lukasz Nowak
1482728a61 atmodem: telit - re-attach gprs automatically
Telit AT modem firmware (tested with UE910-EUR) generates
+CGREG: 0\r\n\r\n+CGEV: NW DETACH
after a context is de-activated and ppp connection closed.
Then, after a random amount of time (observed from a few seconds
to a few hours), an unsolicited +CGREG: 1 arrives.
Attempt to fix the problem, by sending AT+CGATT=1 once.
This does not re-activate the context, but if a network connection
is still correct, will generate an immediate +CGREG: 1.
2017-11-08 18:20:50 +03:00
Jonas Bonn
428f62041b plugins: remove udev module
This functionality has been moved into the udevng module and was
already disabled in an earlier patch.
2017-11-08 18:20:50 +03:00
Jonas Bonn
4b6ec99973 udevng: get properties from interface
Device properties are generally on the device, on the USB interface
descriptor, or the on the USB device descriptor.
2017-11-08 18:20:50 +03:00
Jonas Bonn
0c01da5378 udevng: hook up legacy devices
...and disable old udev code by shorting it out in it's init() function.

The check_device function is augmented to differentiate between USB
and serial devices:

- if the device sits on a USB bus, the device is handled as before
- if not, an attempt is made to handle the device as a serial device
2017-11-08 18:20:50 +03:00
Jonas Bonn
8004756c3d udevng: match on the hsi subsystem for legacy devices 2017-11-08 18:20:50 +03:00
Jonas Bonn
e01df1a3f1 udevng: add serial device handling functions
This adds, but does not hook up, support for simple serial modems.  These
modems generally have only a single device node so are simpler than the
USB devices which generally have different device nodes for different
functions.  These modems are currently handled by udev.c, but this
functionality will allow to remove that module completely in a later patch.

- A new "device_info" type is created called serial_device_info
- the function add_serial_device sets up a modem_info structure and a
  serial_device_info for the device
- A reference to the device's udev node is saved in the device info
- The device driver is retrieved from the OFONO_DRIVER environment variable
  which needs to be set up by some udev rule
- Setup functions are added for these types of devices: a common function
  setup_serial_modem covers the generic (simple) case, whereas modems
  with special requirements are given their own setup functions to handle
  the special bits
- Modem destroy needs to know the "device_info" type in order to clean
  up properly, so a 'type' value is set on the modem_info structure to
  guide selection of the proper cleanup function
2017-11-08 18:20:50 +03:00
Denis Kenzior
46820a7ba0 qmi: track discovery tasks so clean up is possible
There are various device & service discovery tasks that are initiated
based on a qmi_device object.  qmi_device object does not currently
keep track of these tasks.  Unfortunately the qmi_device object can
go away at any time, and these tasks can become orphaned.

The result of this can lead to crashes.  E.g. a discovery task timeout fires
after the qmi_device object has been destroyed.  Since the object is no
longer valid, any accesses to it will likely result in a SEGFAULT.

This patch attempts to track all discovery tasks on the qmi_device
object itself, so that they can be cleaned up properly.  This patch does
not handle the qmi_device_shutdown functionality.
2017-11-08 18:20:50 +03:00
Lukasz Nowak
0493629a9d unit: rilmodem-test - add missing string.h
Remove warnings of undeclared memcpy, strncpy, etc.
2017-11-08 18:20:50 +03:00
Lukasz Nowak
41b3459a5d udevng: add Telit LE910 V1 support
Tested with LE910-SVG and Verizon.
2017-11-08 18:20:50 +03:00
Jonas Bonn
b27373c8a4 udev: remove extraneous subsystem check
The enumeration construct is already set up with matches for these
subsystems.
2017-11-08 18:20:50 +03:00
Jonas Bonn
b450c8fbe3 udev: simplify wavecom modem registration 2017-11-08 18:20:50 +03:00
Jonas Bonn
1ac24f32e3 udev: simplify ifx modem registration 2017-11-08 18:20:50 +03:00
Jonas Bonn
977fc5bc15 udev: add common modem registration code
Many of these drivers do exactly the same setup when registering
the modem.  Consolidate these setup functions into common code.
2017-11-08 18:20:50 +03:00
Jonas Bonn
787bddf47b udev: simplify add_modem
Adding a modem boils down to finding the device in the hierarchy with
the OFONO_DRIVER property.  The original code special-cased the property
being on the device itself rather than on a parent device.  This patch
combines the two cases.
2017-11-08 18:20:50 +03:00
Jonas Bonn
c32cd532f2 udev: remove unused modem property
The property 'Registered' is not used anywhere.
2017-11-08 18:20:50 +03:00
Jonas Bonn
18f2345124 udev: get udev property via lib function 2017-11-08 18:20:50 +03:00
Jonas Bonn
00b623e8c4 udev: remove extraneous subsystem check
The udev-monitor already guarantees that only devices with these
subsystems will be returned so we don't need to check again.
2017-11-08 18:20:50 +03:00
Jonas Bonn
452108d058 ofono.rules: remove 'change' action
The code doesn't do anything with this action so don't bother setting
extra device properties for it.
2017-11-08 18:20:50 +03:00
Jonas Bonn
6b0712dae4 udevng: simplify logic in check_usb_device
This patch simplifies and cleans up the check_usb_device function a bit
by doing the two following (slightly intertwined) things:

1)  The parent "usb_device" is searched for early in this function and this
device will always have the ID_VENDOR_ID and ID_MODEL_ID properties.
As such, we can get them from this device and thereby be certain that
we _always_ have them available.

2)  The logic of iterating the vendor_list table is cleaned up.  It's
easier to follow and won't be any less efficient.
2017-11-08 18:20:50 +03:00
Jonas Bonn
9a309f499b gobi: query presence of WDA service 2017-11-08 18:20:50 +03:00
Jonas Bonn
a204c993e5 qmimodem: add WDA service string 2017-11-08 18:20:50 +03:00
Jonas Bonn
e881376127 qmimodem: fix typo 2017-11-08 18:20:50 +03:00
Lukasz Nowak
66c98d724c gobi: Do not use low-power modes for some modems
Telit QMI modems have a problem with the low-power operating modes.
After entering and leaving such a state, UIM service does not return.
The sim card is still marked as powered-down. The QMI interface does
not have a way to power it back on.

To avoid this, keep modems with the "AlwaysOnline" flag online
in the disable-modem and offline-modem procedures.
2017-11-08 18:20:49 +03:00
Denis Kenzior
5c38fe6a84 AUTHORS: Mention Lukasz's contributions 2017-11-08 18:20:49 +03:00
Lukasz Nowak
e3bb317504 qmimodem: detect utf-8 string as operator name
Telit QMI modems can return non-utf-8 characters in plmn-desc.
Observed with LE910-SVG and Verizon. When that happens, libdbus
will abort ofono.
If non-utf-8 characters are detected, use mccmnc string.
2017-11-08 18:20:49 +03:00
Lukasz Nowak
713022a7e8 qmimodem: read ss_info at probe time
LTE modems (observed with Telit LE910 V1) can power on
already registered to a network. In that case, the SS_INFO
change notification will never arrive, and the gprs driver
will never be marked as attached.

To avoid this situation, read SS_INFO at probe time, and if
registered, mark the gprs driver as attached.
2017-11-08 18:20:49 +03:00
Denis Kenzior
6b79f32715 qmimodem: Fix warning
This was introduced by the previous patch:
drivers/qmimodem/devinfo.c: In function ‘get_ids_cb’:
drivers/qmimodem/devinfo.c:129:14: error: implicit declaration of function ‘strcmp’ [-Werror=implicit-function-declaration]
  if (!str || strcmp(str, "0") == 0) {
2017-11-08 18:20:49 +03:00
Lukasz Nowak
2386e99ad8 qmimodem: telit LE910 V1 - fix ESN string
Telit QMI modems report "0", rather than a NULL string,
if ESN is not available.
2017-11-08 18:20:49 +03:00
Christophe Ronco
6ca82960c9 huawei: reopen modem channel if it disconnects
On E3372 after a GPRS disconnection, modem AT channel (used by PPP) gets
disconnected (G_IO_HUP and G_IO_ERR are detected in received_data
in gatio.c).
After that all connection attempts fail because we are not able to send
any AT commands on modem channel (it is closed).

With this patch, when this behavior is detected, we close gprs context
driver, reopen AT channel and gprs context driver.
2017-11-08 18:20:49 +03:00
Christophe Ronco
93891578fc provision: add plugin to provision from config file
This plugin allows to provision gprs-context data based on MCC and MNC.
This is useful when provisioning using mbpi fails (either because you
are using a private APN or because there are multiple internet type context
for your operator in mbpi database).
Config file is STORAGEDIR/provisioning.
Config file should look like that:
[operator:MCC1,MNC1]
internet.AccessPointName=apn1
internet.Username=myUsername
internet.Password=myPassword
internet.AuthenticationMethod=pap
internet.Protocol=ipv6
[operator:MCC2,MNC2]
internet.AccessPointName=apn2

The only mandatory parameter for each operator is internet.AccessPointName.

Parameter description:
internet.AccessPointName: APN
internet.Username: Username
internet.Password: Password
internet.AuthenticationMethod: authentication method.
 Possible values are:
  - pap
  - chap
 Default is chap if unset.
internet.Protocol: protocol
 Possible values are:
  - ip: ipv4
  - ipv6
  - dual
 Default is ip if not set.

All parameters are prefixed with internet to be able to extend this plugin
to other type of contexts (MMS, ...).

Conflicts:
	ofono/Makefile.am
	ofono/plugins/file-provision.c
2017-11-08 18:20:49 +03:00
Christophe Ronco
7bcadcd300 qmimodem: fix sim file reading on MC7304
Command read_file_info on MC7304 always fails.
Using qmicli or AT command, I am able to read file info.
Qmicli command is:
qmicli -d /dev/cdc-wdm0 --uim-get-file-attributes=0x3f00,0x7fff,0x6fad
[(null)] Successfully got file '/dev/cdc-wdm0' attributes from the UIM:
Card result:
        SW1: '0x90'
        SW2: '0x00'
File attributes:
        File size: 4
        File ID: 28589
        File type: transparent
        Record size: 0
        Record count: 0
        Read security attributes: (always) (null)
        Write security attributes: (single) adm
        Increase security attributes: (always) (null)
        Deactivate security attributes: (single) adm
        Activate security attributes: (single) adm
        Raw:    62:17:82:02:41:21:83:02:6F:AD:8A:01:05:8B:...

After a check of parameters sent by qmimodem driver and qmicli,
the only difference is on parameter "Session Information".
Session type sent by qmimodem driver is 'Card on slot 1'.
Session type sent by qmicli command is 'primary-gw-provisioning'.
Changing session type in qmimodem driver fixed problem (on this modem).

Comparing with what is done by qmili command
2017-11-08 18:20:49 +03:00
Christophe Ronco
b3f8dc4a24 atmodem: use ATD99 to enter data state when needed
Some modems do not support AT+CGDATA="PPP",X to enter data state.
Use AT+CGDATA=? to detect these modems and for them use ATD*99***X#
to enter data state.
2017-11-08 18:20:49 +03:00
Christophe Ronco
38e3122217 gprs: fix error check of gprs_cid_alloc function
When there is no context id available, idmap_alloc and
gprs_cid_alloc return max + 1.
2017-11-08 18:20:49 +03:00
Piotr Haber
f7de0ab3ef telit: register SIM if it goes straight to ready
SIM without PIN goes straight to state 3 (INSERTED and READY)
on some modem/firmware versions.
2017-11-08 18:20:49 +03:00
Denis Kenzior
defe008062 rilmodem: Fix warning
drivers/rilmodem/stk.c: In function ‘ril_stk_probe’:
drivers/rilmodem/stk.c:210:18: error: ‘data’ is used uninitialized in
this function [-Werror=uninitialized]
  struct cb_data *cbd = cb_data_new(stk, NULL, data);
2017-11-08 18:20:49 +03:00
Denis Kenzior
ec930e17c8 AUTHORS: mention André's contributions 2017-11-08 18:20:49 +03:00
André Draszik
9f1731cffa plugins: telit: send AT&C0 on both channels
At least firmware version 12.00.405 on the UE910-EUR otherwise
closes the AT command port whenever the PPP connection is
dropped, and we'd be left in a funny state.
2017-11-08 18:20:49 +03:00
Antara Borwankar
ed8d55d2d5 ril_intel: Add support for stk 2017-11-08 18:20:49 +03:00
Antara Borwankar
7b6a461b83 rilmodem: Send needed RIL request for stk init
sending RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING after
stk atom is created so that modem will inititialize
sim toolkit by sending terminal profile to sim.
2017-11-08 18:20:49 +03:00
Piotr Haber
3b0ff8fd83 telit: add support for UE866 2017-11-08 18:20:49 +03:00
Piotr Haber
00b5886cf9 udevng: unify telit and xe910
Unified setup for Telit devices using
usbserial and cdc_acm drivers.
2017-11-08 18:20:49 +03:00
Piotr Haber
c16fd4e642 plugins: rename xe910 to telit
Unify old telit and xe910 plugins.
Dropping support for Bluetooth SAP.
Add support for UC864 family.
2017-11-08 18:20:49 +03:00
Christophe Ronco
4b92ac8ba6 qmimodem: change kernel driver data format if needed
During gprs-context driver probe function, check kernel device driver
data format and modem low level data format.
If they are different, align kernel device driver data format on
modem low level data format.
If an error occurs during this process, continue probing without error.
This is inspired by what is done in qmicli and qmi-network (package
libqmi).
2017-11-08 18:20:49 +03:00
Denis Kenzior
5b432b8280 qmi: Fix typo 2017-11-08 18:20:49 +03:00
Christophe Ronco
31aff54463 qmimodem: get/set kernel device driver data format
Add a way to get and set data format expected by kernel device driver.
This is inspired by what is done in qmicli (package libqmi).
It does not use QMI protocol but a sysfs exported by kernel driver.
To use this feature, kernel version must be equal or more than 4.5.
2017-11-08 18:20:49 +03:00
Denis Kenzior
c669ec3c88 tools: Remove unused qmi tool 2017-11-08 18:20:49 +03:00
Piotr Haber
8c2f54abe0 xe910: support for Telit LE910V2 modem
LE910V2 is next generation Telit LTE modem.
It supports 3GPP Rel. 9 LTE Cat. 4 over multiple bands.
2017-11-08 18:20:49 +03:00
Piotr Haber
804121cbed telitmodem: support for CDC-NCM network adapter
Network Control Model is a new Communication Device Class
protocol for exchanging Ethernet frames over USB.
NCM is intended to be used with high-speed network
attachments such as HSDPA and LTE data services.
2017-11-08 18:20:49 +03:00
Piotr Haber
839e626ee6 udevng: setup of Telit LE910V2
Setup LE910V2 in default USB composition (1bc7:0036)
with 6 CDC-ACM serial ports and 1 CDC-NCM network adapter.
2017-11-08 18:20:49 +03:00
Piotr Haber
3a17724136 plugins: Handle HE910 and UE910 variants
Telit modems HE910 and UE910 share the same USB
vendor and device IDs (1bc7:0021) but they are
different devices.
HE910 is HSPA Class 14/6 and UE910 is Class 8/6.
Both come in voice-enabled variants.
HE910 also comes in variants with built-in GPS.
2017-11-08 18:20:49 +03:00
Piotr Haber
7b0c6610e0 plugins: rename he910 to xe910
In preparation for more generic support
of Telit xE910 family.
2017-11-08 18:20:49 +03:00
Piotr Haber
0e0b1e98c5 qmimodem: send authentication credentials
Pass authentication method, user and password
to QMI WDS service.
2017-11-08 18:20:48 +03:00
Piotr Haber
b0975c44b1 doc: description of Telit LE910V2 network setup
NCM network interface on LE910V2 modem needs to be
configured in a specific way after connection is established.
2017-11-08 18:20:48 +03:00
Denis Kenzior
25a6049cf6 doc: Add 'switch' to item M1 2017-11-08 18:20:48 +03:00
Denis Kenzior
02fcbdb245 AUTHORS: Mention Piotr's contributions 2017-11-08 18:20:48 +03:00
Piotr Haber
a3a8ea4183 atmodem: add LTE to Telit #PSNT status parser
Network type of 4 in Telit #PSNT command response
denotes LTE network
2017-11-08 18:20:48 +03:00
Vincent Cesson
92d7fb848b gemalto: Add location reporting support 2017-11-08 18:20:48 +03:00
Vincent Cesson
0b6327a7fc drivers: Add gemaltomodem driver to handle GNSS
Add a new location-reporting driver for Gemalto Cinterion modems based
on telit implementation + use it in gemalto plugin. It supports
activation of GNSS engine (Request) with command AT^SGPSC. This driver
is tested on PHS8. NMEA frames are accessible on /dev/ttyUSB1.
2017-11-08 18:20:48 +03:00
Vincent Cesson
84bd588152 udevng: complete gemalto setup
Complete the Gemalto setup with cdc_wdm and qmi,
so all enumerated devices are associated with gemalto.
2017-11-08 18:20:48 +03:00
Christophe Ronco
9e952cf042 qmimodem: query_passwd_state can be retried
Retry command QMI_UIM_GET_CARD_STATUS during query_passwd_state if a
temporary error status has been detected.
This happens with a MC7430 modem when query_passwd_state is called just
after PIN is entered.
2017-11-08 18:20:48 +03:00
Vincent Cesson
27a1a05aa7 udevng: Add Gemalto P-family detection
Add a new function setup, based on telit, to handle Gemalto P-family
discovery. The setup looks for USB interfaces:
application=/dev/ttyUSB2
gps=/dev/ttyUSB1
modem=/dev/ttyUSB3
2017-11-08 18:20:48 +03:00
Vincent Cesson
657841e2b0 plugins: Add Gemalto plugin for Cinterion P-family
Actual cinterion plugin is not compliant with newer Gemalto modems.
Gemalto plugin is based on cinterion with a custom struct to handle the
interfaces Application and Modem.
2017-11-08 18:20:48 +03:00
Denis Kenzior
02172f6922 AUTHORS: Mention Vincent's contributions 2017-11-08 18:20:48 +03:00
Vincent Cesson
0dd225b594 atmodem: Fix CGDCONT result parsing.
CGDCONT result parsing fails if first list contains several ranges. For
example with modem Cinterion PHS8:

 AT+CGDCONT=?
 +CGDCONT: (1-17,101-116),"IP",,,(0),(0-4)

Solution: read first range and jump to second list instead of trying to
close the brackets.
2017-11-08 18:20:48 +03:00
Christophe Ronco
452d0d4b5a qmimodem: add pin_send feature
Add ability to send PIN to a QMI modem using QMI_UIM_VERIFY_PIN command.
This has been tested on MC7304 and MC7430 modems.
2017-11-08 18:20:48 +03:00
Christophe Ronco
2edae61c0b qmimodem: get password state from modem
Password state and number of retries asked to modem using
QMI_UIM_GET_CARD_STATUS command rather than remembered after initial
QMI_UIM_GET_CARD_STATUS command.
2017-11-08 18:20:48 +03:00
Christophe Ronco
141abd5390 udevng: Sierra modems use SIM driver 2017-11-08 18:20:48 +03:00
Christophe Ronco
22faa0f26a qmimodem: Add read_imsi to qmimodem sim driver
Add read_imsi feature to qmimodem sim driver.
This is based on DMS service.
On MC7430, this is mandatory to be able to use this driver for GPRS
connection because reading IMSI via EF reads fails.
2017-11-08 18:20:48 +03:00
Christophe Ronco
4d2453f3a8 sim: backup driver read_imsi by IMSI via EF read
If read_imsi driver function fails, try to obtain IMSI via EF read
2017-11-08 18:20:48 +03:00
Slava Monich
7a5f52c1f3 sim: Stop facility lock query sequence on removal
SIM card can be removed while the query is in progress. There's
still a remote possibility that SIM card is removed and inserted
back while the query is pending, that would start the second query
sequence and end up invoking sim_initialize() twice. But at least
these checks reduce the probability of something like that happening.
2017-11-08 18:20:48 +03:00
Christophe Ronco
1ad109f8c7 qmimodem: fix QMI notification messages handling
QMI notification messages handlers are never called on MC7430 without this fix.

- Do not test transaction id before calling notification handler.  On MC7430,
notification messages contain a not null transaction id (starts with 1,
increased at each message for a particular client).
- On MC7304 transaction id in notification messages is always 0.
2017-11-08 18:20:48 +03:00
Denis Kenzior
1347755b6f AUTHORS: Mention Christophe's contributions 2017-11-08 18:20:48 +03:00
Christophe Ronco
62253744a7 qmimodem: fix get signal strength
Get current signal strength (type: 0x01), not list of other signals strength
(0x10)

Without this fix:
- I can't get a signal strength on MC7430 because list does not exist
	(only one signal strength).
- On MC7304, result is wrong
2017-11-08 18:20:48 +03:00
Marko Šulejić
9a608210cd atmodem: fix typo 2017-11-08 18:20:48 +03:00
Djalal Harouni
adbfdb23a7 test:netmon: support EARFCN, Eband and CQI in testing scripts 2017-11-08 18:20:48 +03:00
Djalal Harouni
ac5d0abe5e netmon: handle OFONO_NETMON_INFO_{EARFCN|EBAND|CQI} 2017-11-08 18:20:48 +03:00
Djalal Harouni
8dbaaa5efe doc: document netmon EARFCN, EBand and CQI properties
Documentation for:
EARFCN: E-UTRA Absolute Radio Frequency Channel Number.
EBand: E-UTRA operating Band.
CQI: Channel Quality Indicator.
2017-11-08 18:20:48 +03:00
Djalal Harouni
fa1bcc1c19 netmon: add NETMON_INFO_{EARFCN|EBAND|CQI}
Add the following types to use with ublox modems +UCGED command.

EARFCN: E-UTRA Absolute Radio Frequency Channel Number.
EBand: E-UTRA operating Band.
CQI: Channel Quality Indicator.
2017-11-08 18:20:48 +03:00
Antara Borwankar
32138ecd04 ril_intel: changes for lte modem
plugin modified to bring up lte atom and set MODEM_PROP_LTE_CAPABLE
to TRUE
2017-11-08 18:20:48 +03:00
Antara Borwankar
5e999f0b47 ril_intel: renamed ril_sofia3gr to ril_intel
renamed ril_sofia3gr.c to ril_intel.c
2017-11-08 18:20:47 +03:00
Ankit Navik
5c74095f44 rilmodem: set LTE preferred in rat mode 2017-11-08 18:20:47 +03:00
Ankit Navik
55befb87cd rilmodem: Add lte atom driver
Adds rilmodem driver for setting the default APN command.
The default APN is manage by config storage.
2017-11-08 18:20:47 +03:00
Denis Kenzior
9d7a0f8615 ubloxmodem: Fixup minor style issues
- useless return at the end of a function
- mixed tabs & spaces for indentation
- over 80 characters for the comment
- line > 80 characters due to access technology conversion.  Replaced
  with a direct assignment.
2017-11-08 18:20:47 +03:00
Denis Kenzior
974100732c ubloxmodem: Fix warning
drivers/ubloxmodem/netmon.c: In function ‘req_cb_data_unref’:
drivers/ubloxmodem/netmon.c:131:10: error: ‘return’ with a value, in
function returning void [-Werror]
   return NULL;
2017-11-08 18:20:47 +03:00
Djalal Harouni
35a6a4d8d0 build: build the ublox netmon driver 2017-11-08 18:20:47 +03:00
Djalal Harouni
f2a64c4d15 ubloxmodem: register and initialize the netmon driver 2017-11-08 18:20:47 +03:00
Djalal Harouni
ed1e90990e ubloxmodem: add the netmon driver
This adds a netmon driver for ublox. The driver support both +COPS and
+CESQ commands to return the previously added ofono netmon types:

RSCP: Received Signal Code Power
ECN0: Received Energy Ratio
RSRQ: Reference Signal Received Quality
RSRP: Reference Signal Received Power

Current revision makes the driver use ref countig when chaining multiple
AT commands.
2017-11-08 18:20:47 +03:00
Denis Kenzior
c8a4727243 AUTHORS: Mention Djalal's contributions 2017-11-08 18:20:47 +03:00
Djalal Harouni
2ccabbbdef test: support NETMON_INFO_{RXLEV|RSCP|ECN0|RSRQ|RSRP}
Display the following fields if they are returned.

RXLEV:  Received Signal Strength
RSCP:   Received Signal Code Power
ECN0:   Received Energy Ratio
RSRQ:   Reference Signal Received Quality
RSRP:   Reference Signal Received Power
2017-11-08 18:20:47 +03:00
Djalal Harouni
7c3638143d netmon: handle NETMON_INFO_{RSCP|ECN0|RSRQ|RSRP}
Handle the newly added netmon info types.
2017-11-08 18:20:47 +03:00
Djalal Harouni
a0e8b24c70 doc: Add additional netmon properties
This adds documentation for the following fields in
networkmonitor-api.txt

RSCP: Received Signal Code Power
ECN0: Received Energy Ratio
RSRQ: Reference Signal Received Quality
RSRP: Reference Signal Received Power
2017-11-08 18:20:47 +03:00
Djalal Harouni
41d432211e include: add NETMON_INFO_{RSCP|ECN0|RSRQ|RSRP}
Add more ofono netmon info types that will be served through the netmon
interface. The main user of this now will be the ublox modem.

RSCP: Received Signal Code Power
ECN0: Received Energy Ratio
RSRQ: Reference Signal Received Quality
RSRP: Reference Signal Received Power
2017-11-08 18:20:47 +03:00
Denis Kenzior
94f6138e23 netmon: Fix style issue 2017-11-08 18:20:47 +03:00
Denis Kenzior
e82ce81858 netmon: No need to initialize mcc/mnc 2017-11-08 18:20:47 +03:00
Dragos Tatulea
c18fa5e038 gprs: lte: set attached after successful activation
Otherwise the attached state gets to be set before the actual LTE
automatic context is ready. This triggers a race between connman
and ofono: connman sees status attached before the context is active
so connman will try to activate another context with same apn and will
fail over and over again.
2017-11-08 18:20:47 +03:00
Dragos Tatulea
c7c53adbb5 lte: fix early imsi free
storage_close was creating an empty sync file in /var/lib/ofono/lte
when it should have been closing the proper file
/var/lig/ofono/<imsi>/lte.
2017-11-08 18:20:47 +03:00
Slava Monich
30a9ef7e7a Sync whitespaces with upstream
Conflicts:
	ofono/src/smsutil.c
2017-11-08 18:20:47 +03:00
Dragos Tatulea
064181f903 ubloxmodem: tweak to work on different firmware
The U-Blox documentation specifies the following:
* get interface ip and dns from +CGDCONTRDP
* get gw ip and netmask from +UIPADDR

However, different firmware versions have different befaviour:

* On newer firmware, +UIPADDR returns error. But it's possible to configure
gateway ip == ipterface ip (read from CGDCONTRDP).

* On older firmware, we can actually use the commands specified in the
docs.

This patch runs +CGDCONTRDP, configures everything and then tries to run
+UIPADDR. In that works, reconfigures gw ip and netmask.
2017-11-08 18:20:47 +03:00
Dragos Tatulea
7d22ed86f8 plugins: ublox: enable lte driver for tobyl2 2017-11-08 18:20:47 +03:00
Dragos Tatulea
0641a981d1 build: add support for ublox lte atom driver 2017-11-08 18:20:47 +03:00
Dragos Tatulea
ceb6741a67 ubloxmodem: add lte atom driver
Adds U-Blox Toby L2 driver for setting the default APN via the
+UCGDFLT command. Currently only IPv4 is supported. APN is
not stored to modem's non-volatile memory. oFono will manage this
default APN via it's config storage.

When receiving an empty default APN, the value is reset.
2017-11-08 18:20:47 +03:00
Denis Kenzior
4797cab10b lte: If method is NULL, return not implemented 2017-11-08 18:20:47 +03:00
Denis Kenzior
fbf001bbec lte: Relax condition to g_free imsi
imsi malloc is not directly tied to l_settings being valid
2017-11-08 18:20:47 +03:00
Dragos Tatulea
8e90e96509 build: add lte atom support
Conflicts:
	ofono/Makefile.am
2017-11-08 18:20:47 +03:00
Dragos Tatulea
80e9b97036 lte: add implementation for LTE atom
This implementation can only get/set the default APN setting. But
anything expected for this atom is there:
* D-Bus interface
* sync-ing settings to/from file
* interaction with driver

Conflicts:
	ofono/src/ofono.h
2017-11-08 18:20:47 +03:00
Dragos Tatulea
01103f32ae ubloxmodem: fix memory leak in gprs_context_remove 2017-11-08 18:20:47 +03:00
Denis Kenzior
4bef0c7b33 include: Fix return signature in lte methods
Only the probe method returns a value.  All other methods use a void
return signature and report errors via the callback.
2017-11-08 18:20:47 +03:00
Denis Kenzior
693d5a77bd build: add test/set-lte-property 2017-11-08 18:20:47 +03:00
Denis Kenzior
a2333ead45 build: Add lte-api.txt 2017-11-08 18:20:46 +03:00
Dragos Tatulea
aa6a436af5 doc: add lte atom documentation 2017-11-08 18:20:46 +03:00
Dragos Tatulea
ee350d6b4b test: add script for setting lte atom properties 2017-11-08 18:20:46 +03:00
Denis Kenzior
26b85c0606 include: Make lte method const correct 2017-11-08 18:20:46 +03:00
Dragos Tatulea
068190a7a5 include: add header file for lte atom 2017-11-08 18:20:46 +03:00
Dragos Tatulea
1b292f7cf2 include: add LTE dbus service define 2017-11-08 18:20:46 +03:00
Kuba Pawlak
cd9a19c090 bluez5: fix crash on DBus transport disconnection
Do not register dbus notification if message failed to be sent out
because transport was already disconnected
2017-11-08 18:20:46 +03:00
Kuba Pawlak
6d357e70a4 gatchat: Fix parsing fields with odd number of quotation marks
Events like +CLCC and +CCWA can have contact name attached to the
end of line. If this field contains odd number of quotation marks,
parser will eventually reject such message as malformatted.
2017-11-08 18:20:46 +03:00
Dragos Tatulea
8f4817106d src: add LTE atom define 2017-11-08 18:20:46 +03:00
Slava Monich
d2ce689008 [ofono] Moved ofono_gprs_get_roaming_allowed declaration from gprs.h to ofono.h
.. primarily to make gprs.h identical to upstream. Besides, it's an internal
function, it doesn't have to be defined in gprs.h and exported from ofono in
the first place.
2017-11-08 18:12:15 +03:00
Slava Monich
b470166c87 [ril] Fixed -Wsign-compare compilation warnings
Upstream doesn't have those, let's keep our code clean, too.
2017-11-03 12:12:37 +03:00
Slava Monich
158a0da0b2 sim: Move atom registration to the end of ofono_sim_register
The state needs to be checked prior to calling __ofono_atom_register
because atom registration calls OFONO_ATOM_WATCH_CONDITION_REGISTERED
callbacks each of which may call ofono_sim_inserted_notify. Should
that happen, by the time __ofono_atom_register returns, ofono_sim
will be in OFONO_SIM_STATE_INSERTED state and sim_initialize will
be called twice if the initial state was OFONO_SIM_STATE_NOT_PRESENT.
If nothing else, that results in memory leaks like this one (because
IMSI will be queried twice, among other things):

==3017== 16 bytes in 1 blocks are definitely lost in loss record 187 of 475
==3017==    at 0x483F380: malloc (vg_replace_malloc.c:296)
==3017==    by 0x4AFB0DF: g_malloc (gmem.c:94)
==3017==    by 0x4B12185: g_strdup (gstrfuncs.c:363)
==3017==    by 0xF79D3: sim_imsi_obtained (sim.c:1535)
==3017==    by 0xF7BB3: sim_imsi_cb (sim.c:1594)
==3017==    by 0x66C23: at_cimi_cb (sim.c:441)
==3017==    by 0xA6B53: at_chat_finish_command (gatchat.c:459)
==3017==    by 0xA6D9F: at_chat_handle_command_response (gatchat.c:521)
==3017==    by 0xA70AF: have_line (gatchat.c:600)
==3017==    by 0xA76DF: new_bytes (gatchat.c:759)
==3017==    by 0xABACF: received_data (gatio.c:122)
==3017==    by 0xAD093: watch_dispatch (gatmux.c:461)
==3017==    by 0xAC5D3: dispatch_sources (gatmux.c:180)
==3017==    by 0xAC98F: received_data (gatmux.c:265)
==3017==    by 0x4AF606F: g_main_dispatch (gmain.c:3154)
==3017==    by 0x4AF606F: g_main_context_dispatch (gmain.c:3769)
==3017==    by 0x4AF631D: g_main_context_iterate.isra.4 (gmain.c:3840)
==3017==    by 0x4AF658F: g_main_loop_run (gmain.c:4034)
==3017==    by 0xBE8AF: main (main.c:261)
2017-10-27 19:10:19 +03:00
Slava Monich
b4bbf0462c gatchat: Removed unused GAtPPP field 2017-10-27 01:09:42 +03:00
Slava Monich
d80b96790f atmodem: Query the list of supported <fac>s from the modem
Not all modems support all <fac>s (particularly, "PS"), let's be polite
and not ask them for the ones they don't support.
2017-10-24 02:07:17 +03:00
Slava Monich
accb571fd6 gatmux: Remove write watch source at shutdown
Otherwise write_watcher_destroy_notify can be invoked after
GAtMux has been deallocated which results in write after free:

==3952== Invalid write of size 4
==3952==    at 0xABF54: write_watcher_destroy_notify (gatmux.c:285)
==3952==    by 0x4AF21E7: g_source_callback_unref (gmain.c:1561)
==3952==    by 0x4AF2E53: g_source_destroy_internal.constprop.8 (gmain.c:1207)
==3952==    by 0x4AF61CF: g_main_dispatch (gmain.c:3177)
==3952==    by 0x4AF61CF: g_main_context_dispatch (gmain.c:3769)
==3952==    by 0x4AF658F: g_main_loop_run (gmain.c:4034)
==3952==    by 0xBDDBB: main (main.c:261)
==3952==  Address 0x50c6cb0 is 8 bytes inside a block of size 4,396 free'd
==3952==    at 0x4840B28: free (vg_replace_malloc.c:530)
==3952==    by 0xACB53: g_at_mux_unref (gatmux.c:642)
==3952==  Block was alloc'd at
==3952==    at 0x4841BF0: calloc (vg_replace_malloc.c:711)
==3952==    by 0xAC9DF: g_at_mux_new (gatmux.c:603)
==3952==    by 0xADF2F: g_at_mux_new_gsm0710_basic (gatmux.c:1160)
2017-10-24 02:07:16 +03:00
Slava Monich
523a4b6a81 gatmux: Remove finalized watches from the list
Leaving them there may result in invalid reads like this:

==2312== Invalid read of size 4
==2312==    at 0xAB8C0: dispatch_sources (gatmux.c:134)
==2312==    by 0xAC5D3: channel_close (gatmux.c:479)
==2312==    by 0x4AE8885: g_io_channel_shutdown (giochannel.c:523)
==2312==    by 0x4AE8A1D: g_io_channel_unref (giochannel.c:240)
==2312==    by 0xAC423: watch_finalize (gatmux.c:426)
==2312==    by 0x4AF2CC9: g_source_unref_internal (gmain.c:2048)
==2312==    by 0x4AF44E1: g_source_destroy_internal (gmain.c:1230)
==2312==    by 0x4AF44E1: g_source_destroy (gmain.c:1256)
==2312==    by 0x4AF5257: g_source_remove (gmain.c:2282)
==2312==    by 0xAB5CB: io_shutdown (gatio.c:325)
==2312==    by 0xAB667: g_at_io_unref (gatio.c:345)
==2312==    by 0xA72C7: at_chat_unref (gatchat.c:972)
==2312==    by 0xA829B: g_at_chat_unref (gatchat.c:1446)
==2312==  Address 0x51420f0 is 56 bytes inside a block of size 60 free'd
==2312==    at 0x4840B28: free (vg_replace_malloc.c:530)
==2312==    by 0x4AF2D33: g_source_unref_internal (gmain.c:2075)
==2312==    by 0x4AF44E1: g_source_destroy_internal (gmain.c:1230)
==2312==    by 0x4AF44E1: g_source_destroy (gmain.c:1256)
==2312==    by 0x4AF5257: g_source_remove (gmain.c:2282)
==2312==    by 0xAB46B: g_at_io_set_write_handler (gatio.c:283)
==2312==    by 0xA713F: at_chat_suspend (gatchat.c:938)
==2312==    by 0xA72B7: at_chat_unref (gatchat.c:971)
==2312==    by 0xA829B: g_at_chat_unref (gatchat.c:1446)
==2312==  Block was alloc'd at
==2312==    at 0x4841BF0: calloc (vg_replace_malloc.c:711)
==2312==    by 0x4AFB117: g_malloc0 (gmem.c:124)
==2312==    by 0x4AF401F: g_source_new (gmain.c:892)
==2312==    by 0xAC6A7: channel_create_watch (gatmux.c:506)
==2312==    by 0x4AE7C4F: g_io_add_watch_full (giochannel.c:649)
==2312==    by 0xAB4EB: g_at_io_set_write_handler (gatio.c:297)
==2312==    by 0xA7103: chat_wakeup_writer (gatchat.c:931)
==2312==    by 0xA753F: at_chat_send_common (gatchat.c:1045)
==2312==    by 0xA850F: g_at_chat_send (gatchat.c:1502)

It's also necessary to add additional references to the sources
for the duration of the dispatch_sources loop because any source
can be removed when any callback is invoked (and not necessarily
the one being dispatched).
2017-10-24 00:07:47 +03:00
Slava Monich
9d8a6a4978 Fixed -Wsign-compare warnings
unit/test-sailfish_sim_info.c:86:33: signed and unsigned type in conditional expression
drivers/ril/ril_netmon.c:46:12: comparison between signed and unsigned integer expressions
2017-10-23 23:56:29 +03:00
Slava Monich
f2fa85aa47 [ril] Housekeeping
Took out some leftovers of the past
2017-10-20 18:13:17 +03:00
Slava Monich
a189d13b4a Merge branch 'dbus-queue' into 'master'
Generic queueing of D-Bus requests

See merge request !151
2017-10-19 08:17:38 +00:00
Slava Monich
3b79a77d78 [ofono] radio-settings: Use ofono_dbus_queue for queuing D-Bus requests
Instead of failing with org.ofono.Error.InProgress, requests
are queued and handled in the order they are received.
2017-10-18 23:56:40 +03:00
Slava Monich
c2ee34e51c [ofono] network: Use ofono_dbus_queue for queuing D-Bus requests 2017-10-18 22:39:51 +03:00
Slava Monich
c3bead1c9b [ofono] Generic queueing of D-Bus requests
Instead of failing with org.ofono.Error.InProgress, requests may be queued.
2017-10-18 22:39:21 +03:00
Slava Monich
a26f1a4b5c [ril] Removed a few unused things 2017-10-18 12:43:31 +03:00
Slava Monich
1eacfdf592 [ril] First fix permissions on top-level directories. JB#39961
... and then descend into subdirectories. Even though it doesn't
really matter since we are starting as root, it does seem to be
a bit more logical.
2017-10-13 18:28:42 +03:00
Slava Monich
ba14ed43e4 Merge branch 'perm' into 'master'
Fix storage directory permissions at startup

See merge request !150
2017-10-13 14:33:21 +00:00
Slava Monich
802b3008be [ril] Fix storage directory permissions at startup. Fixes JB#39961
Also, made the identity configurable and got rid of hardcoded radio
uid and gid, those are now queried at runtime.
2017-10-13 17:16:24 +03:00
Slava Monich
3b0191d145 [test] Added test-ril_util 2017-10-13 17:07:26 +03:00
Slava Monich
282d32f70d [ril] Added ril_parse_int utility 2017-10-13 17:05:43 +03:00
Slava Monich
e0c349a18c Merge branch 'smsfilter' into 'master'
SMS filter plugin

See merge request !138
2017-10-10 13:00:08 +00:00
Slava Monich
69d65dc002 [ofono] Support for SMS filter plugins. JB#37478 2017-10-10 15:49:28 +03:00
Slava Monich
33e70ddce4 [ofono] Allow older versions of plugins.
Let's assume that plugin API is going to be backward compatible. If
we start to actually use binary ofono plugins (possibly, 3rd-party),
backward compatibility becomes a must.
2017-10-10 15:49:28 +03:00
Slava Monich
d3ada8fcb3 [ofono] Fixed setting/clearing debug flags for binary plugins
They were added to the list of debug categories but their flags
were not actually getting updated on client's requests.
2017-10-10 15:48:59 +03:00
Slava Monich
4c21ca4e26 atmodem: Fix use after free in sim_state_cb
==2941== Invalid read of size 4
==2941==    at 0x69338: sim_state_cb (sim.c:1301)
==2941==    by 0x71DCB: cpin_check_cb (atutil.c:567)
==2941==    by 0xA602B: at_chat_finish_command (gatchat.c:459)
==2941==    by 0xA6277: at_chat_handle_command_response (gatchat.c:521)
==2941==    by 0xA6587: have_line (gatchat.c:600)
==2941==    by 0xA6BB7: new_bytes (gatchat.c:759)
==2941==    by 0xAAFAF: received_data (gatio.c:124)
==2941==    by 0x4AF606F: g_main_dispatch (gmain.c:3154)
==2941==    by 0x4AF606F: g_main_context_dispatch (gmain.c:3769)
==2941==    by 0x4AF658F: g_main_loop_run (gmain.c:4034)
==2941==    by 0xBDDBB: main (main.c:261)
==2941==  Address 0x519c344 is 4 bytes inside a block of size 12 free'd
==2941==    at 0x4840B28: free (vg_replace_malloc.c:530)
==2941==    by 0x71F33: at_util_sim_state_query_free (atutil.c:613)
==2941==    by 0x6930B: sim_state_cb (sim.c:1297)
==2941==    by 0x71DCB: cpin_check_cb (atutil.c:567)
==2941==    by 0xA602B: at_chat_finish_command (gatchat.c:459)
==2941==    by 0xA6277: at_chat_handle_command_response (gatchat.c:521)
==2941==    by 0xA6587: have_line (gatchat.c:600)
==2941==    by 0xA6BB7: new_bytes (gatchat.c:759)
==2941==    by 0xAAFAF: received_data (gatio.c:124)
==2941==    by 0x4AF606F: g_main_dispatch (gmain.c:3154)
==2941==    by 0x4AF606F: g_main_context_dispatch (gmain.c:3769)
==2941==    by 0x4AF658F: g_main_loop_run (gmain.c:4034)
==2941==    by 0xBDDBB: main (main.c:261)
2017-10-05 19:46:32 +03:00
Slava Monich
a3301ec1d2 modem: Implement ofono_modem_get_sim 2017-10-05 19:46:31 +03:00
Slava Monich
6f11bfc632 include: Add ofono_modem_get_sim 2017-10-05 19:46:31 +03:00
Slava Monich
74262b9ef8 [ril] Don't mix slice and default allocators in ril_plugin.c
And it generally doesn't make sense to use slice allocator for allocating
the structures that are a) large and b) allocated at startup and not freed
until the program exits.
2017-10-02 17:31:47 +03:00
Slava Monich
199a610607 [ril] Fixed erroneous assert 2017-10-02 16:34:33 +03:00
Slava Monich
af2d223f0f [ofono] Moved gutil_log_func initialization from ril_plugin_init()
.. to debuglog_init(). There's no reason for it to be in RIL specific code.
2017-10-02 13:31:26 +03:00
Slava Monich
0b6fcf8b71 [mbpi] Use PROVIDER_DATABASE from config.h as the default
It's pulled from mobile-broadband-provider-info.pc by the
configure script, we should trust it.
2017-10-02 12:48:23 +03:00
Slava Monich
cc05aeccd1 Merge branch 'debug' into 'master'
Fix logging issues with external plugins

See merge request !149
2017-10-01 22:14:36 +00:00
Slava Monich
5728444ad3 [iofono] Allow to manage logs of binary plugins
External (binary) plugins have __debug section of their own.
2017-09-30 00:28:54 +03:00
Slava Monich
4cbb6b5919 [ofono] Added __ofono_plugin_foreach()
Invokes a callback for each registered plugin. It's needed by debuglog
plugin because external plugins have __debug section of their own and
debuglog needs access to debug_start and debug_stop of such plugins
in order to enable or disable plugin logs.
2017-09-29 21:27:35 +03:00
Slava Monich
5699bb4932 [build] Fixed configure check for libmce-glib
Version 1.0.5 is required for mce_display_remove_all_handlers macro
2017-09-29 13:06:34 +03:00
Slava Monich
09fa97c53a Merge branch 'default_timeout' into 'master'
Use default start timeout for default configuration

See merge request !148
2017-09-25 06:46:56 +00:00
Slava Monich
3eaa8a46bd [ril] Use default start timeout for default configuration. Fixes JB#39840
If /etc/ofono/ril_subscription.conf doesn't exist or doesn't contain
any modem sections (the latter is the case on Jolla 1 for historical
reasons) ofono falls back to the default configuration which should
use the default start timeout.
2017-09-23 18:07:57 +03:00
Slava Monich
4401319136 Merge branch 'ready' into 'master'
Set the ready flag if no drivers is registered with sailfish_manager

See merge request !147
2017-09-15 15:48:25 +00:00
Slava Monich
472ddcf0b1 Merge branch 'optionalmodem' into 'master'
Support for optional modems

See merge request !119
2017-09-15 15:48:09 +00:00
Slava Monich
b7e0f276a1 [ril] Support for optional modems. Fixes MER#1783 2017-09-15 17:14:57 +03:00
Slava Monich
5d251aea3a [ofono] More unit tests for the ready flag 2017-09-14 15:03:57 +03:00
Slava Monich
cdc0065284 [ofono] Set the ready flag if no drivers is registered with sailfish_manager. Fixes MER#1808
If there are no supported modems, ofono should be happy and the ready
flag should become true because the UI is waiting for this flag at
startup (and in this case there's nothing to wait for).
2017-09-14 15:01:45 +03:00
Slava Monich
6d65dc5bf0 Merge branch 'cellinfo' into 'master'
Move cell info API to the driver independent area.

See merge request !146
2017-09-14 08:39:03 +00:00
Slava Monich
5d02c0bba4 [ofono] Added unit test for sailfish_cell_info 2017-09-14 00:32:32 +03:00
Slava Monich
b99513e080 [ofono] Move cell info API to the driver independent area. Fixes JB#39725
So that it could be used by any driver, not just by RIL.
2017-09-14 00:29:13 +03:00
Slava Monich
3cf328c781 Merge branch 'ack' into 'master'
Support for logging new packet types (RIL v13)

See merge request !145
2017-09-12 13:36:33 +00:00
Slava Monich
bce68611a1 [ril] Support for logging new packet types (RIL v13). JB#39228 2017-09-12 00:18:52 +03:00
Slava Monich
cc497feee7 Merge branch 'online' into 'master'
Fix online state tracking

See merge request !143
2017-09-06 10:18:23 +00:00
Matti Kosola
725606af8d Merge branch 'jb39622' into 'master'
Handle normal call end with error cause.

See merge request !144
2017-09-06 08:58:25 +00:00
Juho Hämäläinen
52db6e5459 [ofono] Handle normal call end with error cause. Fixes JB#39622
With multi-sim setup we get last cause code 0xffff when incoming
call is ending due to other multi-sim phone answering the call.
Due to this handle the 0xffff as remote hangup if call status is
incoming.
2017-09-06 11:51:57 +03:00
Slava Monich
83441bc203 [ril] Fixed online state tracking. Fixes JB#39592 2017-09-05 12:14:52 +03:00
Slava Monich
4054f09b60 Merge branch 'samecaps' into 'master'
Avoid pointless radio caps switches

See merge request !142
2017-09-04 13:49:44 +00:00
Slava Monich
38aa8cff87 Merge branch 'cellinfo12' into 'master'
Support for RIL_CellInfo_v12

See merge request !141
2017-09-04 13:49:30 +00:00
Slava Monich
4959292938 [ofono] Avoid pointless radio caps switches. Fixes JB#39589
Not only it makes no sense, it can also get ofono into an infinite
switch loop.
2017-09-03 16:20:08 +02:00
Slava Monich
c69cea52cf [ofono] Support for RIL_CellInfo_v12. Fixes JB#39220
Required by RIL version 12 and above.
2017-09-03 16:12:56 +02:00
Slava Monich
4e0b8f7b48 Merge branch 'mms' into 'master'
Use REQUEST_SEND_SMS_EXPECT_MORE when appropriate

See merge request !140
2017-08-29 13:52:55 +00:00
Slava Monich
9c87063c4a [ril] Use REQUEST_SEND_SMS_EXPECT_MORE when appropriate
It's identical to RIL_REQUEST_SEND_SMS, except that more messages are
expected to be sent soon. If possible, SMS relay protocol link is kept
open (eg TS 27.005 AT+CMMS command)
2017-08-29 13:19:08 +03:00
Slava Monich
dc5a87f4f2 unit: Avoid use of uninitialised data in test-simutil
GTest: run: /testsimutil/ber tlv encode EFpnn
==16777== Conditional jump or move depends on uninitialised value(s)
==16777==    at 0x4068CB: ber_tlv_iter_next (simutil.c:369)
==16777==    by 0x406C39: ber_tlv_find_by_tag (simutil.c:483)
==16777==    by 0x407E1D: sim_eons_add_pnn_record (simutil.c:1027)
==16777==    by 0x402C39: test_ber_tlv_builder_efpnn (test-simutil.c:181)
==16777==    by 0x4EA3A80: g_test_run_suite_internal
==16777==    by 0x4EA3F9A: g_test_run_suite
==16777==    by 0x4EA3FD0: g_test_run
==16777==    by 0x4042FA: main (test-simutil.c:518)
2017-08-25 11:15:20 +03:00
Slava Monich
ecd35181a3 unit: test-sms: Fix memory leaks in the unit test 2017-08-25 01:41:06 +03:00
Slava Monich
96d6daf67e smsutil: Prevent invalid access in cbs_decode_text
Valgrind was complaining about it like this:

==18099== Conditional jump or move depends on uninitialised value(s)
==18099==    at 0x4C32281: strspn
==18099==    by 0x41286B: cbs_decode_text (smsutil.c:4140)
==18099==    by 0x40675C: test_cbs_encode_decode (test-sms.c:1417)
2017-08-25 01:38:16 +03:00
Slava Monich
e9702f6ec1 [ofono] sailfish_manager: require manager_create callback
Missing manager_create callback would cause a memory leak like this:

==9972== 96 bytes in 4 blocks are definitely lost in loss record 336 of 356
==9972==    at 0x483F3EC: malloc (vg_replace_malloc.c:299)
==9972==    by 0x4AEE0DF: g_malloc (gmem.c:94)
==9972==    by 0x4B03F51: g_slice_alloc (gslice.c:1025)
==9972==    by 0x4B0438F: g_slice_alloc0 (gslice.c:1051)
==9972==    by 0x1200B: sailfish_slot_manager_new (sailfish_manager.c:1019)
==9972==    by 0x12243: sailfish_slot_driver_init (sailfish_manager.c:1075)
==9972==    by 0x4AE906F: g_main_dispatch (gmain.c:3154)
==9972==    by 0x4AE906F: g_main_context_dispatch (gmain.c:3769)
==9972==    by 0x4AE931D: g_main_context_iterate.isra.4 (gmain.c:3840)
==9972==    by 0x4AE958F: g_main_loop_run (gmain.c:4034)
==9972==    by 0xACB7: test_basic (test-sailfish_manager.c:370)
==9972==    by 0x4B0B89F: test_case_run (gtestutils.c:2158)
==9972==    by 0x4B0B89F: g_test_run_suite_internal (gtestutils.c:2241)
==9972==    by 0x4B0BACD: g_test_run_suite_internal (gtestutils.c:2253)
2017-08-25 00:45:20 +03:00
Slava Monich
0746c615bc Merge branch 'protocol' into 'master'
Support for APN protocol in MBPI

See merge request !139
2017-08-24 21:44:36 +00:00
Slava Monich
970020a3b0 [ofono] Added tests for fetching APN protocol from MBPI. JB#39520 2017-08-24 17:45:13 +03:00
Slava Monich
f3d5e3d5c6 [ofono] mbpi: Add support for APN protocol in MBPI. Fixes #JB39520 2017-08-24 17:44:14 +03:00
Slava Monich
bb880ab14a Merge branch 'fix' into 'master'
Fix regressions after the recent huge merge

See merge request !137
2017-08-23 11:31:04 +00:00
Slava Monich
922d5e17ee [ril] Fixed a bug in ril_plugin_find_unused_slot. Fixes JB#39481
Both slots ended up with the same slot number wreaking all kinds of havoc
2017-08-23 12:40:47 +03:00
Slava Monich
7886ce04a1 [ril] Deserialize RIL I/O when SIM status becomes known. JB#39481 2017-08-23 12:39:53 +03:00
Slava Monich
5213398826 [ofono] Renamed __ofono_dbg -> ofono_dbg to allow binary plugins to use DBG macro
Only symbols starting with ofono_ can be resolved.
2017-08-22 18:11:55 +03:00
Slava Monich
0bbcc127be [ofono] Add test-sailfish_manager and test-sailfish_sim_info to the ignore list 2017-08-22 15:43:32 +03:00
Slava Monich
f7db0a0459 sms: Pass const pointer to dispatch_app_datagram 2017-08-22 15:39:28 +03:00
Slava Monich
2d18086c80 Merge branch 'sailfish_manager' into 'master'
Move Sailfish OS specific D-Bus interfaces to a separate plugin

See merge request !136
2017-08-22 12:15:27 +00:00
Slava Monich
0f4560c2eb [ofono] Moved RIL-independent stuff out of Sailfish OS RIL driver. JB#39257
The new sailfish_manager plugin contains the code necessary for
proper integration of ofono into Sailfish OS (mostly, that's
Sailfish OS specific D-Bus interfaces) and can be used by pretty
much any driver, not necessarily ril.
2017-08-22 12:07:01 +03:00
Slava Monich
7d80344d6b [ofono] network: Added ofono_netreg_get_name() function
Returns the name of the current operator.
2017-07-24 01:17:33 +03:00
Sergey Chupligin
c0c4148099 [ril] Added option to disable voicecall handling. Contributes to MER#1798 2017-07-21 15:34:39 +03:00
Slava Monich
34755f1a79 [ril] Housekeeping
Took out unnecessary include
2017-07-16 21:26:46 +03:00
Slava Monich
282d560c37 [ril] Changed the name of the common section in the error statistics file
Trying to get rid of RIL specific names, before it's too late.
2017-07-16 15:37:59 +03:00
Slava Monich
e4bca84876 [pushforwarder] Housekeeping
Removed unnecessary checks for memory allocation failures.

Replaced inotify stuff with a simpler version of the same thing -
since we already depend on libglibutil, there's no reason not to
use functions from there.
2017-07-15 12:54:15 +03:00
Slava Monich
aa0ded78b0 Merge branch 'slow_down' into 'master'
Serialize critical request sequences

See merge request !132
2017-07-13 18:40:45 +00:00
Slava Monich
eb15b12caf [ril] Don't start radio caps switch until SIM I/O calms down. JB#38689
That seems to significantly reduce the probability of a failure at startup
(we are reading the phonebook right after SIM interface is initialized)
2017-07-13 18:10:18 +03:00
Slava Monich
81b5c716e2 [ril] Notify the UI if the capability switch transaction fails. JB#38689
That bumps ModemManager protocol version to 8
2017-07-13 12:01:46 +03:00
Slava Monich
33c330988f [ril] Handle the case of one of the SIMs missing. JB#38689
LTE could be enabled for the slot that has no SIM card in it.
In that case we want to swap the capabilities so that LTE
becomes available to the slot that does have a SIM in it.
2017-07-12 19:04:26 +03:00
Slava Monich
910057a265 [ril] Make radio capability switch more reliable. JB#38689
1. Don't allow any other requests while radio caps switch is ongoing.
2. Wait for all other requests to complete before starting the switch
3. Deactivate data calls, disable data before the switch
4. Increased the timeouts
2017-07-12 17:39:40 +03:00
Slava Monich
19f0f8d96e [ril] If SET_UICC_SUBSCRIPTION times out, drop (rather than cancel) it. jb#38689
So that it gets removed from the list of pending requests and
doesn't block the next request.
2017-07-12 16:01:47 +03:00
Slava Monich
f1f3c17c4c [ril] Made PIN requests blocking. JB#38998 2017-07-12 15:58:05 +03:00
Slava Monich
29d891cbce [ril] Made SET_SUPP_SVC_NOTIFICATION blocking. JB#38998
To slow things down at startup. Some RILs just don't like it too fast.
2017-07-12 15:55:55 +03:00
Slava Monich
89fa0d5d6a [ril] Made GSM_GET_BROADCAST_SMS_CONFIG blocking. JB#38998 2017-07-12 15:53:12 +03:00
Slava Monich
c382d9f456 [ril] Poll data call state if DEACTIVATE_DATA_CALL request fails. JB#38998
Also exposed ril_request_allow_data_new and ril_request_deactivate_data_call_new
functions - those may need to be used outside of the ril_data module.
2017-07-12 15:53:01 +03:00
Slava Monich
b209b6bee6 [ril] Make RIL_REQUEST_RADIO_POWER blocking. JB#38998 2017-07-12 15:38:46 +03:00
Slava Monich
ee3323e98b [ril] Block requests while UICC subscription is in progress. JB#38998
Only allow GET_SIM_STATUS. This should make RIL happier.
2017-07-12 15:38:46 +03:00
Slava Monich
9200e387e1 [ril] Serialize requests at startup. JB#38998
Slowing things down at startup seems to make RIL happier.
2017-07-12 15:38:46 +03:00
Slava Monich
2bc58a7f6f Merge branch 'ussd' into 'master'
Switch USSD state from USER_ACTION to IDLE when a notification is received

See merge request !129
2017-06-22 07:40:18 +00:00
Slava Monich
35079b11fe [ofono] Switch USSD state from USER_ACTION to IDLE. Fixes JB#38992
When a USSD notification is received in the USER_ACTION state,
the state needs to be switched to IDLE. Some networks send 0
(no further user action required) after the response timeout
expires. That should result in the user input form getting
removed from the screen.
2017-06-21 14:57:11 +03:00
Slava Monich
955d5882b2 Merge branch 'octal' into 'master'
Workaround for broken MMS proxy IP address

See merge request !128
2017-06-20 08:14:28 +00:00
Slava Monich
2583fa99ce [ofono] Workaround for broken MMS proxy IP address. JB#38990
Some operators provide IP address of the MMS proxy
prepending zeros to each number shorter then 3 digits,
e.g. "192.168.094.023" instead of "192.168.94.23".
That may look nicer but it's actually wrong because
the numbers starting with zeros are interpreted as
octal numbers. In the example above 023 actually means
16 and 094 is not a valid number at all.

In addition to publishing these broken settings on their
web sites, some of the operators send them over the air,
in which case we can't even blame the user for entering
an invalid IP address. We better be prepared to deal with
those.

Since nobody in the world seems to be actually using the
octal notation to write an IP address, let's remove the
leading zeros if we find them in the host part of the MMS
proxy URL.
2017-06-19 18:47:20 +03:00
Slava Monich
b8bb15ce9c [ril] Fixed voicecall problem introduced by commit 351ac1e9. JB#38105 2017-06-17 18:53:16 +03:00
Slava Monich
cbf24c7b08 Merge branch 'auth_method' into 'master'
Add ANY and NONE authentication methods

See merge request !126
2017-06-17 14:13:16 +00:00
Slava Monich
a4c4d1526e [ofono] Reset authentication method together with other context settings. JB#38972 2017-06-16 17:38:32 +03:00
Slava Monich
18d1a8834a [rpm] Require mobile-broadband-provider-info at runtime
Even though it's not really required at build time anymore, let's still
keep it there because this requirement is hardcoded in configure.ac which
we pull from upstream.
2017-06-16 17:05:33 +03:00
Slava Monich
8343d96db5 [test] Improved provisioning test coverage
It no longer requires mobile-broadband-provider-info package to run
2017-06-16 17:04:28 +03:00
Slava Monich
415fce9368 [ofono] Allow to compile unit tests with coverage enabled
... and added unit/coverage script which runs the tests and
generates html report.

Code coverage has to be enabled with --enable-test-coverage
configure switch
2017-06-16 17:04:28 +03:00
Slava Monich
33257a139d [ril] Respect the authentication algorithm option. JB#38972 2017-06-16 17:04:28 +03:00
Slava Monich
f580867c12 [ofono] Added ANY and NONE authentication methods. JB#38972
ANY is supposed to allow either PAP or CHAP to be performed at plugin's
discretion. This is now the default (rather than CHAP)

NONE disables the authentication alltogether.
2017-06-16 17:03:40 +03:00
Slava Monich
edaba80ad1 Merge branch 'imeisv' into 'master'
Expose IMEI SV via org.nemomobile.ofono.ModemManager

See merge request !127
2017-06-16 09:07:49 +00:00
Slava Monich
e68314b07d [ofono] Expose IMEI SV via org.nemomobile.ofono.ModemManager. JB#38973
Unlike org.ofono.Modem properties, it's always going to be available
even for the slots that are disabled.
2017-06-15 15:30:03 +03:00
Slava Monich
d13e48b638 Merge branch 'radio_caps' into 'master'
Start using RIL_REQUEST_SET_RADIO_CAPABILITY

See merge request !122
2017-06-15 11:53:27 +00:00
Slava Monich
e0edfca358 [ril] Added SetRadioCapability config option. JB#38689
The RIL_REQUEST_SET_RADIO_CAPABILITY request is still not supported
by some relatively recent RILs, it should be possible to forcibly
turn it off.
2017-06-14 17:54:34 +03:00
Slava Monich
7cd2075ada [ril] Start using SET_RADIO_CAPABILITY. Fixes JB#38689
With some RILs it seems to be the only way to let all slots to use 4G,
SET_PREFERRED_NETWORK_TYPE is not always enough.
2017-06-14 17:50:51 +03:00
Slava Monich
3ccacfd5f7 [ril] Notify rild when we don't need mobile data. JB#38689
We were only telling rild when we need mobile data, but we should also
tell it when we don't need it.
2017-06-11 21:27:28 +03:00
Slava Monich
5ee13f8e2c [rpm] Drop the .changes file
It's not being maintained.
2017-06-11 16:09:09 +03:00
Slava Monich
6ab9dcb553 Merge branch 'sailfish_plugins' into 'master'
Consistent naming of Sailfish OS specific plugins

See merge request !125
2017-06-11 13:08:19 +00:00
Slava Monich
102061107a [ofono] push-forwarder -> sailfish-pushforwarder. Fixes JB#38927
The configure option --enable-sailfish-pushforwarder is now required in order
to enable this plugin (it was enabled by default)
2017-06-11 15:56:03 +03:00
Slava Monich
2bb7d629f5 [ofono] debuglog plugin -> sailfish_debuglog. JB#38927 2017-06-11 15:47:43 +03:00
Slava Monich
5ce01787e8 [ofono] Renamed jolla-rilmodem configure option into sailfish-rilmodem. JB#38927 2017-06-11 15:42:30 +03:00
Slava Monich
1d57cb0e73 [ofono] Renamed sailfishos configure option to sailfish-bt. JB#38927
Also, renamed sfos_bt.c into sailfish_bt.c so that the file name
looks similar to the configure option that enables it.
2017-06-11 15:41:56 +03:00
Slava Monich
3d84c0a120 [ofono] Renamed Sailfish OS specific provision plugin to sailfish_provision. JB#38927
plugins/provision.c is the original upstream provisioning plugin and
plugins/sailfish_provision.c is the Sailfish OS specific thing. They
are mutually exclusuve.

Sailfish OS specific plugin is enabled with --enable-sailfish-provision
configure switch. By default, the upstream plugin is used.
2017-06-11 15:40:57 +03:00
Slava Monich
091cf21c0b Merge branch 'hangup' into 'master'
Keep hangup D-Bus request pending until RIL hangup completes

See merge request !123
2017-06-08 09:58:44 +00:00
Slava Monich
351ac1e9db [ril] Keep hangup D-Bus request pending until RIL hangup completes. JB#38105 2017-06-07 16:49:57 +03:00
Slava Monich
b7481a918f radio-settings: Fix memory leaks in radio_load_settings
Errors returned by g_key_file_get_integer have to be deallocated
by the caller to avoid leaks like these:

==13330== 104 (24 direct, 80 indirect) bytes in 2 blocks are definitely lost
==13330==    at 0x483F3EC: malloc (vg_replace_malloc.c)
==13330==    by 0x4B020DF: g_malloc (gmem.c)
==13330==    by 0x4B17F51: g_slice_alloc (gslice.c)
==13330==    by 0x4AE80B9: g_error_new_valist (gerror.c)
==13330==    by 0x4AE830B: g_set_error (gerror.c)
==13330==    by 0x4AF5681: g_key_file_get_value (gkeyfile.c)
==13330==    by 0x4AF6817: g_key_file_get_integer (gkeyfile.c)
==13330==    by 0x10CFE3: radio_load_settings (radio-settings.c)
==13330==    by 0x10D2E3: ofono_radio_settings_register (radio-settings.c)
2017-06-02 21:23:23 +03:00
Slava Monich
e1e4381105 Merge branch 'default_data_sim' into 'master'
Don't auto-select the data sim on a multisim phone

See merge request !121
2017-05-31 07:59:32 +00:00
Slava Monich
cc3ca52e61 [ril] Don't auto-select the data sim on a multisim phone. JB#38719
This kind of behavior is reserved for single sim phone (for now).
2017-05-30 16:44:15 +03:00
Slava Monich
a71779ea2a [ril] Added assert in ril_sim_card_status_parse
.. that we have parsed the entire parcel to the end
2017-05-26 12:10:04 +03:00
Slava Monich
a9d2849bbb Merge branch 'jb38795' into 'master'
Fix passing -j to make

See merge request !120
2017-05-25 13:38:34 +00:00
Martin Kampas
ca29c8e538 [packaging] Fix passing -j to make. Contribute to JB#38795 2017-05-25 14:28:18 +02:00
Slava Monich
85fe1b7174 Merge branch 'imei' into 'master'
Use RIL_REQUEST_DEVICE_IDENTITY  instead of RIL_REQUEST_GET_IMEI

See merge request !117
2017-05-12 21:17:02 +00:00
Slava Monich
56e0d9dffa Merge branch 'file_watches' into 'master'
Prevent a crash in sim_fs_notify_file_watches

See merge request !118
2017-05-12 20:33:58 +00:00
Slava Monich
6867ba65cb [simfs] Prevent a crash in sim_fs_notify_file_watches. Fixes JB#38656
If no file watchers have ever been added, context->file_watches
is NULL and sim_fs_notify_file_watches() should take that into
account.
2017-05-12 18:51:53 +03:00
Slava Monich
6199eaa4d8 [ril] Allow (some) DEVICE_IDENTITY requests to time out. Fixes JB#38632
If GET_SIM_STATUS succeeds but DEVICE_IDENTITY keeps on failing,
allow the latter to time out. Some RILs behave that way until the
modem has been properly initialized.
2017-05-12 17:21:40 +03:00
Slava Monich
fabdd6799c [ril] Use DEVICE_IDENTITY request instead of GET_IMEI. Contributes to JB#38632
RIL_REQUEST_GET_IMEI has been deprecated since 2009
2017-05-12 17:15:01 +03:00
Slava Monich
1219ab6a3f Merge branch 'permlock' into 'master'
Detection of permanently locked SIM cards

See merge request !116
2017-04-28 16:13:23 +00:00
Slava Monich
85a956d9eb [ril] Improved detection of permanently locked SIM cards. JB#38257
If PUK is required, app state is PUK and pin1_state is ENABLED_BLOCKED.
If the card is permanently locked, app state is still PUK but pin1_state
becomes ENABLED_PERM_BLOCKED. That way we can tell whether the SIM card
is locked even if the number of remaining attempts is not available.
2017-04-28 16:06:22 +03:00
Slava Monich
c83d992a3b Merge branch 'retries' into 'master'
Query PUK retry count

See merge request !115
2017-04-28 11:54:09 +00:00
Slava Monich
b22027017c [ril] Query PUK retry count. JB#38257
PUK retry counts can be queried in a way similar to PIN retry counts
on those RILs that support it.
2017-04-27 21:36:46 +03:00
Slava Monich
1fa137b36d [sim] Allow plugins to use puk2pin() function 2017-04-27 21:27:27 +03:00
Slava Monich
cfd837b1db Merge branch 'puk' into 'master'
Always refresh SIM status from query_passwd_state

See merge request !114
2017-04-27 08:08:20 +00:00
Slava Monich
735ad21e89 [ril] Always refresh SIM status from query_passwd_state. Fixes JB#38257
After we have entered an invalid pin too many times, RIL signals
the SIM status change, we request the new status but ofono core
asks us for the new passwd state before our SIM status query has
completed. We need to wait for the query to complete before we can
report the new status to the core.

It also won't hurt if we request a fresh SIM status every time
when query_passwd_state callback is called, just in case if RIL
fails to notify us about the SIM status change.
2017-04-26 15:03:26 +03:00
Slava Monich
c9078404de [ril] Housekeeping 2017-04-14 19:51:42 +03:00
Slava Monich
e375195c92 Merge branch 'tech' into 'master'
Add "technologies" configuration option

See merge request !111
2017-04-10 21:10:22 +00:00
Slava Monich
ef5610f741 [ril] Added "technologies" configuration option. Fixes JB#38295
It supersedes enable4G option.
2017-04-05 21:18:00 +03:00
jpoutiai
aef9bbd3e0 Merge branch 'jb38053' into 'master'
[plugins] support bt call audio control. Fixes JB#38053

See merge request !110
2017-04-05 10:23:27 +00:00
Jarko Poutiainen
c6eb410f21 [plugins] support bt call audio control. Fixes JB#38053 2017-04-05 08:35:55 +03:00
Slava Monich
08b3ea3d0f Merge branch 'last_fail' into 'master'
Handle fancy variant of LAST_CALL_FAIL_CAUSE response

Some RILs get creative and invent their own formats.
They must be very proud of it.

See merge request !106
2017-03-15 21:46:11 +00:00
Slava Monich
2978862417 [ril] Handle fancy variant of LAST_CALL_FAIL_CAUSE response. Fixes JB#38079
Some RILs get creative and invent their own formats.
2017-03-15 17:19:37 +02:00
Slava Monich
19228c9e67 Merge branch 'lastcause' into 'master'
Allow to configure custom hangup reasons

One can define localHangupReasons and remoteHangupReasons in
ril_subscription.conf which will be treated as normal local or
remote hangup reasons.

See merge request !104
2017-02-24 13:11:46 +00:00
Slava Monich
9be791d531 [ofono] Allow to conifigure custom hangup reasons. Fixes JB#37879
One can define localHangupReasons and remoteHangupReasons in
ril_subscription.conf which will be treated as normal local or
remote hangup reasons. The value is a comma-separated list of
numbers, e.g.

localHangupReasons=20,39
2017-02-24 12:07:57 +02:00
Slava Monich
6b9eb7bf8f Merge branch 'voicecall' into 'master'
Don't use internal voicecall data structures

Added ofono_voicecall_find_call API instead

See merge request !105
2017-02-24 10:06:39 +00:00
Slava Monich
01f8989aee [ril] Don't use internal voicecall data structures
Use newly added ofono_voicecall_find_call API instead
2017-02-24 00:28:50 +02:00
Slava Monich
2f5efaf591 [ofono] Added ofono_voicecall_find_call API
For use by plugins
2017-02-24 00:28:18 +02:00
Slava Monich
ca1d06c37a Merge branch 'disable' into 'master'
Disable some unnecessary and harmful functionality

See merge request !103
2017-01-12 15:17:23 +00:00
Slava Monich
5f45928a84 [ofono] Disable PhoNet/ISI and QMI modem support. MER#1734
This makes ARM executable smaller by 170 KB
2017-01-12 00:47:04 +02:00
Slava Monich
19f74e6c85 [ofono] Don't allow to add or remove connection context over D-Bus. Fixes MER#1733
Quite a few things in SailfishOS assume that each modem has exactly
one internet and one mms context. However, ofono's D-Bus API allows
any application to arbitrarily add and remove connection contexts
which can screw things up quite badly. Since this functionality is
not used by SailfishOS, it should be disabled.
2017-01-12 00:27:17 +02:00
Slava Monich
41d5cfcab2 Merge branch 'modem-error' into 'master'
Count rild crashes

See merge request !102
2017-01-11 11:58:42 +00:00
Slava Monich
357c5db580 [ril] Count rild crashes. Contributes to JB#35780
org.nemomobile.ofono.ModemManager.ModemError signal is emitted
when rild crash is detected. Also, the new GetModemErrors method
allows to query how many times which instance of rild has crashed
since ofono was (re)started.
2017-01-11 13:24:23 +02:00
Slava Monich
8cea5b9f96 [ril] Allow to retry GET_BROADCAST_SMS_CONFIG. MER#1729
RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG sometimes fails at startup.
We may have to retry a few times (typically, once or twice on Jolla 1)
2017-01-05 18:40:50 +03:00
Slava Monich
5fb35d5fb4 Merge branch 'v1.19' into 'master'
Update ofono baseline to 1.19

It's the latest stable release.

See merge request !101
2017-01-05 12:39:13 +00:00
Slava Monich
e8d57bb928 [ofono] Update baseline to 1.19
Removed merge artifacts
2017-01-05 15:37:58 +03:00
Slava Monich
2bfde2418e [ril] Removed old workaround breaking hot-swap. Fixes MER#1730
The workaround is no longer needed. All SIM I/O requests have to
be completed even if the SIM card is removed while the request is
pending. Otherwise simfs request queue gets stuck.
2017-01-05 15:35:29 +03:00
Marcel Holtmann
c710ce76c1 Release 1.19 2017-01-05 11:20:08 +03:00
Alfonso Sánchez-Beato
78acd90464 gitignore: unit/test-rilmodem-gprs binary 2017-01-05 11:20:08 +03:00
Alfonso Sánchez-Beato
e51b3ca0c8 build: add rilmodem gprs unit tests
Conflicts:
	ofono/Makefile.am
2017-01-05 11:20:08 +03:00
Alfonso Sánchez-Beato
b3c8813bd4 unit: add rilmodem gprs tests
Add rilmodem gprs tests, which use the rilmodem test engine.
2017-01-05 11:20:08 +03:00
Alfonso Sánchez-Beato
e2a3acd9d0 unit: add rilmodem test engine
Add rilmodem test engine. This engine is an improvement on the rilmodem
test server that allows us to test generic interactions with the
rilmodem driver. Instead of just be able to check content of received/
sent bytes on the rild socket, we can now specify a set of steps for a
test that include interactions with the atom. The step types are

- TST_ACTION_SEND: The harness sends a parcel
- TST_ACTION_CALL: The harness calls a driver function
- TST_EVENT_RECEIVE: The driver sends a parcel
- TST_EVENT_CALL: The driver calls a harness (atom) function
2017-01-05 11:20:08 +03:00
Slava Monich
2054ca9570 include: Remove unused field from primary_context 2017-01-05 11:20:08 +03:00
Denis Kenzior
48dbb7912a AUTHORS: Mention Antoine's contributions 2017-01-05 11:20:08 +03:00
Denis Kenzior
d7e7ad671d gatchat: Fix style 2017-01-05 11:20:08 +03:00
Antoine Aubert
5b5a86dc80 gatmux: fix read channel remove on error
In case of invalid IO, read_watch is not reset. This fix crash on
destroy gatmux.
2017-01-05 11:20:08 +03:00
Slava Monich
c232524e99 main: Make -d option repeatable
Concatenating the patterns makes more sense than using the last
supplied value and leaking the previous allocated patterns.
2017-01-05 11:20:08 +03:00
Frédéric Dalleau
bfd09a5c14 udevng: Detect huawei E3372 modem and pcui
When the modes are modified with AT^SETPORT="FF;12,1,16", this modem
and pcui will appear using different ids. Update the interfaces
identifier accordingly.
2017-01-05 11:20:08 +03:00
Frédéric Dalleau
f8adcd2550 udevng: Detect huawei E3372 pcui
The huawei E3372 exposes two USB tty at /dev/ttyUSB0 and /dev/ttyUSB1
/dev/ttyUSB1 is properly detected as modem.
/dev/ttyUSB0 is the pcui.

lsusb shows 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
2017-01-05 11:20:08 +03:00
Denis Kenzior
2a97567147 handsfree-audio: Fix crash
For HFP 1.5 devices the driver is always set to NULL.  So if the AG
establishes the SCO connection first, we might crash.
2017-01-05 11:20:07 +03:00
Santtu Lakkala
04d84b615e huaweimodem: Fix DHCP parsing on 32-bit platforms
strtol clamps returned value between INT_MIN and INT_MAX, causing
invalid value (255.255.255.127) being reported for any address
if last octet > 127 when sizeof(long) == 4.
2017-01-05 11:20:07 +03:00
Samrat Guha Niyogi
6e34792323 sim: remove locked_pin reset from sim_free_main_state 2017-01-05 11:20:07 +03:00
Samrat Guha Niyogi
d6a59f5dc4 rilmodem: fix cbd init in ril_query_facility_lock 2017-01-05 11:20:07 +03:00
Samrat Guha Niyogi
23e299055f rilmodem: fix num_params in query_facility_lock_cb 2017-01-05 11:20:07 +03:00
Denis Kenzior
a56ef3ba0f rilmodem: Co-locate the callback with invocation 2017-01-05 11:20:07 +03:00
Denis Kenzior
7294433906 rilmodem: Co-locate the callback with invocation 2017-01-05 11:20:07 +03:00
Samrat Guha Niyogi
d7263cd344 rilmodem: split ril_pin_change_state_cb
split ril_pin_change_state_cb based on functionality w.r.t.
facility lock, puk and pin. Rename ril_pin_change_state to
more appropriate name ril_set_facility_lock and rename
ril_pin_change_state_cb to ril_enter_sim_pin_cb.
2017-01-05 11:20:07 +03:00
Samrat Guha Niyogi
2f3b469fbb rilmodem: Remove unneeded pin sending logic 2017-01-05 11:20:07 +03:00
Denis Kenzior
4187e7ee8f sim: Fix style 2017-01-05 11:20:07 +03:00
Samrat Guha Niyogi
4d3f89bae0 sim: query facility during initialization in chain manner
query facility during initialization is modified from back
to back invocation to chain manner to keep it inline with
RIL design. All vendor RIL does not support back to back
handling since RIL telephony framework sends the request
synchronously.
2017-01-05 11:20:07 +03:00
Denis Kenzior
cbd1c5d524 sim: return false for SIM_PASSWORD_NONE 2017-01-05 11:20:07 +03:00
Ankit Navik
7976e44746 ril_sofia3gr: use vendor modem power down command 2017-01-05 11:20:07 +03:00
Denis Kenzior
3d6e220686 test: Add cancel-sms script 2017-01-05 11:20:07 +03:00
Denis Kenzior
919526d392 test: Fix permissions 2017-01-05 11:20:07 +03:00
Anirudh Gargi
b7082146e8 gril: Fix print macros to use latest print_buf 2017-01-05 11:20:07 +03:00
Denis Kenzior
094a296a14 AUTHORS: Mention Rajagopal's contributions 2017-01-05 11:20:07 +03:00
Rajagopal Aravindan
5c259e751b test: Added test to disable sofia 3gr tx throttling 2017-01-05 11:20:07 +03:00
Rajagopal Aravindan
69e5d5b356 test: Added test to enable sofia 3gr tx throttling 2017-01-05 11:20:07 +03:00
Rajagopal Aravindan
56e7d0e8ea ril_sofia3gr: Add transmit power throttling
Added 'sofia3gr.ThermalManagement' interface to sofia3gr plugin and
floated 'TransmitPowerThrottling' as an ofono property under that,
to support modem throttling.

'sofia3gr.ThermalManagement'
    1.Will be available ONLY if modem throttling is supported in RIL.
      This is determined by sending a RIL request during ofono start,
      to get current throttling state. If it succeeds, interface is
      published otherwise not.

'TransmitPowerThrottling'
    1.GetProperties will be allowed both when modem is ON & OFF.
    2.GetProperties will be serviced by looking it up from state
      information maintained inside ofono. No RIL call will be made.
    3.SetProperty will be allowed ONLY when modem is ON.
    4.SetProperty request will be forwarded to RIL ONLY if
      new state != current state. If RIL request succeeds, state
      information will be updated and also, a property change signal
      will be emitted.
2017-01-05 11:20:07 +03:00
Nishanth V
bb2ae6d1a1 rilmodem: fix WCDMA only in query rat mode 2017-01-05 11:20:07 +03:00
Caiwen Zhang
cf7692db49 plugins/ril: enable cbs 2017-01-05 11:20:07 +03:00
Caiwen Zhang
63f3311cd6 rilmodem: add cell broadcast message support 2017-01-05 11:20:07 +03:00
Samrat Guha Niyogi
c5aae77d41 ril_sofia3gr: Return -EINPROGRESS on disable() 2017-01-05 11:20:07 +03:00
Denis Kenzior
f8e21c8ad4 AUTHORS: Mention Suman's contributions 2017-01-05 11:20:07 +03:00
Suman Mallela
8e6dfe433b rilmodem: Fix PIN retries logic
The SIM PIN retries were not getting reset when the correct PIN/PUK
was entered.
2017-01-05 11:20:07 +03:00
Caiwen Zhang
ae23bb552b gril: avoid glib runtime warning
gril may be destroyed in the request callback (e.g in the callback of
set modem power off request). 'out_queue' and 'command_queue' is NULL.
there will be glib runtime warning if use them.
2017-01-05 11:20:06 +03:00
Caiwen Zhang
2becd051d4 plugins/ril: complete modem power off process 2017-01-05 11:20:06 +03:00
Slava Monich
8cfb1d5ca3 Merge branch 'cbs' into 'master'
Enable Cell Broadcast support

It was totally broken. 

See merge request !100
2017-01-05 08:15:45 +00:00
Slava Monich
50f35458f6 Merge branch 'rat' into 'master'
Preferred network mode, more corner cases

See merge request !99
2017-01-05 08:14:43 +00:00
Slava Monich
51843accf7 [ril] Enable Cell Broadcast support. Fixes MER#1729 2017-01-04 20:34:54 +03:00
Slava Monich
fb856dc7d6 [ril] Preferred network mode, more corner cases. Contributes to JB#36683
Prevents repeated rat mode setting failures when data SIM is not selected.
2017-01-04 16:05:11 +03:00
Slava Monich
1482748183 Merge branch 'silent-retry' into 'master'
Retry data call more than once

See merge request !98
2016-12-10 18:16:16 +00:00
Slava Monich
869ffda61e [ofono] Retry data call more than once. Contributes to JB#35406
Sometimes one retry is not enough, we need to allow more.
The first retry occurs immediately, then short delays are
applied. The delays and the number of retries are configurable.
The default is 4 retries and 200 ms delay before each retry
(except for the first one).

That should reduce the number of "Problem with connection" banners
thrown into the user's face.
2016-12-09 18:32:46 +02:00
Slava Monich
f875cbfda2 [ril] A few debug log changes 2016-12-08 18:20:43 +02:00
Slava Monich
2a60eaa6e3 Merge branch 'radiosetting' into 'master'
Fix the problem with radio settings saved to the wrong place

After the baseline was upgraded to 1.18, ofono core started saving
its radio settings to a file, and in order to save it to the right
place, the radio settings module needs to know the IMSI. So we have
to make sure that IMSI is available when we register the radio
settings atom.

See merge request !97
2016-11-25 13:41:02 +00:00
Slava Monich
29b6c41d48 [ril] Register ofono radio settings only when IMSI is available. Fixes MER#1708
Otherwise its radiosetting files gets written directly to /var/lib/ofono
instead of the SIM specific subdirectory.
2016-11-25 01:57:19 +02:00
Slava Monich
2f6491d005 [ril] Reset imsi in ril_sim_settings to NULL when SIM is removed. 2016-11-25 01:56:33 +02:00
Slava Monich
1a25047e9d Merge branch 'jb36957' into 'master'
Fix receiving UTF-16 encoded messages with split 4-byte char.

See merge request !96
2016-11-18 16:58:17 +00:00
Martin Jones
899e14bf17 [ofono] Fix receiving UTF-16 encoded messages with split 4-byte char. Fixes JB#36957
The spec supports UCS2, but in reality UTF-16 is used, which supports
4-byte characters, which could be split into different message
fragments. Accumulate the entire UTF-16 message before converting to
UTF8.
2016-11-18 14:06:57 +02:00
Slava Monich
2520664c63 Merge branch 'gprs-picks' into 'master'
Couple of upstream picks

One of those eliminates a possible root cause of mobile data
becoming disabled under certain (fairly rare) circumstances.

See merge request !95
2016-11-07 09:43:04 +00:00
Slava Monich
445bbbd66f gprs: Check GPRS_FLAG_ATTACHED_UPDATE
... in pri_deactivate_callback

This prevents attached state from getting stuck at 0 like this:

1. Context deactivation is initiated over D-Bus, ctx->pending is set
2. Attached becomes FALSE, context is still marked as active
3. Attached becomes TRUE, gprs_attached_update sets GPRS_FLAG_ATTACHED_UPDATE
4. Deactivation completes, attached is 0, driver_attached is 1

Futher network status updates don't call gprs_attached_update because
driver_attached is still 1, so attached is staying 0 until we lose the
data registration again which may not happen for quite a long time.
2016-11-04 12:14:48 +03:00
Caiwen Zhang
08fc4b0d03 gprs: fix crash removing a context being activated
If remove the context before context activation is completed, it may
cause a crash.
2016-11-04 12:14:18 +03:00
Slava Monich
c82e94ffb4 Merge branch 'cancel' into 'master'
Make sure that data request completion callback is always called on cancel

See merge request !94
2016-10-31 16:12:52 +00:00
Slava Monich
fd3712940b [ril] Make sure data request completion callback is called on cancel. Contributes to JB#33640
Completion callback wasn't invoked if the data request was cancelled
before it was actually submitted to RIL.
2016-10-28 15:46:06 +03:00
Slava Monich
8410c985c9 Merge branch 'nitz' into 'master'
Handle NITZ information coming before MCC/MNC

See merge request !93
2016-10-27 09:26:05 +00:00
Slava Monich
0878decdc0 Merge branch 'prefmode' into 'master'
Preferred network mode, corner cases

See merge request !92
2016-10-27 09:25:18 +00:00
Slava Monich
cb69984722 [ril] Preferred network mode, corner cases. Fixes JB#36683
Really make sure that we don't try to set preferred network mode to LTE
for more than one slot at a time.
2016-10-26 17:30:01 +03:00
Slava Monich
1fe8701f1a [nettime] Handle NITZ information coming before MCC/MNC. Fixes MER#1680
Due to the order in which events are delivered and network registration
information requiring one extra query, NITZ information may be delivered
to ofono before MCC/MNC are known.
2016-10-26 16:56:30 +03:00
Slava Monich
c5286fee70 Merge branch 'rat' into 'master'
Check network mode after ril_data is created

Not sure if it completely fixes the issue but it could cause
repeating SET_PREFERRED_NETWORK_TYPE failures.

See merge request !91
2016-10-23 21:04:29 +00:00
Slava Monich
3c5f6f84e1 Merge branch 'data_calls' into 'master'
Make data call format configurable

Different RILs use different data call structures which don't
necessarily match the format specified in the data list header.
The header may have version 9 but the list may contain 
RIL_Data_Call_Response_v6` structures, list version 10 may
contain RIL_Data_Call_Response_v11 and so on. By default ofono
assumes that the version from the list header matches the contents
but sometimes you have to explicitly tell ofono which one to use.

Possible values are 6, 9, 11 and auto.

See merge request !90
2016-10-23 21:03:52 +00:00
Slava Monich
8b87b55e8d [ril] Check network mode after ril_data is created. Contributes to JB#36683 2016-10-20 14:41:29 +03:00
Slava Monich
bce34cbff3 [ril] Housekeeping
Removed unnecessary forward declaration
2016-10-20 14:38:04 +03:00
Slava Monich
f8351cacf1 [ril] Made data call format configurable. Contributes to MER#1679
This commit adds dataCallFormat configuration option to
ril_subscriptuion.conf which allows to select which data
call format to use. There are quite a few rils where version
provided in the data call list header doesn't match the contents.
2016-10-19 12:30:13 +03:00
Slava Monich
6b9b8583dc Merge branch 'v10' into 'master'
Assume RIL_Data_Call_Response_v11 for RIL version 10

See merge request !89
2016-10-18 13:15:37 +00:00
Slava Monich
1df56480ba [ril] Assume RIL_Data_Call_Response_v11 for RIL version 10. Fixes MER#1679
All known rils that report version 10 are using RIL_Data_Call_Response_v11
(FairPhone 2, Nexus 4).
2016-10-18 15:11:00 +03:00
Slava Monich
adc8fce399 Merge branch 'v1.18' into 'master'
Update to upstream 1.18

This pulls the baseline from 1.17 to 1.18

See merge request !87
2016-10-17 12:08:43 +00:00
Slava Monich
d24ce4d9de Merge branch 'prefmode' into 'master'
Query preferred network mode at startup

Not knowing the initial state may result in endless attempts to
switch to LTE, failing because the other slot has LTE on.

See merge request !88
2016-10-17 12:07:35 +00:00
Slava Monich
f726af3309 [spec] Bumped version 2016-10-14 23:24:22 +03:00
Slava Monich
0ba1fd641b [ril] Query preferred network mode at startup
Not knowing the initial state may result in endless attempts to switch
to LTE, failing because the other slot has LTE on.
2016-10-14 20:46:39 +03:00
Slava Monich
41c0b0a2e6 Fixed merge artifact that was breaking OBS build 2016-10-14 20:18:47 +03:00
Slava Monich
322282258a netmon: Make sure we don't pass NULL message to g_dbus_send_message 2016-10-14 19:34:32 +03:00
Slava Monich
f6a7c39bba [ril] Added support for org.ofono.NetworkMonitor interface
Even though it's not as useful as org.nemomobile.ofono.CellInfo
it has the advantage of being the official one.
2016-10-14 19:33:07 +03:00
Denis Kenzior
3d3f68c798 allowed-apns: Fix crash
When a modem is being removed, all of the modem's atom watches have
already been cleaned up.  Trying to remove it again results in a crash.

Fix by registering a destroy callback which will be notified when the
atomwatch has been removed.
2016-10-14 19:00:35 +03:00
Nishanth V
e8d057c39e plugins: Fix allowed apn plugin exit 2016-10-14 19:00:28 +03:00
Slava Monich
357e5b69ca [update] Update to upstream 1.18. Fixes MER#1673 2016-10-14 17:09:35 +03:00
Slava Monich
e77efed603 [ofono] Fixed compilation after 1.18 merge 2016-10-14 17:09:00 +03:00
Marcel Holtmann
fa252b8d4a Release 1.18 2016-10-14 17:04:11 +03:00
Caiwen Zhang
321c092d6b plugins/ril: enable STK 2016-10-14 17:04:11 +03:00
Caiwen Zhang
ee912bafe3 rilmodem/stk: add STK support for rilmodem 2016-10-14 17:04:11 +03:00
Denis Kenzior
35eb528a70 gobi: Fix warning
plugins/gobi.c: In function ‘gobi_pre_sim’:
plugins/gobi.c:431:2: error: ‘sim_driver’ may be used uninitialized in
this function [-Werror=maybe-uninitialized]
  ofono_sim_create(modem, 0, sim_driver, data->device);
    ^
2016-10-14 17:04:11 +03:00
Denis Kenzior
22a6c4438b udevng: Fixup various minor style issues 2016-10-14 17:04:11 +03:00
Martin Chaplet
652bdc15ad udevng: Add support for Sierra MC73xx QMI modems
Udevng layer is changed in order to support Sierra QMI modems like
MC73cxx. Identically to Huawei modems, these modems are parsed by
setup_sierra. If QMI interface is detected, the Gobi modem driver is
selected.

Unfortunately, MC73xx chips seem to have a broken QMI UIM interface.
The qmimodem-legacy is so forced in setup function.
2016-10-14 17:04:11 +03:00
Martin Chaplet
a71e277850 udevng: Improve modem properties detection
* Add driver's subsystem information (net, usb, tty, ...)
 * Improve interface number extraction by scanning also device and
 parent attributes
2016-10-14 17:04:11 +03:00
Martin Chaplet
fbee06e8be gobi: Enable SIM driver forcing
Some gobi devices do not actually support UIM interface.  So if the
"ForceSimLegacy" property is set, force the qmimodem-legacy SIM driver.
2016-10-14 17:04:11 +03:00
Denis Kenzior
26029566e2 AUTHORS: Mention Martin's contributions 2016-10-14 17:04:11 +03:00
Martin Chaplet
0074ff2660 udevng: Add usbmisc scan for QMI devices
cdc-wdm0 are now usbmisc devices
2016-10-14 17:04:10 +03:00
Denis Kenzior
82fa5e977a radio-settings: Fix style 2016-10-14 17:04:10 +03:00
Antara Borwankar
823f13a1fa radio-settings: Init pending_band_{gsm|umts}
The set_band method takes two parameters for band settings, one for gsm
and one for umts.  When loaded from storage, and they are not set to
defaults, the band variables can get out of sync when setting the
GsmBand and UmtsBand properties.
2016-10-14 17:04:10 +03:00
Denis Kenzior
7b34498b1e rilmodem: Remove no longer relevant TODO 2016-10-14 17:04:10 +03:00
Denis Kenzior
37d4e1983b include: Remove unused query_locked method
Conflicts:
	ofono/include/sim.h
2016-10-14 17:04:09 +03:00
Denis Kenzior
e6f26f3bcf rilmodem: Fix style 2016-10-14 17:00:59 +03:00
Samrat Guha Niyogi
23e1d2c516 rilmodem: Implement sim atom query_facility_lock 2016-10-14 17:00:59 +03:00
Samrat Guha Niyogi
1f246cc28c include: Add query_facility_lock method
Conflicts:
	ofono/include/sim.h
2016-10-14 17:00:56 +03:00
Caiwen Zhang
ec20f44124 doc: Fix enumeration value to be gprs and not gsm 2016-10-14 16:57:35 +03:00
Denis Kenzior
8b6139aea8 radio-settings: Fix 80-character limit 2016-10-14 16:57:35 +03:00
Denis Kenzior
b79c3c3a95 AUTHORS: Mention Antara's contributions 2016-10-14 16:57:35 +03:00
Antara Borwankar
c885744273 radio-settings: Store GSM and UMTS band settings 2016-10-14 16:57:35 +03:00
John Ernberg
cdd0e4eaff stk: clean up undefined function pointer casts 2016-10-14 16:57:35 +03:00
John Ernberg
402783f877 configure: Bump glib dependecy to 2.32
Needed to support g_queue_free_full
2016-10-14 16:57:35 +03:00
Denis Kenzior
4755990237 ril_sofia3gr: Add quirk to radio_settings atom 2016-10-14 16:57:35 +03:00
Denis Kenzior
7a91b4e069 ril: vendorize SoFiA set_band implementation
Since the set_band implementation uses an OEM hook, it should be wrapped
behind a vendor quirk.
2016-10-14 16:57:35 +03:00
Antara Borwankar
35d4ca1e53 rilmodem: Driver code to set band mode and value
set_band driver to set GSM band and UMTS band
2016-10-14 16:57:35 +03:00
John Ernberg
ea334e9daa simfs: Remove explicit casts 2016-10-14 16:57:35 +03:00
John Ernberg
16964bb8f2 sim: Remove explicit casts 2016-10-14 16:57:35 +03:00
John Ernberg
0b93ab2d76 phonebook: Remove explicit casts
Casting between incompatible function pointer types is undefined.  So
remove such casts when possible.
2016-10-14 16:57:35 +03:00
John Ernberg
0bed313ecb unit: Use g_slist_free_full 2016-10-14 16:57:35 +03:00
John Ernberg
cfd1d2c30a voicecall: Use g_slist_free_full 2016-10-14 16:57:35 +03:00
John Ernberg
cb7c408beb ussd: Use g_slist_free_full 2016-10-14 16:57:35 +03:00
John Ernberg
202d8cf162 stkutil: Use g_slist_free_full 2016-10-14 16:57:35 +03:00
John Ernberg
a15a558af6 smsutil: Use g_slist_free_full 2016-10-14 16:57:35 +03:00
John Ernberg
fd8429465f sms: Use g_slist_free_full 2016-10-14 16:57:35 +03:00
John Ernberg
8db1008790 simutil: Use g_slist_free_full 2016-10-14 16:57:35 +03:00
John Ernberg
3e3b4971da network: Use g_slist_free_full 2016-10-14 16:57:34 +03:00
John Ernberg
7c8245e432 modem: Use g_slist_free_full 2016-10-14 16:57:34 +03:00
John Ernberg
5a06b04e05 handsfree: Use g_slist_free_full 2016-10-14 16:57:34 +03:00
John Ernberg
1c12df9e99 cdma-smsutil: Use g_slist_free_full 2016-10-14 16:57:34 +03:00
John Ernberg
fa3d80cd39 cbs: use g_slist_free_full 2016-10-14 16:57:34 +03:00
John Ernberg
18507364ea smart-messaging: Use g_slist_free_full 2016-10-14 16:57:34 +03:00
John Ernberg
c409ec2940 bluez4: Remove unneeded casts 2016-10-14 16:57:34 +03:00
John Ernberg
bba910a1d6 gatchat: Use g_slist_free_full 2016-10-14 16:57:34 +03:00
John Ernberg
a7867d24e9 stemodem: Use g_slist_free_full 2016-10-14 16:57:34 +03:00
John Ernberg
8909d4928b rilmodem: Use g_slist_free_full 2016-10-14 16:57:34 +03:00
John Ernberg
d9e39a69a5 ifxmodem: Use g_slist_free_full 2016-10-14 16:57:34 +03:00
John Ernberg
0477eeb75f hfpmodem: Use g_slist_free_full 2016-10-14 16:57:34 +03:00
John Ernberg
2ff3613e9b atmodem: use g_slist_free_full 2016-10-14 16:57:34 +03:00
Caiwen Zhang
e5d040f7f9 plugins/ril: Move GPRS atom to 'post_online' state
At gprs atom 'probe' state, max cid query may fail due to rild
status isn't RADIO_STATUS_ON. It causes gprs atom is removed, gprs
feature is inavailable. Move gprs atom creating to 'post_online'
state to make sure rild status is RADIO_STATUS_ON when query max
cid.
2016-10-14 16:57:34 +03:00
John Ernberg
604a3dd22e voicecall: limit g_drivers variable exposure 2016-10-14 16:57:34 +03:00
John Ernberg
5eb923ad28 voicecall: fix CreateMultiparty method introspection
This caused problems with stricter dbus wrappers such as dbus-c++.
2016-10-14 16:57:34 +03:00
Denis Kenzior
94fa037b93 rilmodem: Remove some unneeded whitespace 2016-10-14 16:57:34 +03:00
Denis Kenzior
41135af282 rilmodem: Rename addrs to addr when not plural
addrs variable seems to be used whenever multiple addresses are being
references.  Either as a strv or a compound string separated by a
separator.  In these cases addrs was used for a single address, which
was confusing.
2016-10-14 16:57:34 +03:00
Denis Kenzior
47359a3083 rilmodem: Refactor away some explicit casts 2016-10-14 16:57:34 +03:00
Nishanth V
9c6c354d5a rilmodem: Add IPv6 support in gprs-context 2016-10-14 16:57:34 +03:00
Nishanth V
8ca5fc24ed rilmodem: Add address to protocol type util func 2016-10-14 16:57:34 +03:00
Nishanth V
aecb63423f ril: don't set an ipv4 netmask if not provided
For historical reasons a netmask was always being set, even if one was
not provided.
2016-10-14 16:57:34 +03:00
Nishanth V
f72f84ec0f test: Add list allowed access points script 2016-10-14 16:57:34 +03:00
Nishanth V
e593476d81 plugins: Add allowed apn list
Conflicts:
	ofono/Makefile.am
2016-10-14 16:57:31 +03:00
Nishanth V
1a4f1b0f9f simutil: Add EFACL in elementary file db 2016-10-14 16:52:07 +03:00
Nishanth V
14904ddaeb doc: Add allowed-apns api doc 2016-10-14 16:52:07 +03:00
Caiwen Zhang
5fc9827e5d sim: fix crash when going into state LOCKED_OUT
After input PIN wrong 3 times, sim main state (include spn_watches)
is freed. but the watch id still be kept by other atoms (network and
gprs), when remove the atom, it will try to remove the watch from
spn_watches, ofono daemon will crash.

Conflicts:
	ofono/src/sim.c
2016-10-14 16:52:05 +03:00
Nishanth V
3539b5c9f9 gprs-context: fix set ipv4 netmask for rilmodem 2016-10-14 16:45:55 +03:00
Denis Kenzior
916c1ac904 log: Fix style 2016-10-14 16:45:55 +03:00
Harald Welte
9f659d47b0 log: Don't crash when addr2line output contains no newline 2016-10-14 16:45:55 +03:00
Kuba Pawlak
7d3ec8e9dc unit: fix GCC 6.0 compilation issues
-Werror=unused-const-variable
2016-10-14 16:45:55 +03:00
Kuba Pawlak
d5977f9014 plugins/nokia-gpio: fix glibc 2.23.9+ issues
readdir_r’ is deprecated [-Werror=deprecated-declarations]
2016-10-14 16:45:55 +03:00
Kuba Pawlak
513b922814 drivers/isimodem: fix GCC 6.0 errors
-Werror=misleading-indentation
2016-10-14 16:45:55 +03:00
Denis Kenzior
7f0cc63b3d radio-settings: Fix potential leak
rs->imsi is only freed when rs->settings is true.  So tweak the logic
inside radio_load_settings to only strdup the imsi when settings
creation has succeeded.
2016-10-14 16:45:55 +03:00
Denis Kenzior
9fb47a6382 radio-settings: Fix minor style issues 2016-10-14 16:45:55 +03:00
Anirudh Gargi
ae35e7bff3 radio-settings: Add RAT mode to ofono storage 2016-10-14 16:45:55 +03:00
Alfonso Sanchez-Beato
c7dc8cf262 gprs: Deactivate old contexts on attach
In some cases it is possible that a context is opened after a detach
event has been received, and right before an attach, depending on the
modem. We make sure that those contexts are removed to keep
consistency.
2016-10-14 16:45:55 +03:00
Kuba Pawlak
213df4e7c4 hfp: Handle +CCWA at HFP connection setup
Some phones with an active and waiting call at the time of HFP SLC
establishment, may send call waiting notification before all calls
are synchronized. This will lead to call Id mismatch because call
object is created with assumed Id 1 and not Id assigned by the phone.

In example below waiting call is created with Id 1 but in AT+CLCC
this phone returns active call as call with Id 1, and waiting as 2.

< \r\n+CCWA: "+1234567890",145\r\n
< \r\n+CIEV: 2,1\r\n
drivers/hfpmodem/voicecall.c:ccwa_notify() ccwa_notify: +1234567890 145 0
src/voicecall.c:ofono_voicecall_notify() Got a voicecall event, status: 5, id: 1, number: +1234567890 called_number: , called_name
src/voicecall.c:ofono_voicecall_notify() Did not find a call with id: 1
> AT+CIND?\r
< \r\n+CIND: 1,1,1,4,0,2,0\r\n\r\nOK\r\n
src/network.c:ofono_netreg_status_notify() /hfp/org/bluez/hci0/dev_60_AF_6D_F7_8E_37 status 1 tech -1
> AT+VGS=7\r
< \r\nOK\r\n
> AT+VGM=7\r
< \r\nOK\r\n
> AT+CLCC\r
< \r\n+CLCC: 1,1,0,0,0,"+9876543210",145\r\n
< \r\n+CLCC: 2,1,5,0,0,"+1234567890",145\r\n\r\nOK\r\n
src/voicecall.c:ofono_voicecall_notify() Got a voicecall event, status: 0, id: 1, number: +9876543210 called_number: , called_name
src/voicecall.c:ofono_voicecall_notify() Found call with id: 1
src/voicecall.c:ofono_voicecall_notify() Got a voicecall event, status: 5, id: 2, number: +1234567890 called_number: , called_name
src/voicecall.c:ofono_voicecall_notify() Did not find a call with id: 2
src/voicecall.c:ofono_voicecall_mpty_hint() ids: 0
2016-10-14 16:45:55 +03:00
Denis Kenzior
e78daccea9 AUTHORS: Mention Nishanth's contributions 2016-10-14 16:45:55 +03:00
Samrat Guha Niyogi
4f10d24638 test: Support SoftwareVersionNumber in test-modem 2016-10-14 16:45:55 +03:00
Samrat Guha Niyogi
cfa7ec6dd5 rilmodem: Add support of IMEISV 2016-10-14 16:45:55 +03:00
Denis Kenzior
d18ba4e9a4 modem: Fix style 2016-10-14 16:45:55 +03:00
Samrat Guha Niyogi
8846c58b53 devinfo: Add support of IMEISV 2016-10-14 16:45:55 +03:00
Samrat Guha Niyogi
4f088c85c7 include: Add support for IMEISV in devinfo 2016-10-14 16:45:55 +03:00
Samrat Guha Niyogi
6587a2456a doc: Add SoftwareVersionNumber to Modem interface 2016-10-14 16:45:55 +03:00
Nishanth V
edab9dbf2b test: Add get serving cell information script 2016-10-14 16:45:55 +03:00
Nishanth V
b6cc94bf84 sofia3gr: Add netmon support 2016-10-14 16:45:55 +03:00
Denis Kenzior
4039bed591 rilmodem: Fix minor style issues 2016-10-14 16:45:55 +03:00
Nishanth V
1f56e8350b rilmodem: Add netmon support 2016-10-14 16:45:55 +03:00
Denis Kenzior
34b0d68cdd netmon: Fix minor style issues 2016-10-14 16:45:55 +03:00
Denis Kenzior
ec60fa4eac netmon: Add ofono/netmon.h into ofono.h
Conflicts:
	ofono/src/ofono.h
2016-10-14 16:45:50 +03:00
Nishanth V
a066917c4d netmon: Add serving cell info support
Conflicts:
	ofono/Makefile.am
2016-10-14 16:43:40 +03:00
Nishanth V
da23ddbc15 gril: Added RIL_REQUEST_GET_CELL_INFO_LIST 2016-10-14 16:36:35 +03:00
Denis Kenzior
207f67ab62 include: Fix whitespace issues 2016-10-14 16:36:35 +03:00
Nishanth V
3e3720f416 include: Add netmon changes 2016-10-14 16:36:35 +03:00
Alfonso Sanchez-Beato
985dbf9795 gril: Really use given uid/gid to open ril socket 2016-10-14 16:36:35 +03:00
Denis Kenzior
8b56a11936 AUTHORS: Mention Anirudh's contributions 2016-10-14 16:36:35 +03:00
Denis Kenzior
40aa517183 build: Add recently added test scripts 2016-10-14 16:36:35 +03:00
Anirudh Gargi
6fdf38b74b test: Add sms bearer set and SMSC set scripts 2016-10-14 16:36:35 +03:00
Denis Kenzior
8dc0b46bb3 sofia3gr: Fix style issue 2016-10-14 16:36:35 +03:00
Anirudh Gargi
b772df434b sofia3gr: Enable vendor type in SMS driver 2016-10-14 16:36:34 +03:00
Anirudh Gargi
3726a1a48a rilmodem: Add sms bearer set and bearer query func 2016-10-14 16:36:34 +03:00
Dragos Tatulea
5e309e5d45 gprs: assume attached state when registered on LTE
LTE doesn't really use the concept of an attached state. However,
the oFono API needs it. ConnMan needs it as well.
2016-10-14 16:36:34 +03:00
Denis Kenzior
ea65572935 ubloxmodem: Remove unneeded #include 2016-10-14 16:36:34 +03:00
Dragos Tatulea
83f8e1cbe6 ubloxmodem: support automatic ctx activation
... by imlementing read_settings.
2016-10-14 16:36:34 +03:00
Dragos Tatulea
c97d28cd23 atmodem: gprs: handle automatic context activation
When the event comes, trigger CGCONT? to read the APN for the
activated cid and then call ogono_gprs_cid_activated to handle
the event.
2016-10-14 16:36:34 +03:00
Dragos Tatulea
9279a008ed gprs: implement ofono_gprs_cid_activated
It works by looking for a context with the same APN and tries to use
that. Otherwise it will create it's own.

Then it assigns a gprs context driver and calls it's read_settings if
it exists.
2016-10-14 16:36:34 +03:00
Dragos Tatulea
e9c1603c8b gprs-context.h: add op for reading context config
This will be implemented by a gprs-context driver to support
automatic context activation. The gprs atom will call the driver
to read the ip configuration without activating the context.
2016-10-14 16:36:34 +03:00
Dragos Tatulea
5a8eb818ee idmap: add api for finding a certain id in map 2016-10-14 16:36:34 +03:00
Dragos Tatulea
7ab6bffd07 gprs: pri_set_apn: make reply msg optional
Automatic context activation will set the apn by itself. No
dbus message to reply to.
2016-10-14 16:36:34 +03:00
Dragos Tatulea
86f8a5c1f6 gprs: automatic context configuration notifier
Useful for LTE automatic bearer activation.

This is called from the gprs driver to let the gprs atom know that
a new context has been activated.

Conflicts:
	ofono/include/gprs.h
2016-10-14 16:36:31 +03:00
Dragos Tatulea
f1a87e5f6c gprs: custom cid for assign_context
It's optional though. If 0 a cid is picked up automatically from the
allowed range.
2016-10-14 16:33:19 +03:00
Dragos Tatulea
4dbdf95b12 ubloxmodem: support authentication
If username and password specified, issue an UAUTHREQ
command with the configured authentication method, selected cid
and credentials.
2016-10-14 16:33:19 +03:00
Dragos Tatulea
dab3e86325 ubloxmodem: add Toby L2 gprs context driver
For now the driver works only with bridged mode for 2G/3G.

Once it activates the context it reads the ip, netmask,
gw, dns and sets them in the context settings.
2016-10-14 16:33:19 +03:00
Dragos Tatulea
b62f6c1041 ublox: support more internet contexts
Create multiple gprs-context instances and let the gprs core use
them as it sees fit.

Only for Toby L2.
2016-10-14 16:33:19 +03:00
Dragos Tatulea
f41a998695 ublox: enable ubloxmodem driver when possible
Where possible means Toby L2 in high speed mode.

The bridge mode is set before enabling the modem because the
driver requires this.
2016-10-14 16:33:19 +03:00
Dragos Tatulea
42fa3983ef ublox: give names to model ids
To make it easier to understand the code.
2016-10-14 16:33:19 +03:00
Denis Kenzior
f8a47ae530 ublox: devinfo atom driver has no vendor behavior 2016-10-14 16:33:19 +03:00
Dragos Tatulea
cf202b1568 atmodem: add support for U-Blox TOBY L2 modems
Besides exceptions below, act like normal U-Blox devices.

gprs-context: don't set auth for TOBY L2. U-Blox Toby L2
doesn't support PAP/CHAP APN auth method.

atmodem: TOBY L2 supports only CMER mode 1. Also chaged original
mode variable to ind, which is a more appropriate name.
mode is what is being set first.
2016-10-14 16:33:19 +03:00
Dragos Tatulea
14ebdfe7b9 ublox: use vendor from structure instead of fixed
That's because we need to differentiate between multiple ublox
devices.
2016-10-14 16:33:19 +03:00
Dragos Tatulea
8732a885a3 ublox: allow enabling of TOBY L2 modems
For this we need to:
* Set the vendor family based on model id.
* Not use modem interface for the TOBY L2 family.
2016-10-14 16:33:19 +03:00
Dongsu Park
3f5fa672a5 udevng: Support U-blox TOBY series of devices
Each modem expresses their interfaces with its own interface string,
which is composed of 3 different USB attributes:
"bInterfaceClass/bInterfaceSubClass/bInterfaceProtocol".
While the old models like LISA support only "2/2/1" for modem
interfaces, TOBY-L2 also supports an unique string for NetworkInterface
for each profile.

* low-medium throughput profile : 2/6/0
* fairly backward-compatible profile : 10/0/0
* high throughput profile : 224/1/3

Besides the condition for checking NULL for mdm/aux/net should be relaxed
a little bit.
2016-10-14 16:33:19 +03:00
Denis Kenzior
e358485f37 ril_sofia3gr: Fix warning 2016-10-14 16:33:19 +03:00
Denis Kenzior
e964307ced AUTHORS: Mention Samrat's contributions 2016-10-14 16:33:19 +03:00
Denis Kenzior
d1d69cf667 AUTHORS: Mention Dragos' contributions 2016-10-14 16:33:19 +03:00
Denis Kenzior
bf6210bdbb AUTHORS: Mention Dongsu's contributions 2016-10-14 16:33:19 +03:00
Samrat Guha Niyogi
bcdd5a95c1 ril_sofia3gr: add ussd atom to post_online 2016-10-14 16:33:19 +03:00
Denis Kenzior
fcea7919f9 netmon: Fix enumeration 2016-10-14 16:33:19 +03:00
Denis Kenzior
6fd1c1ef33 include: Add netmon.h
Conflicts:
	ofono/Makefile.am
2016-10-14 16:33:17 +03:00
Denis Kenzior
4d960d898d doc: Add NetworkMonitor API 2016-10-14 16:30:46 +03:00
Denis Kenzior
a9f47b77ce udevng: Move from setup_icera to setup_ublox
As intended by 126b04
2016-10-14 16:30:46 +03:00
Dragos Tatulea
fb81c3571b atmodem: ublox: EPS now supported by newer ublox
Based on UBX-13002752 R33
2016-10-14 16:30:46 +03:00
Dragos Tatulea
7809498588 atmodem: add vendor enumeration for ublox toby
Required to differentiate between the old LISA family
of supported devices and future TOBY L2 devices.
2016-10-14 16:30:46 +03:00
Dragos Tatulea
4d05522b2a plugins/udevng: ublox: set model string
Necessary for supporting the ublox TOBY L2 modem.
2016-10-14 16:30:46 +03:00
Dongsu Park
b6b0306b39 plugins/udevng: support the U-Blox TOBY-L2 series
The newest generation of U-Blox TOBY-L2 series can be detected with
VID 0x1546 (the same as before), and one of the following PIDs:

* "0x1146" : high throughput profile
* "0x1141" : fairly back-compatible profile
* "0x1143" : low/medium throughput profile

This patch adds detection for high throughput mode.
2016-10-14 16:30:46 +03:00
Denis Kenzior
5c938a5b64 test: Add register-operator 2016-10-14 16:30:46 +03:00
Denis Kenzior
b04d30ff3e test: Add register-auto
Conflicts:
	ofono/Makefile.am
2016-10-14 16:30:44 +03:00
Denis Kenzior
4bdc8ac62c gitignore: Add rilmodem-cb and rilmodem-sms 2016-10-14 16:24:07 +03:00
Kuba Pawlak
fa20be318d hfpmodem: Handle repeated held call indicator
An issue with iPhone 5C iOS 9.2 triggers desynchronization in call
states. When an active call is put on hold and another call arrives,
it is in WAITING state. It should be possible to answer it by issuing
AT+CHLD=2 but the phone changes its state to INCOMING so ATA should be
used. This change is advertised by sending callheld:2 event, but it is
not handled. This event can be used to trigger CLCC poll to synchronize
call states.

+CIEV: 3,1   <- first call arrives
AT+CLCC
+CLCC: 1,1,4,0,0,"01234567890",129
OK
RING
+CLIP: "01234567890",129
ATA
OK
+CIEV: 2,1
+CIEV: 3,0.
AT+CHLD=2.$  <- first call is put on hold
OK
+CIEV: 7,2   <- notification confirming that call #1 is on hold
+CCWA: "09876543210",129,1     <- second call arrives
+CIEV: 7,2
+CIEV: 3,1
AT+CLCC
+CLCC: 1,1,1,0,0,"01234567890",129
+CLCC: 2,1,5,0,0,"09876543210",129 <- new call is still in WAITING state
OK
+CIEV: 7,2 <- phone iternally promotes WAITING call to INCOMING
AT+CHLD=2  <- there is no WAITING call anymore, ATA should be used
+CME ERROR:3
2016-10-14 16:24:07 +03:00
Denis Kenzior
3598f4edab gatchat: Add support for shutting down the server
By sending SIGUSR1 we can initiate a soft server-shutdown.
2016-10-14 16:24:07 +03:00
Denis Kenzior
0524862743 ril_sofia3gr: Add radio_settings atom 2016-10-14 16:23:57 +03:00
Denis Kenzior
d2cfc16201 AUTHORS: Mention John's contributions 2016-10-14 16:23:48 +03:00
Tony Espy
fd874f3a4c build: add support for upower plugin 2016-10-14 16:23:36 +03:00
Tony Espy
0a039db7da plugins: add upower battery monitor for bluetooth 2016-10-14 16:23:36 +03:00
Denis Kenzior
0e6ce9a38e rilmodem: Initialize ofono_error correctly 2016-10-14 16:23:36 +03:00
Tony Espy
3cad68861c build: untangle ATMODEM and BLUETOOTH conditionals 2016-10-14 16:23:36 +03:00
Denis Kenzior
70d9366499 HACKING: Update instructions with email address 2016-10-14 16:23:36 +03:00
Denis Kenzior
6c17d2b79c ril: Use g_ril_new_with_ucred 2016-10-14 16:23:36 +03:00
Denis Kenzior
811b478903 gril: Add g_ril_new_with_ucred 2016-10-14 16:23:36 +03:00
Denis Kenzior
6fcc2a1f68 gril: Remove unneeded defines 2016-10-14 16:23:36 +03:00
Denis Kenzior
792c4674c2 plugins: Add sofia3GR ril driver 2016-10-14 16:23:36 +03:00
Denis Kenzior
e9df792102 build: Fix building without atmodem support 2016-10-14 16:23:36 +03:00
Denis Kenzior
eb92f42c7d stktest: Remove usage of decode_at_error
Otherwise the build fails when building without atmodem support
2016-10-14 16:23:36 +03:00
Tony Espy
bcafdc8d70 build: add support for new test-rilmodem-cb
Conflicts:
	ofono/Makefile.am
2016-10-14 16:23:23 +03:00
Tony Espy
5aa8f72aaa rilmodem: fix call_barring_query_cb
The return value from a RIL_REQUEST_GET_FACILITY_LOCK
is the TS 27.007 service class bit vector of services
for the specified barring facility.  The value canf be
zero, which indicates "disabled for all".
2016-10-14 16:21:52 +03:00
Tony Espy
704a3ae354 unit: add new test-rilmodem-cb 2016-10-14 16:21:52 +03:00
Denis Kenzior
a4f91f2d80 ril: Get rid of ril_gprs_context_data 2016-10-14 16:21:52 +03:00
Denis Kenzior
e655837ccb rilmodem: Get rid of ril_gprs_context_data 2016-10-14 16:21:52 +03:00
Denis Kenzior
800ad72129 ril: Don't use ril_sim_data 2016-10-14 16:21:41 +03:00
Denis Kenzior
e6cae75c40 rilmodem: Get rid of ril_sim_data 2016-10-14 16:21:41 +03:00
Denis Kenzior
d655aec432 sim: Silence warning on 32-bit 2016-10-14 16:21:41 +03:00
Denis Kenzior
cd2d6a28aa gril: Use unsigned int instead of gsize
Sizeof gsize changes depending on 32/64 bit system.  However, in reality
it is always 4 bytes.
2016-10-14 16:21:41 +03:00
Denis Kenzior
8507197fa6 sim: Tweak debug statement 2016-10-14 16:21:41 +03:00
Denis Kenzior
ee6b3385db sim: Add additional DBG statements 2016-10-14 16:21:41 +03:00
Tony Espy
24b6aeab5c rilmodem: fix sim_status_cb debug logging
During the re-factoring of rilmodem's sim atom
messaging code, the sim_status_cb function's
RIL tracing code was converted to DBG calls.
This change adds the same prefix to DBG/trace
calls when a single message's parameters span
more than one DBG call. This makes it easier
to filter out trace messages when looking at a
log file.
2016-10-14 16:21:41 +03:00
Tony Espy
5436c2beea unit: update test-rilmodem-sms set_sca test case
Update test-rilmodem-sms set_sca test case to take
into account additional quotes used for sending
a SET_SMSC_ADDRESS request.
2016-10-14 16:21:41 +03:00
Tony Espy
87d947fe48 rilmodem: restore SET_SMSC_ADDRESS number format
Restore quoting of SMSC number string, as it's
required by at least one rild implementation (mako).
2016-10-14 16:21:41 +03:00
Denis Kenzior
af45298bc7 rilmodem: Remove unneeded include 2016-10-14 16:21:41 +03:00
Denis Kenzior
cdb32c9139 gril: Remove grilunsol.[ch] 2016-10-14 16:21:41 +03:00
Denis Kenzior
85a9daa5f4 rilmodem: Don't include grilunsol.h 2016-10-14 16:21:41 +03:00
Denis Kenzior
17a4fd7b78 ril: Don't include grilunsol.h 2016-10-14 16:21:41 +03:00
Denis Kenzior
d42b983dee gril: Remove g_ril_unsol_parse_data_call_list 2016-10-14 16:21:41 +03:00
Denis Kenzior
33b14a3326 rilmodem: Implement ril_setup_data_call_cb inline 2016-10-14 16:21:41 +03:00
Denis Kenzior
09ac10c3ac rilmodem: Implement get_active_data_calls_cb inline 2016-10-14 16:21:41 +03:00
Denis Kenzior
f47fe40799 gril: Remove unused str_array functions 2016-10-14 16:21:41 +03:00
Denis Kenzior
ef0532222f gril: Remove unused ril_radio_tech_to_string 2016-10-14 16:21:41 +03:00
Denis Kenzior
edf7608da8 gril: Remove unused ril_pinstate_to_string 2016-10-14 16:21:41 +03:00
Denis Kenzior
1bd019aec7 gril: Remove unused ril_cardstate_to_string 2016-10-14 16:21:41 +03:00
Denis Kenzior
57ea46e0d7 gril: Remove unused ril_authtype_to_string 2016-10-14 16:21:41 +03:00
Denis Kenzior
90c4dfe1e5 gril: Remove unused ril_apptype_to_string 2016-10-14 16:21:41 +03:00
Denis Kenzior
4112433e86 gril: Remove unused ril_appstate_to_string 2016-10-14 16:21:41 +03:00
Denis Kenzior
97830c757f gril: Remove unused ril_ofono_protocol_to_ril_string 2016-10-14 16:21:41 +03:00
Denis Kenzior
2dcfd64ff4 rilmodem: Remove drivers/rilmodem/gprs.h 2016-10-14 16:21:41 +03:00
Denis Kenzior
cba91bff8b rilmodem: Don't expose private structures 2016-10-14 16:21:41 +03:00
Denis Kenzior
7bf1f707ff rilmodem: Get rid of unnecessary exports 2016-10-14 16:21:24 +03:00
Denis Kenzior
aa6eed4eeb rilmodem: Get rid of ril_gprs_driver_data 2016-10-14 16:21:24 +03:00
Denis Kenzior
18e6d86edd ril: Get rid of gprs_driver_data 2016-10-14 16:21:24 +03:00
Denis Kenzior
e40d9e80c7 rilmodem: Get rid of useless member variable 2016-10-14 16:21:24 +03:00
Denis Kenzior
4176a82a0b rilmodem: Remove data reg state query retry logic
This is no longer needed as the query for max_cid is done in a different
logic flow.
2016-10-14 16:21:23 +03:00
Denis Kenzior
447d0af56c gril: Remove grilreply.[ch] 2016-10-14 16:21:23 +03:00
Denis Kenzior
284c7dfc48 rilmodem: Don't include grilreply.h 2016-10-14 16:21:23 +03:00
Denis Kenzior
a1a6ff7976 ril: Don't include grilreply.h 2016-10-14 16:21:23 +03:00
Denis Kenzior
e2e4b7c868 rilmodem: use g_new0 instead of g_try_new0 2016-10-14 16:21:23 +03:00
Denis Kenzior
5103af4321 gril: Remove g_ril_reply_parse_get_calls 2016-10-14 16:21:23 +03:00
Denis Kenzior
b3a10881e7 rilmodem: Implement clcc_poll_cb inline 2016-10-14 16:21:23 +03:00
Denis Kenzior
cbc9ce47e0 gril: Remove g_ril_reply_parse_retries 2016-10-14 16:21:23 +03:00
Denis Kenzior
cf059171d7 rilmodem: Implement ril_pin_change_state_cb inline 2016-10-14 16:21:23 +03:00
Denis Kenzior
ddabae7a54 gril: Remove g_ril_reply_oem_hook_raw 2016-10-14 16:21:23 +03:00
Denis Kenzior
aabfd23aed rilmodem: Implement inf_pin_retries_cb inline 2016-10-14 16:21:23 +03:00
Denis Kenzior
f7a1089bd6 gril: Remove g_ril_reply_oem_hook_strings 2016-10-14 16:21:23 +03:00
Denis Kenzior
1ba9668f55 rilmodem: Implement mtk_pin_retries_cb inline 2016-10-14 16:21:23 +03:00
Denis Kenzior
f6adb2a47e gril: Remove grilrequest.[ch] 2016-10-14 16:21:23 +03:00
Denis Kenzior
1254716006 rilmodem: Don't include grilrequest.h 2016-10-14 16:21:23 +03:00
Denis Kenzior
1da578f9af ril: Remove grilrequest.h 2016-10-14 16:21:23 +03:00
Denis Kenzior
863b91f79e gril: Remove g_ril_request_oem_hook_strings 2016-10-14 16:21:23 +03:00
Denis Kenzior
5c4cd29fc2 rilmodem: Inline g_ril_request_oem_hook_strings 2016-10-14 16:21:23 +03:00
Denis Kenzior
78ea7d9946 gril: Remove g_ril_request_oem_hook_raw 2016-10-14 16:21:23 +03:00
Denis Kenzior
e684560e16 rilmodem: inline request_oem_hook_raw 2016-10-14 16:21:23 +03:00
Denis Kenzior
0af7fd0c2c gril: Remove g_ril_reply_parse_data_reg_state 2016-10-14 16:21:23 +03:00
Denis Kenzior
9b20f4c904 rilmodem: Refactor ril_data_reg_cb 2016-10-14 16:21:23 +03:00
Denis Kenzior
1c217547fd gril: Remove g_ril_reply_parse_voice_reg_state 2016-10-14 16:21:23 +03:00
Denis Kenzior
1939a251a0 rilmodem: Implement reg_cb inline 2016-10-14 16:21:23 +03:00
Denis Kenzior
deaee2b27d rilmodem: Add ril_util_registration_state_to_status 2016-10-14 16:21:23 +03:00
Denis Kenzior
28d59901c2 gril: Add parcel_r_strv 2016-10-14 16:21:23 +03:00
Denis Kenzior
d6ffc2dae7 gril: Remove g_ril_request_setup_data_call 2016-10-14 16:21:23 +03:00
Denis Kenzior
59d80cdaa2 rilmodem: Implement activate_primary inline 2016-10-14 16:21:23 +03:00
Denis Kenzior
e680c7a3dc rilmodem: Add ril_util_gprs_proto_to_ril_string 2016-10-14 16:21:23 +03:00
Denis Kenzior
8fb813ab94 gril: Remove g_ril_reply_parse_sim_status 2016-10-14 16:21:23 +03:00
Denis Kenzior
ca507cbfaf rilmodem: Refactor get_sim_status reply parsing 2016-10-14 16:21:23 +03:00
Denis Kenzior
d40079d0b5 gril: Add parcel skip string 2016-10-14 16:21:23 +03:00
Denis Kenzior
9579ce72a0 gril: Remove g_ril_reply_parse_sim_io & related 2016-10-14 16:21:23 +03:00
Denis Kenzior
59880f886c rilmodem: Implement sim io parser inline 2016-10-14 16:21:23 +03:00
Denis Kenzior
3cb3b96104 rilmodem: Remove unused ril_util_sim_state_query 2016-10-14 16:21:01 +03:00
Tony Espy
4a384a95a0 rilmodem: fix set_call_barring reply trace (mako)
This change restores the trace output for a reply to a
REQUEST_SET_FACILITY_LOCK used by the set function.
2016-10-14 16:21:01 +03:00
Tony Espy
c69b01677f unit: add new test-rilmodem-sms test cases
Add new test-rilmodem-sms test cases for the remaining
untested atom functions, including two tests for incoming
SMS unsolicited responses. Also updated test-rilmodem-cs
due to rilmodem-test-server changes.
2016-10-14 16:21:01 +03:00
Tony Espy
fd358758ce unit: add write support to rilmodem-test-server
This change adds write support to the rilmodem-test-server
in order to support testing receipt of unsolicted RIL
responses.
2016-10-14 16:21:01 +03:00
Denis Kenzior
b2d55c3bc4 rilmodem: Remove unused ril_util_call_compare_by_status 2016-10-14 16:21:01 +03:00
Denis Kenzior
d0c9970d15 rilmodem: Remove unused compare_by_phone_number 2016-10-14 16:21:01 +03:00
Denis Kenzior
daccbdbeaf rilmodem: Remove unused ril_util_call_compare 2016-10-14 16:21:01 +03:00
Denis Kenzior
71c032167d rilmodem: Remove unused ril_util_call_compare_by_id 2016-10-14 16:21:01 +03:00
Denis Kenzior
82ed6eeba5 gril: Remove g_ril_request_set_net_select_manual 2016-10-14 16:21:01 +03:00
Denis Kenzior
51cb5c773a rilmodem: Implement ril_register_manual inline 2016-10-14 16:21:01 +03:00
Denis Kenzior
da3fd754a7 gril: Remove g_ril_request_deactivate_data_call 2016-10-14 16:21:01 +03:00
Denis Kenzior
7b70463912 rilmodem: Use ril_util_build_deactivate_data_call 2016-10-14 16:21:01 +03:00
Denis Kenzior
3107fa0ce4 rilmodem: Add ril_util_build_deactivate_data_call 2016-10-14 16:21:01 +03:00
Denis Kenzior
ade915136b gril: Remove g_ril_request_sim_write_record 2016-10-14 16:21:01 +03:00
Denis Kenzior
4ad21b004a rilmodem: implement update_record inline 2016-10-14 16:21:01 +03:00
Denis Kenzior
9ef2e5353c gril: Remove g_ril_request_sim_write_binary 2016-10-14 16:21:01 +03:00
Denis Kenzior
1ca3716e8f rilmodem: Implement ril_sim_update_binary inline 2016-10-14 16:21:01 +03:00
Denis Kenzior
3df6a64280 gril: Remove g_ril_request_sim_read_record 2016-10-14 16:21:01 +03:00
Denis Kenzior
476af72e35 rilmodem: Implement ril_sim_read_record inline 2016-10-14 16:21:01 +03:00
Denis Kenzior
b8c7bcc996 gril: Remove g_ril_request_sim_read_binary 2016-10-14 16:21:01 +03:00
Denis Kenzior
0418a7db78 rilmodem: Implement ril_sim_read_binary inline 2016-10-14 16:21:01 +03:00
Denis Kenzior
1ab5d2e278 gril: Remove g_ril_request_sim_read_info 2016-10-14 16:21:01 +03:00
Denis Kenzior
4155f4ad82 rilmodem: Implement ril_sim_read_info inline 2016-10-14 16:21:01 +03:00
Tony Espy
4b5ebcbefd build: update for test-rilmodem-cs changes
Conflicts:
	ofono/Makefile.am
2016-10-14 16:20:59 +03:00
Tony Espy
1298be1adb unit: re-factor test-rilmodem-cs server logic
Use the new rilmodem-test-server functions.
2016-10-14 16:17:51 +03:00
Tony Espy
52a4e9b5e6 build: add support for test-rilmodem-sms
Conflicts:
	ofono/Makefile.am
2016-10-14 16:17:48 +03:00
Tony Espy
23373e6ce7 unit: add new test-rilmodem-sms 2016-10-14 16:11:14 +03:00
Tony Espy
ed23172c8b plugins: rm unneeded exits/sleeps from ril plugin 2016-10-14 16:11:14 +03:00
Tony Espy
1c3fc7dedc ril: remove unecessary sleep from ril plugin 2016-10-14 16:11:14 +03:00
Denis Kenzior
8f4101d57e gril: Remove g_ril_unsol_parse_radio_state_changed 2016-10-14 16:11:14 +03:00
Denis Kenzior
2cda8bc793 ril: Implement radio state changed parsing inline 2016-10-14 16:11:14 +03:00
Petr Vorel
51d004c32c gobi: Add missing _GNU_SOURCE
as we're using O_CLOEXEC
2016-10-14 16:11:14 +03:00
Denis Kenzior
74e7e2444f rilmodem: Simplify ril_gprs_set_attached 2016-10-14 16:11:14 +03:00
Denis Kenzior
5e6a565274 gril: Remove g_ril_reply_parse_operator 2016-10-14 16:10:52 +03:00
Denis Kenzior
f2c7812932 rilmodem: Implement ril_cops_cb inline 2016-10-14 16:10:52 +03:00
Denis Kenzior
8ce00e707b gril: Remove g_ril_reply_parse_avail_ops 2016-10-14 16:10:52 +03:00
Denis Kenzior
6aaae6bc6a rilmodem: Implement ril_cops_list_cb inline 2016-10-14 16:10:52 +03:00
Denis Kenzior
d34c5fd54d gril: Remove g_ril_unsol_parse_nitz 2016-10-14 16:10:52 +03:00
Denis Kenzior
8ed185e32d rilmodem: Implement ril_nitz_notify inline 2016-10-14 16:10:52 +03:00
Denis Kenzior
d789992c87 gril: Remove g_ril_unsol_parse_signal_strength 2016-10-14 16:10:52 +03:00
Denis Kenzior
d3f266372b rilmodem: Inline signal strength parsing & calc 2016-10-14 16:10:52 +03:00
Alfonso Sanchez-Beato
8e036c29fc gitignore: Ignore rilmodem-cs test binary 2016-10-14 16:10:46 +03:00
Denis Kenzior
8950228a9f gril: Remove g_ril_reply_parse_call_fail_cause 2016-10-14 16:09:58 +03:00
Denis Kenzior
54cfafa20d rilmodem: Implement lastcause_cb inline 2016-10-14 16:09:58 +03:00
Denis Kenzior
17fdc3f451 gril: Remove g_ril_unsol_parse_supp_svc_notif 2016-10-14 16:09:57 +03:00
Denis Kenzior
8fe0b753e8 rilmodem: Implement ril_ss_notify inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
06e61e1d8b gril: Remove g_ril_request_dial 2016-10-14 16:09:57 +03:00
Denis Kenzior
4cbc64e4e9 rilmodem: Implement dial inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
7d90b6e86c gril: Remove g_ril_request_hangup 2016-10-14 16:09:57 +03:00
Denis Kenzior
01fcc3df4b rilmodem: Implement hangups inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
52a0680c31 gril: Remove g_ril_request_dtmf 2016-10-14 16:09:57 +03:00
Denis Kenzior
809cd31f3f rilmodem: Implement send_one_dtmf inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
c05b8864b0 TODO: Add DTMF batch hint task 2016-10-14 16:09:57 +03:00
Denis Kenzior
f12701af82 gril: Remove g_ril_request_separate_conn 2016-10-14 16:09:57 +03:00
Denis Kenzior
f6f27acb04 rilmodem: Implement ril_private_chat inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
5f45c9487b gril: Remove g_ril_request_set_supp_svc_notif 2016-10-14 16:09:57 +03:00
Denis Kenzior
fc286131db rilmodem: Implement enable_supp_svc inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
e037227dc1 rilmodem: Get rid of ril_voicecall_driver_data 2016-10-14 16:09:57 +03:00
Denis Kenzior
7cd35aaac3 voicecall: Remove redundant comment 2016-10-14 16:09:57 +03:00
Denis Kenzior
0c52074896 ril: Don't use ril_voicecall_driver_data 2016-10-14 16:09:57 +03:00
Denis Kenzior
c351edd7a5 rilmodem: Remove auto-answering logic
This was only used for testing at the factory for a specific product.
Does not belong in the driver code.
2016-10-14 16:09:57 +03:00
Denis Kenzior
80ead5dedb gril: Remove g_ril_request_pin_change_state 2016-10-14 16:09:57 +03:00
Denis Kenzior
0684eeffc0 rilmodem: Implement ril_pin_change_state inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
918706835b gril: Remove g_ril_request_change_passwd 2016-10-14 16:09:57 +03:00
Denis Kenzior
67b37c9cd5 rilmodem: Implement ril_change_passwd inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
9bcb302884 gril: Remove g_ril_request_pin_send_puk 2016-10-14 16:09:57 +03:00
Denis Kenzior
80f7393415 rilmodem: Implement ril_pin_send_puk inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
58759583fa gril: Remove g_ril_request_pin_send 2016-10-14 16:09:57 +03:00
Denis Kenzior
63b3dc2be9 rilmodem: Implement ril_pin_send inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
57a242851a rilmodem: Fix up headers in sms 2016-10-14 16:09:57 +03:00
Denis Kenzior
b5f01aa8d2 gril: Remove g_ril_reply_parse_get_smsc_address 2016-10-14 16:09:57 +03:00
Denis Kenzior
19563292d9 rilmodem: Implement ril_csca_query_cb inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
6780b25091 gril: Remove g_ril_reply_parse_sms_response 2016-10-14 16:09:57 +03:00
Denis Kenzior
7c9242398e rilmodem: Implement ril_submit_sms_cb inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
e244554917 gril: Remove g_ril_request_sms_acknowledge 2016-10-14 16:09:57 +03:00
Denis Kenzior
60782673dc rilmodem: Implement ril_ack_delivery inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
8442cc21cd gril: Remove g_ril_request_sms_cmgs 2016-10-14 16:09:57 +03:00
Denis Kenzior
1d6082005e rilmodem: Implement ril_cmgs inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
2a45912752 gril: Remove g_ril_request_set_smsc_address 2016-10-14 16:09:57 +03:00
Denis Kenzior
bef4e531b7 rilmodem: Implement ril_csca_set inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
cc2781ee50 gril: Remove g_ril_unsol_parse_new_sms & related 2016-10-14 16:09:57 +03:00
Denis Kenzior
340b66025b rilmodem: Implement ril_sms_notify inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
9879fd990c rilmodem: Remove unneeded code 2016-10-14 16:09:57 +03:00
Denis Kenzior
74db6eb392 rilmodem: Remove comments that state the obvious 2016-10-14 16:09:57 +03:00
Denis Kenzior
771d338001 gril: Remove radio-setting specific constants 2016-10-14 16:09:57 +03:00
Denis Kenzior
6808dd688e rilmodem: Move constants from gril 2016-10-14 16:09:57 +03:00
Denis Kenzior
2d46bbac4d gril: Remove g_ril_request_set_preferred_network_type 2016-10-14 16:09:57 +03:00
Denis Kenzior
442b427a19 rilmodem: Implement ril_set_rat_mode inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
bebe9d8d8a gril: Remove g_ril_reply_parse_get_preferred_network_type 2016-10-14 16:09:57 +03:00
Denis Kenzior
1b21edb1f5 rilmodem: Implement ril_rat_mode_cb inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
52ee74f0af gril: Remove g_ril_request_screen_state 2016-10-14 16:09:57 +03:00
Denis Kenzior
296dd76ff7 rilmodem: Implement ril_set_fast_dormancy inline 2016-10-14 16:09:57 +03:00
Denis Kenzior
0e68c13837 rilmodem: Get rid of pointless g_idle_add 2016-10-14 16:09:57 +03:00
Denis Kenzior
d332624f5c rilmodem: Get rid of ril_radio_settings_driver_data 2016-10-14 16:09:57 +03:00
Denis Kenzior
fbee20e850 ril: Pass GRil object to radio_settings
Instead of ril_radio_settings_driver_data
2016-10-14 16:09:57 +03:00
Denis Kenzior
eb52bc247a rilmodem: Get rid of radio-settings.h 2016-10-14 16:03:39 +03:00
Denis Kenzior
0741acca48 build: Make distcheck pass again 2016-10-14 16:03:39 +03:00
Denis Kenzior
70d2d70623 gril: Fix distcheck error 2016-10-14 16:03:39 +03:00
Denis Kenzior
baca4c0371 rilmodem: Get rid of g_try_new0 2016-10-14 16:03:39 +03:00
Denis Kenzior
aa5e04cbca build: Tweak gril_sources 2016-10-14 16:03:39 +03:00
Tony Espy
f1cc9990b3 build: add support for rilmodem-cs test
Conflicts:
	ofono/Makefile.am
2016-10-14 16:03:37 +03:00
Tony Espy
6bd0264a22 unit: add new test rilmodem-cs
This commit adds a new style of build-time/unit test to
rilmodem.  These tests setup a dummy server socket and
attach a gril instance to it.  This allows rilmodem
call-settings atom functions to be tested directly,
validating request parcels received by the server-side,
and callbacks that happen in response to canned responses
sent by the server-side.
2016-10-14 16:00:33 +03:00
Denis Kenzior
19166a33ef gril: Remove g_ril_request_send_ussd 2016-10-14 16:00:26 +03:00
Denis Kenzior
eb6128ccb6 rilmodem: Make ril_ussd_request inline 2016-10-14 16:00:26 +03:00
Denis Kenzior
46e5909e17 rilmodem: Rework ril_ussd_request 2016-10-14 16:00:26 +03:00
Denis Kenzior
b5652aaf09 rilmodem: Rework ril_ussd_cancel 2016-10-14 16:00:26 +03:00
Denis Kenzior
aa4b7c2a89 gril: Remove g_ril_unsol_parse_ussd and related 2016-10-14 16:00:26 +03:00
Denis Kenzior
1b274a6470 rilmodem: Implement ril_ussd_notify inline 2016-10-14 16:00:26 +03:00
Denis Kenzior
cc6a53b191 rilmodem: Inline query_serial and query_revision
query_serial was supposed to use parse_imei functionality, but called
baseband_version instead.  Rework both these to use inline parsers.
2016-10-14 16:00:26 +03:00
Denis Kenzior
1b5b1b545b gril: Remove g_ril_reply_parse_get_imei 2016-10-14 16:00:26 +03:00
Denis Kenzior
4389fffb72 gril: Remove g_ril_reply_parse_baseband_version 2016-10-14 16:00:26 +03:00
Denis Kenzior
95ca9ae64d rilmodem: Rework devinfo driver
Remove comments that state the obvious
Remove pointless allocations / frees
2016-10-14 16:00:26 +03:00
Denis Kenzior
71aded607f rilmodem: Rework header order in call-volume 2016-10-14 16:00:26 +03:00
Denis Kenzior
d209f372d4 gril: Remove g_ril_reply_parse_get_mute 2016-10-14 16:00:26 +03:00
Denis Kenzior
aa16342fc1 rilmodem: Implement probe_mute_cb inline 2016-10-14 16:00:26 +03:00
Denis Kenzior
2a7a6f7f0c gril: Remove g_ril_request_set_mute 2016-10-14 16:00:26 +03:00
Denis Kenzior
08a320ad90 rilmodem: Implement ril_call_volume_mute inline 2016-10-14 16:00:26 +03:00
Denis Kenzior
ff1dffebe4 rilmodem: Rework header order in call-settings 2016-10-14 16:00:26 +03:00
Denis Kenzior
fac809eac9 rilmodem: Rework header order in call-forwarding 2016-10-14 16:00:26 +03:00
Denis Kenzior
6420640395 rilmodem: Rework header order in call-barring 2016-10-14 16:00:26 +03:00
Denis Kenzior
400cfed044 gril: Remove g_ril_reply_parse_set_facility_lock 2016-10-14 16:00:26 +03:00
Denis Kenzior
eef25504f9 rilmodem: Implement ril_call_barring_set_cb inline 2016-10-14 16:00:26 +03:00
Denis Kenzior
4db63e87f7 gril: Remove g_ril_reply_parse_query_facility_lock 2016-10-14 16:00:26 +03:00
Denis Kenzior
440da3c009 rilmodem: Implement ril_call_barring_query_cb inline 2016-10-14 16:00:26 +03:00
Denis Kenzior
d3e2ce9c9b gril: Remove g_ril_request_change_barring_password 2016-10-14 16:00:26 +03:00
Denis Kenzior
93cd410a7b rilmodem: Make ril_call_barring_set_passwd inline 2016-10-14 16:00:26 +03:00
Denis Kenzior
e0fbec976b gril: Remove g_ril_request_set_facility_lock 2016-10-14 16:00:25 +03:00
Denis Kenzior
f34d2f9dcf rilmodem: Implement ril_call_barring_set inline 2016-10-14 16:00:25 +03:00
Denis Kenzior
361c552898 gril: Remove g_ril_request_query_facility_lock 2016-10-14 16:00:25 +03:00
Denis Kenzior
d675c3362f rilmodem: Implement ril_call_barring_query inline 2016-10-14 16:00:25 +03:00
Denis Kenzior
9c014fba03 gril: Remove g_ril_request_power 2016-10-14 16:00:25 +03:00
Denis Kenzior
89a76af30f ril: Implement power on/off inline 2016-10-14 16:00:25 +03:00
Denis Kenzior
120f200ba1 gril: Remove g_ril_reply_parse_query_call_fwd 2016-10-14 16:00:25 +03:00
Denis Kenzior
f2a8ccf079 rilmodem: Implement g_ril_request_call_fwd inline 2016-10-14 16:00:25 +03:00
Denis Kenzior
dec2dcd735 gril: Remove g_ril_request_call_fwd and related 2016-10-14 16:00:25 +03:00
Denis Kenzior
29a1f8d9ed rilmodem: Rework call-forwarding requests 2016-10-14 16:00:25 +03:00
Denis Kenzior
3b7ef48976 gril: Remove g_ril_reply_parse_imsi 2016-10-14 16:00:25 +03:00
Denis Kenzior
b9ea2e0924 rilmodem: Implement ril_imsi_cb inline 2016-10-14 16:00:25 +03:00
Denis Kenzior
0845da6a2e gril: Remove g_ril_reply_parse_get_clir & related 2016-10-14 16:00:25 +03:00
Denis Kenzior
300a11c2e3 rilmodem: Implement ril_clir_query_cb inline 2016-10-14 16:00:25 +03:00
Denis Kenzior
c5cc1ff7c8 gril: Remove g_ril_reply_parse_query_clip 2016-10-14 16:00:25 +03:00
Denis Kenzior
cdaa2fedab rilmodem: Implement ril_clip_query_cb inline 2016-10-14 16:00:25 +03:00
Denis Kenzior
2684fbf24d gril: Remove g_ril_reply_parse_query_call_waiting 2016-10-14 16:00:25 +03:00
Denis Kenzior
93300ee95e rilmodem: Implement ril_cw_query_cb inline 2016-10-14 16:00:25 +03:00
Denis Kenzior
8c175ab282 gril: Remove g_ril_request_set_clir 2016-10-14 16:00:25 +03:00
Denis Kenzior
24b9943dc1 rilmodem: Implement ril_clir_set inline 2016-10-14 16:00:25 +03:00
Denis Kenzior
3e711843cb gril: g_ril_request_query_call_waiting 2016-10-14 16:00:25 +03:00
Denis Kenzior
ead815513d rilmodem: Implement ril_cw_query inline 2016-10-14 16:00:25 +03:00
Denis Kenzior
dd78ee5fcb gril: Remove g_ril_request_set_call_waiting 2016-10-14 16:00:25 +03:00
Denis Kenzior
e61bfe0f38 rilmodem: Implement ril_cw_set inline 2016-10-14 16:00:25 +03:00
Alfonso Sanchez-Beato
f22a531051 gril: Fix access to notify callbacks
Entries to the table of notification callbacks can be added by the
callbacks while being called. This caused a glib error as gril was
using an iterator to the hash table while the table was being modified.
Fixed by avoiding the unnecesary loop.
2016-10-14 16:00:25 +03:00
Simon Fels
c2a1c60b92 hfp_ag_bluez5: use codec negotiation 2016-10-14 16:00:25 +03:00
Simon Fels
82bf1057bb emulator: add codec negotiation support 2016-10-14 16:00:25 +03:00
Simon Fels
1a25661400 hfp_ag_bluez5: Add initial handsfree audio driver 2016-10-14 16:00:25 +03:00
Alfonso Sanchez-Beato
466a65f2da gril: Remove asserts 2016-10-14 16:00:25 +03:00
Alfonso Sanchez-Beato
a672583053 rildev: Do not create modems if no env var set
Do not create rilmodem instances if the environment variable
OFONO_RIL_DEVICE is not set.
2016-10-14 16:00:25 +03:00
Denis Kenzior
f47e720628 gril: Remove g_ril_request_read_imsi 2016-10-14 16:00:25 +03:00
Denis Kenzior
c0433efc12 rilmodem: Move get_imsi implementation to rilmodem 2016-10-14 16:00:25 +03:00
Denis Kenzior
5fc98f5b59 gril: Fix IO reference counting 2016-10-14 16:00:25 +03:00
Denis Kenzior
e7d60078db gril: Remove unused structure members 2016-10-14 16:00:25 +03:00
Denis Kenzior
b6abbc0ece gril: Remove unused header 2016-10-14 16:00:25 +03:00
Denis Kenzior
a7eb318f01 gril: Remove unused function 2016-10-14 16:00:25 +03:00
Denis Kenzior
1674126665 gril: Remove unused function 2016-10-14 16:00:25 +03:00
Alfonso Sanchez-Beato
b1bb48e59f build: Add rilmodem to the build
Build gril, the rilmodem and infineon drivers, and the corresponding
plugins.

Conflicts:
	ofono/Makefile.am
	ofono/configure.ac
2016-10-14 16:00:23 +03:00
Alfonso Sanchez-Beato
abfebddbb9 rildev: plugin that creates ril-type modems
This plugin creates modems that use the rilmodem driver by looking at
environment variables: when OFONO_RIL_DEVICE exists it creates a ril
modem of the sub-type specified by the variable. OFONO_RIL_NUM_SIM_SLOTS
specifies the number of SIM slots for multi-SIM modems.
2016-10-14 15:57:52 +03:00
Alfonso Sanchez-Beato
5fb4a13562 infineon: Definitions for infineon modem 2016-10-14 15:57:52 +03:00
Alfonso Sanchez-Beato
4ff1488b2e infineon: Plugin for infineon modems
Plugin for infineon modems, which is a variant of the ril modem.
2016-10-14 15:57:52 +03:00
Tony Espy
2b4db9a52b ril: Plugin for Android modems
Plugin for Android modem, which uses the rilmodem driver.

Co-authored-by: Tony Espy <espy@canonical.com>
Co-authored-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Co-authored-by: Alfonso Sanchez-Beato <alfonso.sanchez-beato@canonical.com>
Co-authored-by: Islam Amer <islam.amer@jollamobile.com>
Co-authored-by: Jussi Kangas <jussi.kangas@tieto.com>
Co-authored-by: Juho Hämäläinen <juho.hamalainen@tieto.com>
Co-authored-by: Martti Piirainen <martti.piirainen@canonical.com>
Co-authored-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
Co-authored-by: Tommi Kenakkala <tommi.kenakkala@oss.tieto.com>
Co-authored-by: Petri Takalokastari <petri.takalokastari@oss.tieto.com>
Co-authored-by: Miia Leinonen <miia.leinonen@oss.tieto.com>
Co-authored-by: Mikko Hurskainen <mikko.hurskainen@nomovok.com>
Co-authored-by: You-Sheng Yang <vicamo.yang@canonical.com>
2016-10-14 15:57:51 +03:00
Tony Espy
05ca5c155b rilmodem: driver for Android modems
Driver for modems that are accessed through the Android Radio Interface
Layer (RIL) for telephony, using the gril library. The driver is almost
feature complete with some exceptions, being CBS and SAT the most
prominent.

Co-authored-by: Tony Espy <espy@canonical.com>
Co-authored-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Co-authored-by: Alfonso Sanchez-Beato <alfonso.sanchez-beato@canonical.com>
Co-authored-by: Islam Amer <islam.amer@jollamobile.com>
Co-authored-by: Jussi Kangas <jussi.kangas@tieto.com>
Co-authored-by: Juho Hämäläinen <juho.hamalainen@tieto.com>
Co-authored-by: Petri Takalokastari <petri.takalokastari@oss.tieto.com>
Co-authored-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
Co-authored-by: Tommi Kenakkala <tommi.kenakkala@oss.tieto.com>
Co-authored-by: Miia Leinonen <miia.leinonen@oss.tieto.com>
Co-authored-by: Martti Piirainen <martti.piirainen@canonical.com>
Co-authored-by: You-Sheng Yang <vicamo.yang@canonical.com>
2016-10-14 15:57:51 +03:00
Tony Espy
c55ac50f4c gril: Library to communicate with rild
gril is a library used to communicate with rild, the Android telephony
daemon. Communication happens using a named socket over which binder
parcels are transmitted.

Co-authored-by: Tony Espy <espy@canonical.com>
Co-authored-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Co-authored-by: Alfonso Sanchez-Beato <alfonso.sanchez-beato@canonical.com>
Co-authored-by: Mikko Hurskainen <mikko.hurskainen@nomovok.com>
Co-authored-by: You-Sheng Yang <vicamo.yang@canonical.com>
Co-authored-by: Ratchanan Srirattanamet <peathot@hotmail.com>
2016-10-14 15:57:30 +03:00
Simon Fels
aa32435945 hfp_ag_bluez5: register audio card
To let others (PulseAudio) be notified when a handsfree device is
connected with us and can be used for audio routing we need to
expose this by registering a audio card with the correct type.
2016-10-14 15:57:07 +03:00
Denis Kenzior
e940b97389 emulator: Add ofono_emulator_set_handsfree_card 2016-10-14 15:57:07 +03:00
Denis Kenzior
24ba9a3cf7 include: Add ofono_emulator_set_handsfree_card 2016-10-14 15:57:07 +03:00
Denis Kenzior
f7b8c07a3b AUTHORS: Mention Simon's contributions 2016-10-14 15:57:07 +03:00
Simon Fels
159083d9c3 handsfree-audio: add type for our audio cards
When registering audio cards for the handsfree and gateway roles we
need a way for our users to differentiate between both to decide which
of them they start using for their purpose.
2016-10-14 15:57:07 +03:00
Slava Monich
37d7bc057c [ofono] Remove merge artifact 2016-10-14 15:55:57 +03:00
Slava Monich
6d1521313f [ofono] Remove the old rilemodem
It's going to be overwritten by the one coming from upstream.
2016-10-14 15:55:21 +03:00
Slava Monich
1d926b9415 Merge branch 'housekeeping' into 'master'
See merge request !86
2016-10-14 08:52:55 +00:00
Slava Monich
f665278df3 Merge branch 'max_calls' into 'master'
Make sure that maximum number of simultaneous calls is not zero

Some RILs provide NULL string instead of this parameter.
Reported by the community.

See merge request !85
2016-10-14 08:52:07 +00:00
Slava Monich
0bd5130e02 [ofono] Housekeeping
Removed some unnecessary and suplicate code from ril_gprs_context.

Moved ril_address_family to ril_gprs_context.c because it's not used
anywhere else.
2016-10-13 13:10:31 +03:00
Slava Monich
af2c27ea0f [ril] Make sure that maximum number of simultaneous calls is not zero. Fixes MER#1672
Some RILs provide NULL string instead of this parameter.
2016-10-13 12:15:09 +03:00
Slava Monich
3370c09c89 main: Make -d option repeatable
Concatenating the patterns makes more sense than using the last
supplied value and leaking the previous allocated patterns.
2016-10-07 10:48:39 +03:00
Slava Monich
cd23203094 Merge branch 'libmce' into 'master'
Use libmce-glib to track the display state

See merge request !84
2016-10-07 07:48:05 +00:00
Slava Monich
64fcdddaac [ofono] Use libmce-glib to track the display state. JB#36523 2016-10-06 17:36:17 +03:00
Slava Monich
2039b1bd09 Merge branch 'empty' into 'master'
Add EmptyConfig option

See merge request !83
2016-10-03 12:42:56 +00:00
Slava Monich
a52666dc20 [ril] Added EmptyConfig configuration option. Fixes MER#1660
If it's enabled, then all [ril_x] sections are ignored even
if they are present, and no default configuration is created.
2016-10-01 16:43:50 +03:00
Slava Monich
3b4ce1f47b Merge branch 'cached_spn' into 'master'
Don't update SPN while slot is being enabled or disabled

To avoid bothering clients with inconsistent states that make
little sense.

See merge request !82
2016-09-29 10:42:46 +00:00
Slava Monich
d8aefd40c4 [ril] Don't update SPN while slot is being enabled or disabled. Fixes JB#36420
It's better to hold it off until we arrive at a consistent state.
2016-09-28 00:18:15 +03:00
Slava Monich
e79055354c Merge branch 'master' into 'master'
Remove bluez build requirement

There doesn't seem to be any reason for requiring bluez at build time.
Besides since bluez (5) is renamed as bluez5 this won't be compatible
with it.

See merge request !81
2016-09-21 21:45:12 +00:00
Slava Monich
5e75f650c3 Merge branch 'ussd' into 'master'
Don't fail USSD cancel requests

See merge request !80
2016-09-21 21:44:25 +00:00
Jarko Poutiainen
ae782ca6f2 [packaging] remove bluez build requirement.Contributes to JB#36046 2016-09-21 16:10:59 +03:00
Slava Monich
b929a8e8c8 [ril] Don't fail USSD cancel requests from the core. Contributest to JB#36348
If we pass RIL_REQUEST_CANCEL_USSD error to the core, ofono will stay in
its current state and reject the subsequent USSD requests.
2016-09-21 13:41:47 +03:00
Slava Monich
530c3bc812 [ril] Improved parsing of RIL_UNSOL_ON_USSD packets
Particularly, prevent the crash if the USSD type string is missing.
2016-09-21 13:34:15 +03:00
martinjones
0e1a58781f Merge branch 'conf_proto' into 'master'
[ril] Fix creating multiparty and splitting multiparty. Contributes to JB#4743



See merge request !79
2016-08-11 09:41:40 +00:00
Martin Jones
77a26177e5 [ril] Fix creating multiparty and splitting multiparty. Contributes to JB#4743 2016-08-11 09:39:40 +00:00
Slava Monich
f6ea7e4c36 Merge branch 'cf_get_prop' into 'master'
Allow multiple pending org.ofono.CallForwarding.GetProperties

See merge request !77
2016-08-11 08:13:22 +00:00
Slava Monich
babea14604 Merge branch 'jb35840' into 'master'
See merge request !78
2016-07-27 13:24:16 +00:00
Slava Monich
e13ae6d5b3 [ril] Fixed default single-SIM config. Fixes JB#35840
It has to be Jolla1 compatible.
2016-07-27 16:00:54 +03:00
Slava Monich
40ce8f7185 Merge branch 'sim_write' into 'master'
SIM write support

If it's done right, quite a few things (those that have to do with
writing stuff to SIM card) should start working.

See merge request !76
2016-07-25 09:19:54 +00:00
Slava Monich
f68585a784 [ril] Implemented SIM write I/O support. Fixes MER#1199 2016-07-25 12:15:06 +03:00
Slava Monich
16105b8ace [ril] Cleaned up call forwarding code. JB#20921 2016-07-25 12:13:22 +03:00
Slava Monich
91245de799 [ofono] call-forwarding: allow multiple pending GetProperties
The very first call that that every org.ofono.CallForwarding
client makes is GetProperties. With multiple clients, only the
first one was waiting for the completion of the initial query,
all other calls were rejected with org.ofono.Error.InProgress.
In theory, the clients could retry the call later, but in
reality very few clients actually do that.
2016-07-20 22:57:49 +03:00
Slava Monich
c52471132a Merge branch 'pin_retries' into 'master'
Query number of retries left with empty pin

This works with some Qualcomm RILs. Those RILs that don't support
it will fail this request with no harm done. In case if it turns
out to be harmful with some RILs, it can be turned off with
emptyPinQuery=false in ril_subscription.conf

See merge request !75
2016-07-15 14:07:17 +00:00
Slava Monich
a8e7b86733 Merge branch 'band-mode' into 'master'
Query available band modes at startup

With some RIL implementations, RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE
causes some magic Android properties to appear. Otherwise it's
harmless and fairly useless.

See merge request !72
2016-07-15 14:07:00 +00:00
Slava Monich
8829682fad [ril] Query number of retries left with empty pin. MER#1089
This works with some Qualcomm RILs. Those RILs that don't support it
will fail this request with no harm done.

In case if turns out to be harmful with some RILs, it can be turned off
with emptyPinQuery=false in ril_subscription.conf
2016-07-07 11:37:54 +03:00
Slava Monich
246e30d1a5 Merge branch 'locked_pins' into 'master'
Implement SC facility lock query

Otherwise `org.ofono.SimManager` `LockedPins` state gets lost after
ofono is restarted. A few cherry-picks from upstream were required.

See merge request !73
2016-07-07 08:34:25 +00:00
Slava Monich
83267e1fa5 Merge branch 'ril_phonebook' into 'master'
Free phonebook state if export hasn't finished

Fixes memory leaks like these:

==21616== 56 (8 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 437 of 520
==21616==    at 0x483F380: malloc (vg_replace_malloc.c:296)
==21616==    by 0x4AEB26F: g_malloc (gmem.c:94)
==21616==    by 0x4B010D9: g_slice_alloc (gslice.c:1025)
==21616==    by 0x4B01FC7: g_slist_append (gslist.c:213)
==21616==    by 0x32553: start_sim_app_read (ril_phonebook.c:860)
==21616==    by 0x3276B: pb_reference_data_cb (ril_phonebook.c:903)
==21616==    by 0x153EB3: sim_fs_op_error (simfs.c:271)
==21616==    by 0x1552BB: sim_fs_op_info_cb (simfs.c:682)
==21616==    by 0x3BBA3: ril_sim_file_info_cb (ril_sim.c:358)
==21616==    by 0x489F679: grilio_channel_handle_packet (grilio_channel.c:711)
==21616==    by 0x489F679: grilio_channel_read (grilio_channel.c:811)
==21616==    by 0x489F679: grilio_channel_read_callback (grilio_channel.c:824)
==21616==    by 0x4AE621B: g_main_dispatch (gmain.c:3154)
==21616==    by 0x4AE621B: g_main_context_dispatch (gmain.c:3769)
==21616==    by 0x4AE64C9: g_main_context_iterate.isra.4 (gmain.c:3840)
==21616== 
==21616== 366 (28 direct, 338 indirect) bytes in 1 blocks are definitely lost in loss record 503 of 520
==21616==    at 0x483F380: malloc (vg_replace_malloc.c:296)
==21616==    by 0x4AEB26F: g_malloc (gmem.c:94)
==21616==    by 0x4B010D9: g_slice_alloc (gslice.c:1025)
==21616==    by 0x4B1076B: g_tree_new_full (gtree.c:217)
==21616==    by 0x324CF: start_sim_app_read (ril_phonebook.c:846)
==21616==    by 0x3276B: pb_reference_data_cb (ril_phonebook.c:903)
==21616==    by 0x153EB3: sim_fs_op_error (simfs.c:271)
==21616==    by 0x1552BB: sim_fs_op_info_cb (simfs.c:682)
==21616==    by 0x3BBA3: ril_sim_file_info_cb (ril_sim.c:358)
==21616==    by 0x489F679: grilio_channel_handle_packet (grilio_channel.c:711)
==21616==    by 0x489F679: grilio_channel_read (grilio_channel.c:811)
==21616==    by 0x489F679: grilio_channel_read_callback (grilio_channel.c:824)
==21616==    by 0x4AE621B: g_main_dispatch (gmain.c:3154)
==21616==    by 0x4AE621B: g_main_context_dispatch (gmain.c:3769)
==21616==    by 0x4AE64C9: g_main_context_iterate.isra.4 (gmain.c:3840)

Those occur if SIM card is removed before phonebook export is finished

See merge request !74
2016-07-07 08:33:47 +00:00
Slava Monich
e1ab11ad25 Merge branch 'configs-mer' into 'master'
configs-mer doesn't need to require ofono

The dependency goes the other way around.

See merge request !71
2016-07-07 08:32:36 +00:00
Slava Monich
a9193282d5 [ril] Fixed another memory leak in RIL phonebook. Fixes to MER#1615 2016-07-07 00:11:27 +03:00
Slava Monich
f80bb5c5bb [ril] Implement facility lock query. Fixes MER#1614 2016-07-06 19:27:34 +03:00
Slava Monich
66eb87777f sim: Query the status of SC facility lock 2016-07-06 19:27:00 +03:00
Denis Kenzior
e5291006fd include: Remove unused query_locked method 2016-07-06 19:27:00 +03:00
Denis Kenzior
c609d7cc07 isi: Change query_locked to query_facility_lock 2016-07-06 19:27:00 +03:00
Denis Kenzior
0de562b019 isimodem: Remove unimplemented query_locked method 2016-07-06 19:27:00 +03:00
Denis Kenzior
60b11f712c atmodem: Change query_locked to query_facility_lock 2016-07-06 19:27:00 +03:00
Samrat Guha Niyogi
80d347b964 sim: Query the status of PS and PN facility locks 2016-07-06 19:27:00 +03:00
Samrat Guha Niyogi
97abd10984 include: Add query_facility_lock method 2016-07-06 19:27:00 +03:00
Slava Monich
5201fc0183 [ril] Free phonebook state if export hasn't finished. Contributes to MER#1615 2016-07-06 12:37:21 +03:00
Slava Monich
14e4ef8e07 [ril] Query available band modes at startup. Contributes to JB#35461 2016-07-04 23:21:23 +03:00
Slava Monich
22bc6d526e [rpm] configs-mer doesn't need to require ofono
The dependency goes the other way around.
2016-07-04 21:20:28 +03:00
Slava Monich
baa4fe30e5 Merge branch 'master' into 'master'
Ensure /var/lib/ofono exists on package.

Directory wasn't being created with new automake.

Makefile.am includes:

statedir = $(localstatedir)/lib/ofono
state_DATA =

Suspect newer just skips it as empty. mkdir should be a safe workaround.

See merge request !69
2016-07-04 16:58:03 +00:00
Slava Monich
d0d0793ccb Merge branch 'allow-data' into 'master'
Add allowDataReq ril_subscription.conf option

That fixes Nexus 5 port. Tested by community.

See merge request !70
2016-07-04 16:56:21 +00:00
Slava Monich
55dd461ce7 [ril] Allow to specify default values in Settings section of ril_subscription.conf
Those will become default for all modems but still can be overwritten in
per-modem config sections.
2016-07-03 16:18:48 +03:00
Slava Monich
4da1a30290 [ril] Added allowDataReq ril_subscription.conf option. Fixes MER#1613
Set to true if your RIL doesn't support RIL_REQUEST_ALLOW_DATA
2016-07-02 14:17:06 +03:00
Slava Monich
303f527d79 [ofono] Deleted obsolete debuglog-api.txt 2016-06-28 14:13:05 +03:00
Pekka Vuorela
27e8621c0b [ofono] Ensure /var/lib/ofono exists on package. Contributes to JB#35132 2016-06-16 15:47:44 +03:00
Slava Monich
200237372a Merge branch 'jb35406' into 'master'
Retry data call on PDP_FAIL_ERROR_UNSPECIFIED

According to comment in android's ril.h, if data call setup fails
with status PDP_FAIL_ERROR_UNSPECIFIED, then we need to silently
retry the call. Let's do that.

See merge request !68
2016-06-07 11:27:31 +00:00
Slava Monich
9cae262c80 [ril] Retry data call on PDP_FAIL_ERROR_UNSPECIFIED. Fixes JB#35406
According to comment in android's ril.h, if data call setup fails
with status PDP_FAIL_ERROR_UNSPECIFIED, then we need to silently
retry the call.
2016-06-07 11:23:49 +03:00
Slava Monich
5e23459b67 Merge branch 'debuglog' into 'master'
Control ofono logging over D-Bus

The previous solution only allowed switching logs on/off, this one
allows to pipe the log to another process.

See merge request !67
2016-05-30 20:29:56 +00:00
Slava Monich
a88d7af6c8 Merge branch 'dtmf' into 'master'
Fix memory trashing after sending DTMF tone

After a DTMF tone was sent,tone_queue buffer was becoming just
a few bytes long but the code kept on assuming that it's still
pointing to at least MAX_DTMF_BUFFER bytes of memory. Under
valgrind it looked like this:

==3914== Invalid write of size 1
==3914==    at 0x4B01AEE: g_strlcat (gstrfuncs.c:1488)
==3914==    by 0x33645: ril_voicecall_send_dtmf (ril_voicecall.c:639)
==3914==    by 0x7EE4B: tone_request_run (voicecall.c:4001)
==3914==    by 0x4AE5B57: g_timeout_dispatch (gmain.c:4577)
==3914==    by 0x4AE521B: g_main_dispatch (gmain.c:3154)
==3914==    by 0x4AE521B: g_main_context_dispatch (gmain.c:3769)
==3914==    by 0x4AE54C9: g_main_context_iterate.isra.4 (gmain.c:3840)
==3914==    by 0x4AE573B: g_main_loop_run (gmain.c:4034)
==3914==    by 0x1F0AF: main (main.c:252)
==3914==  Address 0x591c361 is 0 bytes after a block of size 1 alloc'd
==3914==    at 0x483F380: malloc (vg_replace_malloc.c:296)
==3914==    by 0x4AEA26F: g_malloc (gmem.c:94)
==3914==    by 0x4B0130D: g_strdup (gstrfuncs.c:363)
==3914==    by 0x336AB: ril_voicecall_send_dtmf_cb (ril_voicecall.c:600)
==3914==    by 0x489F679: grilio_channel_handle_packet (grilio_channel.c:711)
==3914==    by 0x489F679: grilio_channel_read (grilio_channel.c:811)
==3914==    by 0x489F679: grilio_channel_read_callback (grilio_channel.c:824)
==3914==    by 0x4AE521B: g_main_dispatch (gmain.c:3154)
==3914==    by 0x4AE521B: g_main_context_dispatch (gmain.c:3769)
==3914==    by 0x4AE54C9: g_main_context_iterate.isra.4 (gmain.c:3840)
==3914==    by 0x4AE573B: g_main_loop_run (gmain.c:4034)
==3914==    by 0x1F0AF: main (main.c:252)

This patch replaces tone_queue with a FIFO ring buffer.

See merge request !66
2016-05-30 19:56:28 +00:00
Slava Monich
290c3d2388 [ofono] Control ofono logging over D-Bus. Contributes to JB#34874
The previous solution only allowed switching logs on/off, this one
allows to pipe the log to another process.
2016-05-30 19:00:42 +03:00
Slava Monich
ee880398ad [ril] Fix memory trashing after sending DTMF tone. Fixes JB#35384 2016-05-30 16:18:23 +03:00
Slava Monich
d65bbc3236 Merge branch 'jb35249' into 'master'
Fix crash on exit if data call setup is pending

See merge request !65
2016-05-17 13:57:18 +00:00
Slava Monich
655544be45 [ril] Fix crash on exit if data call setup is pending. Fixes JB#35249
When context is being removed, the core has already completed its
pending D-Bus request, invoking the completion callback causes
libdbus to panic.
2016-05-16 18:04:34 +03:00
Slava Monich
50a544a191 Merge branch 'default-proto' into 'master'
Use the right data protocol for default context settings

Follow-up to mer-core/ofono!60

See merge request !64
2016-05-14 08:42:27 +00:00
Slava Monich
9e7a4a4d72 [ofono] Use the right data protocol for default context settings. Contributes to JB#32750 2016-05-14 11:40:38 +03:00
Slava Monich
c5b5e3109d Merge branch 'ackretry' into 'master'
Retry RIL_REQUEST_SMS_ACKNOWLEDGE

People report seeing `SMS acknowledgement failed: Further SMS
reception is not guaranteed` message in the log, when they have
some sort of trouble with SMS. Let's see if retry helps.

See merge request !63
2016-04-23 15:48:20 +00:00
Slava Monich
deb106343a [ril] Retry RIL_REQUEST_SMS_ACKNOWLEDGE. Contributes to JB#34851
People report seeing "SMS acknowledgement failed: Further SMS reception
is not guaranteed" message in the log, when they have some sort of trouble
with SMS. Let's see if retry helps.
2016-04-23 12:21:23 +03:00
Slava Monich
771e8becf2 Merge branch 'imei' into 'master'
Fix IMEI query at startup.

See merge request !62
2016-04-22 08:56:45 +00:00
Slava Monich
a0b69f974a [ril] Fixed IMEI query at startup. Fixes JB#34937
IMEI related queries were being completed too early.
2016-04-21 12:25:58 +03:00
Slava Monich
b3a4aaea95 [ofono] Silence "Interface xxx not found on the interface_list" messages
Attempt to remove a modem interface already removed (internally) by ofono
is not an error.
2016-04-20 12:22:33 +03:00
Slava Monich
137e504e10 Merge branch 'jb34928' into 'master'
Prevent crash in ril_delayed_register

See merge request !61
2016-04-19 12:18:32 +00:00
Slava Monich
2de3e445f0 Merge branch 'ipv4v6' into 'master'
Use IPV4V6 for internet contexts by default

Once the packet data protocol is configured, it's saved in the
config file and can be changed via UI. In other words, default
value only affects first-time configuration (i.e. provisioning)
and "Reset to default" function.

See merge request !60
2016-04-19 12:17:57 +00:00
Slava Monich
1cd0d60768 [ril] Prevent crash in ril_delayed_register. Fixes JB#34928
Delayed registration needs to be cancelled by ril_phonebook_remove
if it (registration) hasn't been done yet.
2016-04-19 00:41:33 +03:00
Slava Monich
d1f1f16355 [ofono] Use IPV4V6 (dual) for internet context by default. Fixes JB#32750 2016-04-18 18:59:09 +03:00
Slava Monich
4df72c9376 [ofono] mbpi: Make default packet data protocol configurable. Contributes to JB#32750
Note that according to TS 23.401, UE which is IPv6 and IPv4 capable
should request IPv4v6.
2016-04-18 18:53:50 +03:00
Slava Monich
a35ca2bbd9 [ofono] mbpi: Make MBPI database file configurable at runtime
Useful for provisioning unit tests, if nothing else.
2016-04-18 18:53:28 +03:00
Slava Monich
8376174c76 Merge branch 'oemraw' into 'master'
See merge request !59
2016-04-15 16:12:38 +00:00
Slava Monich
b6f5befcac [ril] Simplify OemRaw D-Bus interface implementation
Since support for this interface has never been merged upstream (and
most likely never will) there is no need to touch ofono core at all.
Moving everything into RIL plugin simplifies the implementation and
allows to delete a few hundred lines of unnecessary code.
2016-04-14 19:03:57 +03:00
Slava Monich
403f29320c [mbpi] Housekeeping 2016-04-13 17:51:32 +03:00
Slava Monich
54209b39bd Merge branch 'jb34842' into 'master'
See merge request !58
2016-04-12 06:48:00 +00:00
Slava Monich
3ca442ad15 [ril] Avoid double completion of data call deactivation requests. Fixes JB#34842
The core expects no more than one completion of each request.
2016-04-11 16:48:40 +03:00
Slava Monich
3a579dd7be [ril] CellInfo D-Bus API optimization. Contributes to JB#34561
As an optimization, CellAdded and CellRemoved signals are replaced with
CellsAdded and CellsRemoved which bring array of paths as a parameter.
Cells typically appear/disappear in bunches.
2016-04-06 11:20:32 +03:00
Slava Monich
a7266fc9c8 [ril] Reset the list of known cells when modem is powered off. Fixes JB#34745 2016-04-05 17:05:31 +03:00
Slava Monich
04dbd344b3 [ril] Unregister cells when removing CellInfo interface 2016-04-05 16:14:39 +03:00
Slava Monich
296534c2a8 Merge branch 'voicecall' into 'master'
Make sure that we don't complete dial request more than once

See merge request !55
2016-03-29 10:26:20 +00:00
Slava Monich
6114482e2a Merge branch 'wait' into 'master'
Startup issues

On some devices, it takes rild some time to become functional.
During that time, it fails many requests, including some critical
ones. For example, RIL_REQUEST_GET_IMSI failure results in
"Unable to read IMSI, emergency calls only" error.

RIL plugin has to retry critical requests to stop ofono from
getting into a non-functional state.

See merge request !54
2016-03-29 10:25:14 +00:00
Slava Monich
8281885ba5 Merge branch 'spn' into 'master'
See merge request !53
2016-03-29 10:22:50 +00:00
Slava Monich
9cd3b84421 [ril] Make sure that we don't complete dial request more than once. Fixes JB#34670 2016-03-27 17:50:57 +03:00
Slava Monich
8d65aaefed [ril] Cache SPN when registered with the home network. Contributes to JB#34131
Some SIM cards don't have EFspn record, i.e. we have no way of knowing the
service provider name. In that happens to be the case, then let's cache
the operator name when we are connected to the home network and use that
as the service provider name. That's a pretty accurate guess.
2016-03-25 18:55:24 +02:00
Slava Monich
ce15cfe48d [ril] Don't register modem until RIL_REQUEST_GET_IMEI completes. MER#1549
Waiting until rild responds to RIL_REQUEST_GET_IMEI (and retrying
the request on failure) gives rild time to finish whatever it's doing
during initialization.
2016-03-25 12:52:14 +02:00
Slava Monich
3a1e37b498 [ril] Retry RIL_REQUEST_GET_IMSI. MER#1549
If we fail the .read_imsi call, ofono gets into "Unable to read IMSI,
emergency calls only" state.
2016-03-25 12:49:35 +02:00
Slava Monich
ecef97dd83 [ril] Retry RIL_REQUEST_SIGNAL_STRENGTH 2016-03-25 12:17:54 +02:00
Slava Monich
a68f1e9c4d [ril] Retry RIL_REQUEST_GET_CURRENT_CALLS 2016-03-25 12:12:30 +02:00
Slava Monich
42808ed0f7 Merge branch 'cellinfo' into 'master'
Add cell info interfaces

See merge request !52
2016-03-24 11:48:37 +00:00
Slava Monich
d896ebcb37 [ril] Added cell info interfaces. Contributes to JB#34561
org.nemomobile.ofono.CellInfo is the modem interface:

    <interface name="org.nemomobile.ofono.CellInfo">
        <method name="GetCells">
            <arg name="paths" type="ao" direction="out"/>
        </method>
        <signal name="CellAdded">
            <arg name="path" type="o"/>
        </signal>
        <signal name="CellRemoved">
            <arg name="path" type="o"/>
        </signal>
    </interface>

and each cell supports org.nemomobile.ofono.Cell interface:

    <interface name="org.nemomobile.ofono.Cell">
        <method name="GetAll">
            <arg name="version" type="i" direction="out"/>
            <arg name="type" type="s" direction="out"/>
            <arg name="registered" type="b" direction="out"/>
            <arg name="properties" type="a{sv}" direction="out"/>
        </method>
        <method name="GetInterfaceVersion">
            <arg name="version" type="i" direction="out"/>
        </method>
        <method name="GetType">
            <arg name="type" type="s" direction="out"/>
        </method>
        <method name="GetRegistered">
            <arg name="registered" type="b" direction="out"/>
        </method>
        <method name="GetProperties">
            <arg name="properties" type="a{sv}" direction="out"/>
        </method>
        <signal name="RegisteredChanged">
            <arg name="registered" type="b"/>
        </signal>
        <signal name="PropertyChanged">
            <arg name="name" type="s"/>
            <arg name="value" type="v"/>
        </signal>
        <signal name="Removed"/>
    </interface>

Supported cell types are "gsm", "wcdma" and "lte", the set of properties
depends on the cell type:

gsm:   mcc,mnc,lac,cid,signalStrength,bitErrorRate
wcdma: mcc,mnc,lac,cid,psc,signalStrength,bitErrorRate
lte:   mcc,mnc,ci,pci,tac,signalStrength,rsrp,rsrq,rssnr,cqi,timingAdvance
2016-03-23 12:49:07 +02:00
Slava Monich
93c57284bd Merge branch 'phonebook' into 'master'
Remove unnecessary SIM I/O, pull in Canonical's RIL phonebook

SIM I/O has to go through ofono core to insure proper sequence of
SIM I/O requests.

Pulled in Canonical's RIL phonebook and ofono core patches required
by it, removed unnecessary code.

See merge request !50
2016-03-21 10:37:30 +00:00
Slava Monich
91436f9643 Merge branch 'import' into 'master'
phonebook: Block all Import requests while import is pending

Only the first one was blocked, other requests were rejected until
import is finished.

See merge request !51
2016-03-21 10:35:29 +00:00
Slava Monich
d0d2587b2a [ofono] phonebook: Block all Import requests while import is pending
Only the first one was blocked, other requests were rejected until
import is finished.
2016-03-21 12:34:30 +02:00
Slava Monich
3e10878348 [ril] Removed unnecessary direct SIM I/O 2016-03-10 18:49:46 +02:00
Slava Monich
6de8c4aa85 [ril] Canonical's RIL phonebook
More or less untouched
2016-03-10 18:36:25 +02:00
Slava Monich
a9da50f890 [ofono] sim: Pull in Canonical's simfs patches
ofono_sim_read_path, ofono_sim_read_info and ofono_sim_read_record
2016-03-10 17:57:41 +02:00
Slava Monich
3ca5161a78 Merge branch 'mce' into 'master'
Refactored mce support

See merge request !49
2016-03-10 07:54:29 +00:00
Slava Monich
03b3ca7776 [ril] Refactored mce support
Since there's only one mce, there's no need to have more than one mce client.
Implemented the initial display state query.
2016-03-09 15:24:34 +02:00
Slava Monich
6e5316aba9 [ril] Housekeeping 2016-03-09 09:42:41 +02:00
Slava Monich
49b752f0ad Merge branch 'mmsdata' into 'master'
Don't force 3G/LTE for MMS data slot

It wasn't doing any good, it only

* looked confusing and unpleasant (e.g. signal strength indicators)
* could result in a missed phone call
* could still take longer than if we just transmit MMS over 2G,
  because switching the network mode takes so long

See merge request !48
2016-03-08 13:48:39 +00:00
Slava Monich
268684eebf [ril] Don't force 3G/LTE for MMS data slot. Fixes JB#34350 2016-03-08 12:56:46 +02:00
Slava Monich
24db1db2b1 Merge branch 'disconnect' into 'master'
Handle the case of data call list changing before disconnect completes

It actually worked even though it was triggering asserts in ril_gprs_context_deactivate_primary_cb()

See merge request !47
2016-03-08 10:55:35 +00:00
Slava Monich
55977c1dac [ril] Handle the case of data call list changing before disconnect completes 2016-03-08 01:15:07 +02:00
Slava Monich
1025a6c6ed Merge branch 'ecclist' into 'master'
Load ECC list from a file

In addition to loading static ECC list from a file, this functionality
can be used to track Android system property by adding something like
this to /init.rc:

on property:ril.ecclist=*
    write /var/lib/ofono/ril.ecclist ${ril.ecclist}
    chmod 0644 /var/lib/ofono/ril.ecclist

See merge request !46
2016-03-07 12:01:42 +00:00
Slava Monich
98a143233d [ril] Load ecclist from a file. Contributes to JB#34084 2016-03-05 12:42:02 +02:00
Slava Monich
88013ff63e Merge branch 'nomodems' into 'master'
Set ready flag if there are no modems at all

See merge request !45
2016-03-04 14:49:45 +00:00
Slava Monich
efbe8b12c9 [ril] Set ready flag if there are no modems at all. Contributes to JB#34456 2016-03-04 16:01:40 +02:00
Slava Monich
ba9cc0eb4a Merge branch 'rat' into 'master'
Don't set preferred network mode if SIM isn't ready

Otherwise we may end up spamming system log with error messages
every 2 seconds.

See merge request !44
2016-03-03 12:49:34 +00:00
Slava Monich
46b5f22464 [ril] Don't set preferred network mode if SIM isn't ready. Fixes JB#34418
Otherwise we may end up spamming system log with error messages
every 2 seconds.
2016-03-02 17:41:58 +02:00
Slava Monich
a31332ebae [rpm] Bumped libglibutil version requirement 2016-03-02 17:41:18 +02:00
Slava Monich
b30141c3d3 Merge branch 'sim' into 'master'
Don't wait for radio power on before indicating SIM presence

I'm not sure why I waited for it in the first place,
probably "just in case".

See merge request !43
2016-03-02 14:00:46 +00:00
Slava Monich
e8ae8bba1c [ril] Don't wait for radio power on before indicating SIM presence. Fixes JB#34351 2016-03-02 14:55:20 +02:00
Slava Monich
3ea25fb81f [ril] Fixed ril_trace in release build 2016-03-02 14:48:12 +02:00
Slava Monich
197df7141d [ril] Ensure that all debug messages have the same syslog priority
So that don't get reordered by the system logger.
2016-03-01 17:23:28 +02:00
Slava Monich
eef6993391 Merge branch 'call' into 'master'
Clear cached callback pointer prior to invoking it

Otherwise we can bump into assert in ril_voicecall_dial

See merge request !42
2016-03-01 15:11:28 +00:00
Slava Monich
f1a5941b35 Merge branch 'handover' into 'master'
Let current data SIM in any slot use 3G/LTE

If 3G/LTE module is shared by the modems and 3G/LTE mode is enabled
for more than one SIM, we need to limit other SIMs to GSM in order
to ensure that the data SIM can use 3G/LTE.

See merge request !37
2016-03-01 15:06:31 +00:00
Slava Monich
5f6a258d0a [ril] Let current data SIM in any slot use 3G/LTE. Fixes JB#33358
If 3G/LTE hardware is shared by both modems, drop the current one to GSM
before switching the data SIM. That allows the other modem to use 3G/LTE.
The downside is that now switching data modems takes longer. This behavior
is configurable with /etc/ofono/ril_subscription.conf
2016-02-29 17:57:03 +02:00
Slava Monich
9fa18f967b [ofono] radio-settings: Made radio_access_mode_to/from_string public
So that they can be used by plugins.
2016-02-29 17:55:07 +02:00
Slava Monich
4d17a2e3b9 [ril] Moved online flag from slot to ril_radio object
To prevent radio power from being turned on when the modem is supposed
to be offline.
2016-02-29 17:54:54 +02:00
Slava Monich
c34b3c39b2 Merge branch 'ready' into 'master'
Add 'ready' flag to ModemManager interface

See merge request !40
2016-02-29 15:50:29 +00:00
Slava Monich
df1824b2e2 [ril] Clear cached callback pointer prior to invoking it.
Otherwise we can bump into assert in ril_voicecall_dial
2016-02-29 17:19:11 +02:00
Slava Monich
b3a18326e1 Merge branch 'pin' into 'master'
Don't expect that SIM changes state after pin change

See merge request !41
2016-02-29 13:44:38 +00:00
Slava Monich
93e564d5e5 [ril] Don't expect that SIM changes state after pin change. Fixes JB#34393 2016-02-29 15:26:10 +02:00
Slava Monich
42847e03b5 [ril] Fixed a memory leak in ril_sim_change_passwd 2016-02-29 15:08:34 +02:00
Slava Monich
f0d6b69972 [ril] Added 'ready' flag to ModemManager interface. Contributes to JB#34203
It allows the client to determine when ofono is done with startup,
i.e. all rild instances are running and have replied to the initial
GET_IMEI and GET_SIM_STATUS requests. At that point it's guaranteed
that ModemManager's SIM presence flags actually reflect the reality.
2016-02-27 02:47:44 +02:00
Slava Monich
2100a8d975 [ril] Removed incorrect asserts in ril_sim_info_handle_sim_state
It receives OFONO_SIM_STATE_NOT_PRESENT when SIM is removed
and there's nothing wrong with that.
2016-02-27 02:46:56 +02:00
Slava Monich
c393e63e4e [ril] Replaced G_INLINE_FUNC with 'static inline'
According to glib docs the use of this macro is strongly discouraged
2016-02-26 16:38:06 +02:00
Slava Monich
b24bc9761b Merge branch 'defaults' into 'master'
Try harder to pick the first SIM as the default

See merge request !39
2016-02-26 14:32:59 +00:00
Slava Monich
06daa7cf21 [ril] Try harder to pick the first SIM as the default. Contributes to JB#34203 2016-02-26 16:30:08 +02:00
Slava Monich
49215d60b2 Merge branch 'ussd' into 'master'
Complete ussd send requests immediately

Otherwise ofono ussd machinery may still be in the IDLE state when
the response arrives, breaking the workflow that involves user action.

See merge request !38
2016-02-22 14:50:13 +00:00
Slava Monich
f3f3b73d6f [ril] Complete ussd send requests immediately. Fixes JB#33891
Otherwise ofono ussd machinery may still be in the IDLE state
when the response arrives, breaking the workflow that involves
user action.
2016-02-22 15:15:45 +03:00
Slava Monich
113d9424b5 Merge branch 'power' into 'master'
See merge request !36
2016-02-18 12:33:12 +00:00
Slava Monich
2a8489c4d9 [ril] Don't power up the modem at startup. Fixes JB#34230
It's powered up when it goes online.
2016-02-18 13:21:57 +03:00
Slava Monich
c4f968b87a Merge branch 'nosimsettings' into 'master'
Remove org.nemomobile.ofono.SimSettings D-Bus interface

It's no longer being used. SIM name is stored in dconf and is of no use
to ofono, enable4G flag is useless - AvailableTechnologies property of
org.ofono.RadioSettings interface tells which radio technologies are
supported.

See merge request !35
2016-02-17 22:01:00 +00:00
Slava Monich
537c7ae8b4 Merge branch 'scan' into 'master'
Allow multiple Scan and (auto) Register requests.

While one of those requests is pending it makes no sense to block
other such requests.

See merge request !33
2016-02-17 22:00:00 +00:00
Slava Monich
b320fc7f59 [ril] Removed org.nemomobile.ofono.SimSettings D-Bus interface. Contributes to JB#34189
It's no longer being used. SIM name is stored in dconf and is of
no use to ofono, enable4G flag is useless - AvailableTechnologies
property of org.ofono.RadioSettings interface tells which radio
technologies are supported.
2016-02-11 22:00:29 +03:00
Slava Monich
edf49e6e99 [ril] Replaced assert with a comment 2016-02-10 12:24:53 +03:00
Slava Monich
b7985a1d67 Merge branch 'null' into 'master'
Fix crash on unexpected DATA_CALL_LIST payload

Debug trace didn't check pointers for NULL

See merge request !32
2016-02-08 11:35:24 +00:00
Slava Monich
bbb2c68a72 [ofono] network: Allow multiple Scan and (auto) Register requests.
While one of those requests is pending it makes no sense to
block other such requests.
2016-02-07 13:46:27 +03:00
Slava Monich
bd3f7f35eb [ril] Fixed crash on unexpected DATA_CALL_LIST payload
Debug trace didn't check pointers for NULL
2016-02-06 17:36:24 +03:00
Slava Monich
65bf1a24fa Merge branch 'sim_info' into 'master'
Slightly more generic handling of ofono watchlists

Without registering the free watch callback we can't be sure
whether the watchlist is still alive and that it's safe to call
the watch remove function (if the corresponding watchlist is
already deallocated, the ofono core may choose to crash). This
patch adds generic remove callback ril_sim_info_watch_done() for
all watches and fixes a few minor unrelated issues.

See merge request !31
2016-02-05 09:40:35 +00:00
Slava Monich
0c37015145 [ril] sim_info: Slightly more generic handling of ofono watchlists 2016-02-03 19:39:26 +02:00
Slava Monich
a8551cdce7 [ril] Housekeeping 2016-02-03 17:26:24 +02:00
Slava Monich
5bd2b96240 Merge branch 'mtu' into 'master'
MTU watcher

rild, modem driver or whatever is changing MTU of the mobile
data network interface without informing us. Since we don't
get any notifications from rild when that happens, the solution
that I came up with turned out to be slightly more complicated
than I hoped. But it works.

See merge request !30
2016-02-02 16:22:46 +00:00
Slava Monich
3bf309b887 [ofono] gprs: Took MTU management out of the ofono core
These changes have never been merged upstream and partially
duplicate MTU watcher (part of the RIL plugin).
2016-02-02 18:19:07 +02:00
Slava Monich
c14b9bbf93 [ril] MTU watcher. Fixes JB#33639
rild, modem driver or whatever is changing MTU of the mobile data
network interface without informing us. We don't want MTU to be
greater than 1280.
2016-02-02 18:19:07 +02:00
Slava Monich
568bd615cd Merge branch 'siminfo' into 'master'
org.nemomobile.ofono.SimInfo interface

Allows the client to fetch cached SubscriberIdentity and ServiceProviderName before the pin code is entered. ICCID
to IMSI map is stored in /var/lib/ofono/iccidmap, cached
SIM properties in /var/lib/ofono/IMSI/cache
2016-02-02 16:17:15 +00:00
Slava Monich
4d55f94015 [ril] Added org.nemomobile.ofono.SimInfo interface. Contributes to JB#34053
Allows the client to fetch cached SubscriberIdentity and
ServiceProviderName before the pin code is entered.
2016-01-31 17:08:27 +02:00
Slava Monich
95d06963cd [ofono] sim: Add iccid and imsi watches 2016-01-31 17:08:27 +02:00
Slava Monich
479458138a [ofono] watch: Ensure that watch id is non-zero 2016-01-31 17:08:27 +02:00
Slava Monich
c221d677d1 [rilmodem] Fixed compilation of the old rilmodem code 2016-01-31 16:48:06 +02:00
Slava Monich
a32da19192 [ril] Fixed possible crash on exit
==5482== Invalid free() / delete / delete[] / realloc()
==5482==    at 0x4840ABC: free (vg_replace_malloc.c:473)
==5482==    by 0x206E7: ril_data_call_setup_free (ril_data.c:727)
==5482==    by 0x1FE17: ril_data_call_request_free (ril_data.c:490)
==5482==    by 0x1FFC7: ril_data_call_request_cancel (ril_data.c:537)
==5482==    by 0x21707: ril_data_dispose (ril_data.c:1103)
==5482==    by 0x4A1EE57: g_object_unref (gobject.c:3160)
==5482==    by 0x21177: ril_data_unref (ril_data.c:971)
==5482==    by 0x2C32F: ril_plugin_shutdown_slot (ril_plugin.c:223)
==5482==    by 0x2EC2F: ril_plugin_delete_slot (ril_plugin.c:1023)
==5482==    by 0x2F077: ril_plugin_destroy_slot (ril_plugin.c:1127)
==5482==    by 0x4ACE9AF: g_slist_foreach (gslist.c:896)
==5482==    by 0x4ACE9C1: g_slist_free_full (gslist.c:179)
==5482==  Address 0x5bf1c40 is 0 bytes inside a block of size 48 free'd
==5482==    at 0x4840ABC: free (vg_replace_malloc.c:473)
==5482==    by 0x206E7: ril_data_call_setup_free (ril_data.c:727)
==5482==    by 0x1FE17: ril_data_call_request_free (ril_data.c:490)
==5482==    by 0x1FFC7: ril_data_call_request_cancel (ril_data.c:537)
==5482==    by 0x24A2B: ril_gprs_context_remove (ril_gprs_context.c:601)
==5482==    by 0x134803: gprs_context_remove (gprs.c:2841)
==5482==    by 0xDFD73: flush_atoms (modem.c:429)
==5482==    by 0xE002F: modem_change_state (modem.c:507)
==5482==    by 0xE0C7F: set_powered (modem.c:878)
==5482==    by 0xE3E5B: __ofono_modem_shutdown (modem.c:2207)
==5482==    by 0xDDDE7: signal_handler (main.c:77)
==5482==    by 0x4AB1B85: g_main_dispatch (gmain.c:3066)
==5482==    by 0x4AB1B85: g_main_context_dispatch (gmain.c:3642)
2016-01-31 03:24:25 +02:00
Slava Monich
a20da10621 [ril] Fixed assert in dbus library. Contributes to JB#28417
It doesn't like NULL strings so much that it terminates the app.
2016-01-30 00:37:50 +02:00
Slava Monich
64c754c3b9 [ril] Housekeeping
Use G_SOURCE_REMOVE instead of FALSE where appropriate
2016-01-29 17:48:13 +02:00
Slava Monich
d64fd7dca7 Merge branch 'enable4G' into 'master'
Remove Enable4GChanged signal from the introspection data

Enable4G flag never changes, therefore this signal is never sent.
    
Even though this flag it not being used by the UI anymore,
it still has to be kept it around to avoid breaking D-Bus API.

See merge request !28
2016-01-29 15:16:12 +00:00
Slava Monich
f608c0821a [ril] Remove Enable4GChanged signal from the introspection data
Enable4G flag never changes, therefore this signal is never sent.

Even though this flag it not being used by the UI anymore, it still
has to be kept it around to avoid breaking D-Bus API.
2016-01-29 12:43:01 +02:00
Slava Monich
7d29ef130a Housekeeping 2016-01-26 15:37:10 +02:00
Slava Monich
141eadee1d Merge branch 'mmssim' into 'master'
Add Get/SetMmsSim functionality

If MMS data SIM is different from the default data SIM, then MMS SIM
is selected for data and defaultDataModem is emptied, which tells
connman not to mess with mobile data while MMS is being transmitted.

SetMmsSim returns the path of the modem where the requested SIM is
or an empty string if there's no such SIM (or it's locked). This
information may or may not be useful to the client.
    
The behaviour gets reset back to default when IMSI of the MMS SIM is
set to empty string or the client which set it, exits. The client is
going to be mms-engine.

See merge request !26
2016-01-26 13:29:39 +00:00
Slava Monich
e84602d79c [ril] Add Get/SetMmsSim functionality. Contributes to #28417
If MMS data SIM is different from the default data SIM, then MMS SIM
is selected for data and defaultDataModem is emptied, which tells connman
not to mess with mobile data while MMS is being transmitted.

SetMmsSim returns the path of the modem where the requested SIM is
or an empty string if there's no such SIM (or it's locked).

The behaviour gets reset back to default when IMSI of the MMS SIM
is set to empty string or the client which set it, exits.
2016-01-26 02:10:07 +02:00
Slava Monich
b63b6355d5 [ril] Moved context setup and deactivation to ril_data. Contributes to JB#33358
This will allow to properly serialize the actions when switching
the data SIMs.
2016-01-26 02:10:07 +02:00
Slava Monich
f7f007a122 Merge branch 'EFspn' into 'master'
Add ServiceProviderName property to SimManager

Contains the service provider name fetched from the SIM card, if available.

See merge request !27
2016-01-25 23:57:21 +00:00
Slava Monich
5769656848 [ofono] sim: Add ServiceProviderName property to SimManager
Contains the service provider name fetched from the SIM card, if available.
2016-01-26 00:21:23 +02:00
Slava Monich
bbc276b4c7 [ril] Reduced the amount of debug trace produced by ril_radio.c 2016-01-23 18:53:05 +02:00
Slava Monich
4b79de53fe [gprs] Removed unnecessary debug trace 2016-01-21 14:05:11 +02:00
Slava Monich
12ffd8acf9 Merge branch 'post-1.17-picks' into 'master'
Cherry-picked useful post-1.17 commits + a simple bug fix on top of it.

See merge request !25
2016-01-20 13:47:17 +00:00
Slava Monich
df9b35b440 [ril] Set correct status for the current operator. Fixes JB#33922 2016-01-20 11:33:27 +02:00
John Ernberg
76e991d3da network: Fix crash caused by empty Scan() results
When issuing a Scan() in poor reception while attached to an operator it's
fully possible to get no results, which causes the attached operator to be
cleaned up. In certain scenarios this would cause a use-after-free as there
are still references to this operator.
Transfer the attached operator to the new list regardless of removal caused
by the Scan() results.
2016-01-20 11:33:27 +02:00
John Ernberg
90803904be gprs: Fix the ContextAdded() signal Introspection
This matches the behavior described by the documentation the signal
value returned by the code. This was causing a headache when using
stricter D-Bus wrappers like dbus-c++.
2016-01-20 11:33:27 +02:00
John Ernberg
84e547c2ed cbs: Resolve a use-after-free
In situations where location changes rapidly, a use-after-free condition
can occur.  What happens is that the timeout leaks and then the cbs
struct with the callback is cleaned up, resulting in a SIGSEGV when the
callback occurs from the glib loop.
2016-01-20 11:33:27 +02:00
Denis Kenzior
652798d592 modem: Don't move to pre-sim state in case of failure
In ofono_modem_reset, if the enable() callback fails, do not
proceed to the pre-sim state
2016-01-20 11:33:27 +02:00
Denis Kenzior
979a3bcef3 gprs: Implement ofono_gprs_context_get_type 2016-01-20 11:33:27 +02:00
Denis Kenzior
69178c8ecb include: Add ofono_gprs_context_get_type 2016-01-20 11:33:27 +02:00
Slava Monich
1ac1c9268d [gprs] Remove redundant ofono_gprs_get_modem declarations
Upstream now has those too.
2016-01-20 11:33:27 +02:00
Denis Kenzior
5483a8ecc0 gprs: Implement ofono_gprs_get_modem 2016-01-20 11:33:27 +02:00
Denis Kenzior
95dacebb0c gprs: Add ofono_gprs_get_modem() 2016-01-20 11:33:27 +02:00
Simon Fels
b92b1ce13f voicecall: don't dereference a supplied null value
When the voicecall atom is unregistered we remove all HFP support as
well but were supplying a zero as value to the emulator status
callbacks which caused the process to crash as we were dereferencing
the supplied value always and not respecting a zero as indicator to
reset.
2016-01-20 11:33:27 +02:00
Denis Kenzior
70ab2175a0 gprs: Allow synchronous callbacks for set_attached 2016-01-20 11:33:27 +02:00
Denis Kenzior
9810a258a1 radio-settings: Implement get_modem() 2016-01-20 11:33:27 +02:00
Denis Kenzior
760c17052f include: Add ofono_radio_settings_get_modem() 2016-01-20 11:33:27 +02:00
Denis Kenzior
e77b62a91e doc: Add Item M17 to coding-style.txt 2016-01-20 11:33:27 +02:00
Alfonso Sanchez-Beato
7103c81a77 include: Add definitions for phone number types 2016-01-20 11:33:27 +02:00
Slava Monich
2bc610353d [ril] Removed redundant declaration of enum operator_status
It has become public
2016-01-20 11:33:27 +02:00
Tony Espy
dd04ac248d src: make bearer/operator enums public
Move enums for operator_status and packet_bearer to common.h to avoid
duplication in drivers.
2016-01-20 11:33:27 +02:00
Slava Monich
c5b3357000 Merge branch 'merge-1.17' into 'master'
Upgrade to ofono 1.17

Some of the commits look quite useful and yet the whole thing doesn't seem to be particularly destructive (unlike what started happening after 1.17).

See merge request !24
2016-01-20 09:19:42 +00:00
Slava Monich
ddbdf9f649 Merge tag '63f6a75a61e7e07cc773929acb4c13acaf8a4b00' into merge-1.17
Release 1.17

Conflicts:
	ofono/src/gprs.c
	ofono/src/log.c
	ofono/src/main.c
	ofono/src/sim.c
2016-01-19 14:30:45 +02:00
Slava Monich
7b5be51527 [ofono] Update to upstream 1.17 2016-01-19 14:26:00 +02:00
Alfonso Sanchez-Beato
5aef6a8356 sms: Add trace when datagram is not delivered 2016-01-19 14:19:33 +02:00
Alfonso Sanchez-Beato
b99cd4f8ca smsutil: Do not check the origin port
Do not check if the origin port is reserved, as some operators use that
range of values.
2016-01-19 14:18:23 +02:00
Alfonso Sanchez-Beato
47ee85e955 push-notification: Accept push from any origin
Accept push notifications regardless of the origin port, as some
operators do not insert there the WAP connectionless session service
port, and use random values instead.
2016-01-19 14:17:39 +02:00
Denis Kenzior
b500f4fa65 voicecall: Don't accept USSD strings in Dial() 2016-01-19 14:16:01 +02:00
Denis Kenzior
c2c048dc05 gprs: Try re-attaching when we switch cells 2016-01-19 14:15:09 +02:00
Alfonso Sanchez-Beato
df923b481f message-waiting: Fix reading EF_MWIS records 2016-01-19 14:14:13 +02:00
Alfonso Sanchez-Beato
ed0c1f94f6 message-waiting: Update properly EF_MWIS SIM file 2016-01-19 14:13:44 +02:00
Marko Sulejic
6d2852cdaf configure.ac: fix typo 2016-01-19 14:13:00 +02:00
Denis Kenzior
72a1ecf5d0 sim: Fix up whitespace issues 2016-01-19 14:12:14 +02:00
Alfonso Sanchez-Beato
2fa10fb265 gprs: Add comment to gprs_reset_contexts 2016-01-19 14:10:53 +02:00
Denis Kenzior
f907c3a85d test: Fix file mode for reset-contexts 2016-01-19 14:10:28 +02:00
Alfonso Sanchez-Beato
4a7b325191 gprs: Refactor to remove forward declaration 2016-01-19 14:09:58 +02:00
Alfonso Sanchez-Beato
a8103a39fa test: Add script for resetting contexts 2016-01-19 14:07:35 +02:00
Alfonso Sanchez-Beato
4076502017 doc: Add description for ResetContexts method 2016-01-19 14:07:28 +02:00
Alfonso Sanchez-Beato
7ed41beadd gprs: Add DBus method to reset contexts
Add DBus method that removes the current contexts and re-provisions
using the APN database.

Conflicts:
	ofono/src/gprs.c
2016-01-19 14:06:26 +02:00
Luiz Augusto von Dentz
e45389cf84 gdbus: Close private connection if setup fails
Private connection should be properly closed with dbus_connection_close
otherwise libdbus exits with the following error:

  'The last reference on a connection was dropped without closing the
   connection. This is a bug in an application. See
   dbus_connection_unref() documentation for details. Most likely, the
   application was supposed to call dbus_connection_close(), since this
   is a private connection.'
2016-01-19 14:01:44 +02:00
Szymon Janc
4bae61c83e gdbus: Fix crash in g_dbus_create_error_valist
Passing NULL format parameter to vsnprintf results in invalid argument
error on glibc. But with some other libc libraries (musl and uClibc)
this results in dereferencing NULL pointer and crash due to
segmentation fault.
2016-01-19 14:01:37 +02:00
Szymon Janc
11d6e76f0a gdbus: Use g_dbus_create_error_valist internally
There is no need to duplicate code in g_dbus_send_error_valist.
2016-01-19 14:01:27 +02:00
Michael Janssen
4cfa5cdf36 gdbus: Add g_dbus_get_flags function
The g_dbus_get_flags function enables detection of when the
G_DBUS_FLAG_ENABLE_EXPERIMENTAL is set.
2016-01-19 14:01:17 +02:00
Luiz Augusto von Dentz
135923532c gdbus: Make GDBusClient work without ObjectManager
This makes GDBusClient work normally without ObjectManager.
2016-01-19 14:01:11 +02:00
Arman Uguray
d112c042e3 gdbus/client: Allow specifying ObjectManager path
GDBusClient currently hard-codes "/" as the remote ObjectManager path.
This is generally incorrect, as an application can choose to expose an
ObjectManager at any well-known path. This patch fixes this by allowing
the user to pass in the ObjectManager path by introducing a new
conctructor "g_dbus_client_new_full".
2016-01-19 14:01:02 +02:00
Arman Uguray
b9407ff65f gdbus/client: Don't GetManagedObjects w/o handlers
The client code currently issues GetManagedObjects if new handlers are
set via g_dbus_client_set_proxy_handlers. An application may set these
to NULL before unref'ing a client or to simply prevent further events.
Hence, there is no need to refresh objects or properties if all handlers
are NULL.
2016-01-19 14:00:55 +02:00
Szymon Janc
5a92625c9f gdbus: Fix not calling disconnect function
If daemon gets disconnected from D-Bus sender is NULL. Watches that
was explicitly added with NULL sender (ie disconnected_signal in
g_dbus_set_disconnect_function) should be called anyway.
2016-01-19 14:00:40 +02:00
Arman Uguray
c684033671 gdbus: Don't refresh objects/props if disconnected
If g_dbus_client_set_proxy_handlers gets called from within a
proxy_removed callback, the code may end up refreshing the proxy's
properties and incorrectly access the client's proxy_list as it gets
freed. This patch fixes this, so that get_managed_objects does nothing
if it gets called during a service disconnect.
2016-01-19 13:53:41 +02:00
Slava Monich
59cb9c39b9 Merge branch 'jb33872' into 'master'
Fix eternal loop loop with roaming SIM

When ofono core is asking gprs driver to detach (because data roaming is disabled), it's expecting data registration status to change. If that doesn't happen, it starts all over again.

See merge request !22
2016-01-18 15:26:47 +00:00
Slava Monich
0831fd803a [ril] Tweaking mobile data management
Mobile data availability for all slots is now managed by the single
component called ril_data_manager.
2016-01-18 12:28:18 +02:00
Slava Monich
1b6c20759c [ril] Fix eternal loop with roaming sim. Fixes JB#33872
When ofono core is asking gprs driver to detach (because data
roaming is disabled), it's expecting data registration status
to change. If that doesn't happen, it starts all over again.
2016-01-18 12:28:18 +02:00
Slava Monich
3681eb63b1 Merge branch 'voicereg' into 'master'
Allow 3 values for registration state response

This was seen by one of the porters:
```
RIL< [0000000a] VOICE_REGISTRATION_STATE
RIL> [0000000a] OK
RIL> 0000: 00 00 00 00 0a 00 00 00  00 00 00 00 03 00 00 00    ........ ........
RIL  0010: 01 00 00 00 30 00 00 00  04 00 00 00 30 00 30 00    ....0... ....0.0.
RIL  0020: 30 00 30 00 00 00 00 00  08 00 00 00 30 00 30 00    0.0..... ....0.0.
RIL  0030: 30 00 30 00 30 00 30 00  30 00 30 00 00 00 00 00    0.0.0.0. 0.0.....
ofonod[953]: drivers/ril/ril_network.c:ril_network_parse_response() broken response
```

See merge request !23
2016-01-18 10:26:50 +00:00
Slava Monich
5303f766a9 [ril] Provide reasonable default for max_calls
Some older RILs don't provide max calls, in that case let's supply
some reasonable default. We don't need more than 2 simultaneous data
calls anyway.
2016-01-18 00:13:41 +02:00
Slava Monich
2f68eeea6c [ril] Allow 3 values for registration state response 2016-01-17 17:08:42 +02:00
Slava Monich
7a7744781a Merge branch 'imei' into 'master'
Return cached IMEI values from query_serial

Those are always queried at startup and they never change. There's no reason to perform RIL query for IMEI more than once.

See merge request !21
2016-01-14 21:15:23 +00:00
Slava Monich
fc1491c634 [ril] Return cached IMEI values from query_serial
Those are always queried at startup and they never change.
There's no reason to perform RIL query for IMEI more than once.
2016-01-14 16:48:38 +02:00
Slava Monich
c631a48c41 [ril] Set gprs cid range when registering gprs driver. Fixes JB#33861
There is no need to wait for the network state status, the network
may already be operational. Without cid range, attempts to activate
connection context will fail with org.ofono.Error.NotImplemented
2016-01-13 18:08:15 +02:00
Slava Monich
21e90e5abd Housekeeping 2016-01-13 16:52:36 +02:00
Slava Monich
bfcf8b726b Merge branch 'reg_state' into 'master'
Fixed a few issues mostly affecting startup and slowing down sim initialization

1. Don't submit the initial network state request if RIL says that radio is off. I have the impression that RIL doesn't like it; besides it won't work anyway. Instead, wait for radio on or for the network state change event, whichever comes first.
2. When the network state or sim status event occurs and the corresponding query is scheduled to be retried after a failure, retry it right away (i.e. don't wait for the retry timeout to expire).

Requires libgrilio 1.0.6 (already merged) which includes the bug fix for retries happening 1000 times too often (which rild might not like too).

See merge request !19
2016-01-13 14:49:20 +00:00
Slava Monich
3b69c9843b Merge branch 'lastcause' into 'master'
Handle more cause values for call control.

Quite many normal disconnect causes defined in 3GPP TS 24.008 Annex H
are not handled and are thus treated as errors. telepathy-ring would
then play "network out of order" tone, when "busy" tone would be more
appropriate. Add all the call control cause values not defined in ril.h
(but defined in Annex H) here and handle them appropriately.

See merge request !20
2016-01-13 13:58:48 +00:00
Juho Hämäläinen
f24252e2c6 Handle more cause values for call control. Fixes MER#1461
Quite many normal disconnect causes defined in 3GPP TS 24.008 Annex H
are not handled and are thus treated as errors. telepathy-ring would
then play "network out of order" tone, when "busy" tone would be more
appropriate. Add all the call control cause values not defined in ril.h
(but defined in Annex H) here and handle them appropriately.
2016-01-13 15:08:44 +02:00
Slava Monich
4be4cb4f57 [ril] Poke enabled modems with RADIO_POWER request after any modem gets powered off. Fixes JB#33830
If we don't do it, bad things may happen (like the enabled and
apparently powered on modem never registering on the network).
This may have something to do with certain pieces of radio
circuitry being shared by all modems.
2016-01-13 14:38:33 +02:00
Slava Monich
9d4f682b14 [ril] Fixed GET_SIM_STATUS retry 2016-01-13 00:01:02 +02:00
Slava Monich
bd736f7aa6 [ril] Only query the initial network state only if radio is on
Otherwise wait for the network state change event
2016-01-13 00:00:39 +02:00
Slava Monich
ff328c2a73 [systemd] Add $OFONO_DEBUG to the service command line
This allows to put a conf file to /var/lib/environment/ofono/ which
defines OFONO_DEBUG and avoid modifying ofono.service after each update.
2016-01-12 16:29:38 +02:00
Slava Monich
10e908fa96 Merge branch 'ril_subscription' into 'master'
Updated sample ril_subscription.conf

The comments in gril/ril_subscription.conf are not relevant to ril plugin in drivers/ril

See merge request !18
2016-01-11 12:45:56 +00:00
Slava Monich
4aa59c7274 Merge branch 'uicc_sub' into 'master'
Use different SET_UICC_SUBSCRIPTION codes for different RIL versions

RIL_REQUEST_SET_UICC_SUBSCRIPTION is 115 in RIL version 9 (or earlier) and 122 in RIL version 10 and later. Since we don't know in advance which RIL version we are dealing with, we need to make the decision at runtime.

See merge request !17
2016-01-11 12:45:29 +00:00
Slava Monich
d61be44bb4 [ril] Updated sample ril_subscription.conf 2016-01-11 13:16:10 +02:00
Slava Monich
0ed1ef1e4c [ril] Use different SET_UICC_SUBSCRIPTION codes for different RIL versions. Fixes MER#1446
RIL_REQUEST_SET_UICC_SUBSCRIPTION is 115 in RIL version 9 (or earlier)
and 122 in RIL version 10 and later. Since we don't know in advance which
RIL version we are dealing with, we need to make the decision at runtime.
2016-01-11 12:59:58 +02:00
Slava Monich
2fa193ad5b Merge branch 'sim_card' into 'master'
Refactoring of SIM card, network and radio power management

Major refactoring aimed at improving predictability, reliability and reducing RIL socket traffic. For instance, SIM card, radio and network states are now represented at the ofono side by dedicated per-socket objects and state changes are indicated to the interested parties using glib signalling mechanism (as opposed to independently listening to RIL events and performing redundant queries).

Requires libgrilio 1.0.4 (already merged)

See merge request !16
2016-01-11 08:46:48 +00:00
Slava Monich
e686240eeb [ril] Allow to control libgrilio logging with ofono -d option
It can be turned on with -d grilio or via D-Bus
2016-01-10 16:05:58 +02:00
Slava Monich
18bc7a3ad8 [ril] Use libgrilio built-in retry mechanism 2016-01-08 23:20:34 +02:00
Slava Monich
6624066917 [ril] Let gprs driver control "allow data" setting
Also added ril_network object that keeps track of the network state and
reduces the number of RIL requests.
2016-01-07 16:56:12 +02:00
Slava Monich
6015490d41 [ril] Indicate SIM card presence in appropriate radio state. Contributes to JB#33805
This also reduces the number of GET_SIM_STATUS requests. Only one object
per RIL instance makes these requests, the results are shared by all
other objects involved.

In addition to that, radio power on request is retried if radio power
unexpectedly switches off which does happen on multi-sim hardware.
2016-01-07 15:54:14 +02:00
Slava Monich
a135d0ea52 [ril] Sync constants with the latest Android ril.h 2016-01-07 15:47:30 +02:00
Slava Monich
f86159c180 [ril] Reset data modem pointer after default data SIM is gone 2015-12-15 12:38:53 +03:00
Slava Monich
de2b622f3b Merge branch 'radio-settings' into 'master'
Radio settings

Fixes `org.ofono.RadioSettings.GetProperties` failures after switching SIM cards and adds support for `"AvailableTechnologies"` property.

See merge request !13
2015-12-15 09:33:36 +00:00
Slava Monich
077f3f2e1e [ril] radio_settings: Implemented query_available_rats, removed obsolete code 2015-12-09 16:49:20 +03:00
Slava Monich
acbd40f9ad [ofono] radio-settings: Queue GetProperties requests
Just after the modem is added and org.ofono.RadioSettings interface
is registered, ofono may receive a number of GetProperties calls for
this interface. The first one would wait for initial queries to
complete while others may fail.

I guess it was expected that clients would retry the call later
but in practice pretty much all clients treat any D-Bus error as
a permanent failure.

This commit introduces the list of pending GetProperties requests
which all get completed after the initial query is done.
2015-12-09 14:03:24 +03:00
Slava Monich
26398c769f Merge branch 'PrefixLength' into 'master'
Provide PrefixLength for IPv6 address

`PrefixLength` property was absent from ConnectionContext IPv6.Settings even if it's provided by RIL.

See merge request !12
2015-12-02 15:33:27 +00:00
Slava Monich
60c53428f0 [ril] Provide PrefixLength for IPv6 address. Contributes to JB#31859 2015-12-02 15:05:21 +02:00
Slava Monich
90824a8906 Merge branch 'jb33531' into 'master'
Queue org.ofono.MessageManager.GetProperties requests while waiting for sca_query

Just after the modem is added and `org.ofono.MessageManager` interface is registered, ofono receives a bunch of `GetProperties` calls for this interface. The first one would wait for `driver->sca_query` completion and all others would fail until `driver->sca_query` completes. I guess it was expected that clients would retry the call later but in practice pretty much all clients treat any D-Bus error as a permanent failure.

This commit introduces the list of pending `GetProperties` requests which all get completed when `driver->sca_query` is done.

See merge request !11
2015-11-30 14:16:47 +00:00
Slava Monich
b85b8f0019 [ofono] sms: Queue GetProperties requests while waiting for sca_query. Fixes JB#33531
Just after the modem is added and org.ofono.MessageManager interface
is registered, ofono receives a bunch of GetProperties calls for this
interface. The first one would wait for driver->sca_query completion
and all others would fail until driver->sca_query completes.

I guess it was expected that clients would retry the call later
but in practice pretty much all clients treat any D-Bus error as
a permanent failure.

This commit introduces the list of pending GetProperties requests
which all get completed when driver->sca_query is done.
2015-11-30 16:11:54 +02:00
Slava Monich
29069fd152 Merge branch 'imei' into 'master'
Add GetIMEI method to ModemManager

This allows to query IMEI of all available modems without having to register them with ofono.

See merge request !10
2015-11-13 16:09:28 +00:00
Slava Monich
8e4e88e4fc [ril] Added GetIMEI method to ModemManager. Contributes to JB#33484
This allows to query IMEI of all available modems without having
to register them with ofono.
2015-11-12 17:59:05 +02:00
Slava Monich
40f148c134 [ril] Fixed memory leak on ofono_modem_register() failure 2015-11-12 17:51:35 +02:00
Slava Monich
730d5ff9b5 [ofono] modem: Destroy modem->properties in ofono_modem_remove()
Since it's created in ofono_modem_create(), it has to be destroyed
in ofono_modem_remove() to avoid memory leaks if ofono_modem_register()
fails.
2015-11-12 17:49:13 +02:00
Slava Monich
c6000fd909 Merge branch 'jb33441' into 'master'
Fix double free on self-deactivation of GPRS context



See merge request !9
2015-11-12 08:12:01 +00:00
Slava Monich
f2edab4ed8 Merge branch 'jb33265' into 'master'
Add GetPresentSims to ModemManager interface

Only a simple boolean (presence/absence) is reported. `PresentSimsChanged` signal is emitted when SIM is inserted or removed (if RIL supports it).

See merge request !8
2015-11-12 08:11:38 +00:00
Slava Monich
9915ccb3ba [ril] Fixed double free on self-deactivation of GPRS context. Fixes JB#33441 2015-11-11 19:20:24 +02:00
Slava Monich
b5be8420ab [ril] Add GetPresentSims to ModemManager interface. Contributes to JB#33265
Only a simple boolean (presence/absence) is reported. PresentSimsChanged
signal is emitted when SIM is inserted or removed (if RIL supports it).
2015-11-11 17:14:32 +02:00
Slava Monich
5498e22839 Merge branch 'jb33299' into 'master'
Fix manual operator selection for L500D

Seems to work on both Jolla1 and L500D

See merge request !7
2015-11-10 09:43:10 +00:00
Slava Monich
802d351ab0 Merge branch 'mer1394' into 'master'
Fix memory leaks

Memory was leaking every time a new SIM is inserted or "Reset to default" is done from AP settings page. Also refactored `provision_normalize_apn_list()` to eliminate duplicate code and clearly separate AP selection criteria into the sorting callback function.

See merge request !6
2015-11-10 09:42:52 +00:00
Slava Monich
3d62d57d20 [ril] Append +0 to MCCMNC in network selection request. Fixes JB#33299
Some RILs report MCCMNC in MCCMNC+TECH format and seem to expect it
in a similar way in SET_NETWORK_SELECTION_MANUAL request. Older RILs
don't require it but don't have a problem with that sort of syntax
either, at least one particular QCRIL vesion 6 that I tried. So the
solution seems to be quite portable.
2015-11-09 16:29:12 +02:00
Slava Monich
3b1b272967 [ril] Eliminated unnecessary debug print 2015-11-09 16:28:44 +02:00
Slava Monich
5e2a7afabd [ril] Fixed conversion of RIL to ofono registration status 2015-11-09 16:25:14 +02:00
Slava Monich
f7fa1c81f3 [provision] Fixed memory leak. Contributes to MER#1394
According to valgrind:

543 (8 direct, 535 indirect) bytes in 1 blocks are definitely lost in loss record 413 of 428
   at 0x483F380: malloc (vg_replace_malloc.c:296)
   by 0x4AB6083: g_malloc (gmem.c:104)
   by 0x4ACC9B5: g_slice_alloc (gslice.c:1016)
   by 0x4ACD8A3: g_slist_append (gslist.c:224)
   by 0xCE6BF: gsm_end (mbpi.c:423)
   by 0x4AB470D: g_markup_parse_context_parse (gmarkup.c:1602)
   by 0xCEE03: mbpi_parse (mbpi.c:646)
   by 0xCEEF3: mbpi_lookup_apn (mbpi.c:669)
   by 0xCF453: provision_get_settings (provision.c:184)
   by 0x145E87: __ofono_gprs_provision_get_settings (gprs-provision.c:68)
   by 0x12A983: provision_contexts (gprs.c:3327)
   by 0x12AD1B: spn_read_cb (gprs.c:3413)
2015-11-04 16:41:44 +03:00
Slava Monich
62a0b3518b [provision] Fixed memory leak. Contributes to MER#1394
According to valgrind:

14 bytes in 2 blocks are definitely lost in loss record 155 of 428
   at 0x483F380: malloc (vg_replace_malloc.c:296)
   by 0x4AB6083: g_malloc (gmem.c:104)
   by 0x4ACDAA9: g_strdup (gstrfuncs.c:364)
   by 0xCE383: apn_handler (mbpi.c:329)
   by 0xCE5B3: gsm_start (mbpi.c:386)
   by 0x4AB333B: emit_start_element (gmarkup.c:1029)
   by 0x4AB4685: g_markup_parse_context_parse (gmarkup.c:1366)
   by 0xCEE03: mbpi_parse (mbpi.c:646)
   by 0xCEEF3: mbpi_lookup_apn (mbpi.c:669)
   by 0xCF453: provision_get_settings (provision.c:184)
   by 0x145E87: __ofono_gprs_provision_get_settings (gprs-provision.c:68)
   by 0x12A983: provision_contexts (gprs.c:3327)
2015-11-04 10:58:34 +03:00
Slava Monich
d7cbedc0e9 Merge branch 'jb32969' into 'master'
Don't rely on DATA_CALL_LIST_CHANGED too much

Some RILs don't send `RIL_UNSOL_DATA_CALL_LIST_CHANGED` event after data call gets deactivated, only after activation. Some RILs send it in either case.

Ofono RIL plugin should consider data call disconnected after either `RIL_REQUEST_DEACTIVATE_DATA_CALL` successfully completes or data call disappears from the list reported by `RIL_UNSOL_DATA_CALL_LIST_CHANGED`, whichever happens first. That would work with both kinds of RILs.

See merge request !5
2015-11-04 07:41:21 +00:00
Slava Monich
1e75448127 Merge branch 'addremove' into 'master'
Always fire ModemRemoved first then ModemAdded

When switching from `/ril_1` to `/ril_0` we used to fire `ModemAdded("/ril_0")` followed by `ModemRemoved("/ril_1")` which may confuse D-Bus clients that are not so good at handling multiple modems. To well-behaved clients the order doesn't matter.

See merge request !4
2015-11-04 07:41:03 +00:00
Slava Monich
7ab4da0c91 [ril] Don't rely on DATA_CALL_LIST_CHANGED too much. Fixes JB#32969
Some RILs don't send RIL_UNSOL_DATA_CALL_LIST_CHANGED event after
data call gets deactivated, only after activation. Some RILs send
it in either case.

Ofono RIL plugin should consider data call disconnected after either
RIL_REQUEST_DEACTIVATE_DATA_CALL successfully completes or data call
disappears from the list reported by RIL_UNSOL_DATA_CALL_LIST_CHANGED,
whichever happens first. That would work with both kinds of RILs.
2015-11-03 19:06:48 +03:00
Slava Monich
f13991d04e [ril] Always fire ModemRemoved first then ModemAdded. Contributes to MER#1110
When switching from /ril_1 to /ril_0 we used to fire ModemAdded("/ril_0")
followed by ModemRemoved("/ril_1") which may confuse D-Bus clients that are
not so good at handling multiple modems. To well-bahaved clients the order
doesn't matter.
2015-11-03 16:06:52 +03:00
Slava Monich
c451110c39 [ril] Elimitated dependency on mce-headers. MER#1110
It's just a few defines, not worth the trouble.
2015-11-02 12:08:23 +03:00
Slava Monich
cb9183f3ff Merge branch 'multisim' into 'master'
New RIL plugin supporting multiple modems

Enabled by --enable-jolla-rilmodem configure option. Old plugin is preserved as a reference and for debugging regressions on Jolla1.

See merge request !2
2015-11-02 08:53:27 +00:00
Slava Monich
c1a9d7a578 [ril] New RIL plugin supporting multiple modems. Fixes MER#1110
Enabled by --enable-jolla-rilmodem configure option.
2015-10-30 18:01:37 +03:00
Slava Monich
9aee7ccadd [ofono] Added ofono_gprs_get_roaming_allowed() function
It's required by the RIL modem.
2015-10-25 19:12:17 +03:00
Slava Monich
0777b2853a Merge branch 'log' into 'master'
Allow to specify a function to be called when debug flags change

This allows to pass log level modifications to the external libraries that don't use ofono DBG mechanism.

See merge request !1
2015-10-25 16:09:11 +00:00
Slava Monich
b7bd9ca425 [ofono] Allow to specify a function to be called when debug flags change
This allows to pass log level modifications to the external libraries that
don't use ofono's DBG mechanism.
2015-10-25 18:47:10 +03:00
Marcel Holtmann
8929d131a3 Release 1.17 2015-09-13 17:08:07 +02:00
Slava Monich
97e34cc851 Merge pull request #302 from monich/nettime
Updated nettime plugin to support more than one modem
2015-09-11 17:03:28 +03:00
Slava Monich
e558d48b6f [ofono] Updated nettime plugin to support more than one modem. MER#1110 2015-09-08 22:23:20 +03:00
Alfonso Sanchez-Beato
51fc828c5e sms: Add trace when datagram is not delivered 2015-09-08 09:14:03 -05:00
Alfonso Sanchez-Beato
ac14de37ca smsutil: Do not check the origin port
Do not check if the origin port is reserved, as some operators use that
range of values.
2015-09-08 09:14:03 -05:00
Alfonso Sanchez-Beato
665c053803 push-notification: Accept push from any origin
Accept push notifications regardless of the origin port, as some
operators do not insert there the WAP connectionless session service
port, and use random values instead.
2015-09-08 09:14:03 -05:00
Slava Monich
aca873a5c4 [spec] Fixed configure option. MER#531
Configure option that enables org.ofono.DebugLog interface was misspelled.
2015-08-27 20:59:38 +03:00
Slava Monich
a12e10e36f Merge pull request #301 from monich/uicc_subscription
SET_UICC_SUBSCRIPTION
2015-08-26 12:50:58 +03:00
Slava Monich
7cd3fb74d4 [rilmodem] Simplified RIL initialization code
Requesting SIM status from RIL_REQUEST_SET_UICC_SUBSCRIPTION error handler
smells like a potential infinite loop. And it doesn't seem to be necessary.
Without that, the whole RIL_REQUEST_SET_UICC_SUBSCRIPTION completion
callback becomes unnecessary.

Simplified the algorithm of finding GSM/UMTS app index. It was a bit strange.
2015-08-25 16:37:30 +03:00
Slava Monich
84289d83fd [rilmodem] If error or request code is unknown, print the number
Also added string for RIL_REQUEST_SET_UICC_SUBSCRIPTION
2015-08-25 16:37:02 +03:00
Carsten Munk
f826abdbc7 Implement SET_UICC_SUBSCRIPTION. Fixes MER#1263
This is based on bd4677ee20
and 6b757515bf by Ratchanan Srirattanamet.
Any missing credit, let us know.
2015-08-25 11:28:31 +02:00
Kuba Pawlak
4e9cbcdb89 hfp: Handle extra CCWA event
When a call is waitng, CCWA event is sent and call object
in state WAITING is created. on ReleaseAndAnswer it is
promoted to INCOMING and later to ACTIVE.
iPhones send an extra CCWA event when active call is ended.
This extra event is creating a second call object in state
WAITING. It is not possible to have two WAITING calls, but
previously waiting call was already promoted to INCOMING.
For a brief time we have two calls from the same number,
one INCOMING and one WAITING. Later WAITING one is removed.
As we cannot have a waiting and incoming call at the same
time, ignore CCWA when there is already an INCOMING call.

< \r\n+CIEV: 3,3\r\n
< \r\n+CIEV: 2,1\r\n
< \r\n+CIEV: 3,0\r\n
< \r\n+CCWA: "01234567890",129,1,"Me"\r\n
< \r\n+CIEV: 3,1\r\n
> AT+CLCC\r
< \r\n+CLCC: 1,0,0,0,0,"09876543210",129,"Me"\r\n
< \r\n+CLCC: 2,1,5,0,0,"01234567890",129,"Me"\r\n
< \r\nOK\r\n
< \r\n+CIEV: 2,0\r\n
< \r\n+CCWA: "01234567890",129,1,"Me"\r\n
< \r\n+CIEV: 2,1\r\n
< \r\n+CIEV: 3,0\r\n
> AT+CLCC\r
< \r\n+CLCC: 2,1,0,0,0,"01234567890",129,"Me"\r\n
< \r\nOK\r\n
2015-08-24 16:29:29 -05:00
Slava Monich
f6ac328110 Merge pull request #298 from monich/debuglog
Add org.ofono.DebugLog interface
2015-08-24 14:36:14 +03:00
Slava Monich
8d46ababee [ofono] Added org.ofono.DebugLog interface. MER#531
It provides the following methods:

  array(string,boolean) List()
  void Enable(string pattern)
  void Disable(string pattern)

Enable and Disable methods allow to modify ofono logging settings
without restarting it. The List method returns the list of modules
for which logging can be changed at runtime and their current settings.
2015-08-19 16:33:07 +03:00
Denis Kenzior
9ec8d03c7c voicecall: Don't accept USSD strings in Dial() 2015-08-06 17:16:03 -05:00
Kuba Pawlak
3e6bbc676f hfp: Synchronize call state in case of +CHUP error
It is possible for the phone to accept Dial request
but not actually dial. This leaves a voicecall object
in state 'dialling' that cannot be removed.
Proposed workaround is to trigger AT+CLCC when an error
is returned for Hangup. As the call is not on the list,
this would remove this hanging object and signal CallRemoved.

Windows Phone trace with this fix:
ofonod[273]: > ATD1;\r
ofonod[273]: < \r\nOK\r\n
ofonod[273]: src/voicecall.c:dial_handle_result() Registering new call: 1
ofonod[273]: < \r\n+CIEV: 5,4\r\n
ofonod[273]: src/network.c:ofono_netreg_strength_notify() strength 80
ofonod[273]: > AT+CHUP\r
ofonod[273]: < \r\nERROR\r\n
ofonod[273]: src/voicecall.c:generic_callback() command failed with error: Unknown error type
ofonod[273]: > AT+CLCC\r
ofonod[273]: < \r\nOK\r\n
ofonod[273]: src/voicecall.c:ofono_voicecall_disconnected() Got disconnection event for id: 1, reason: 2
2015-08-05 11:15:33 -05:00
Denis Kenzior
8be0245664 cdma-connman: Make static analysis tools happy
The kernel simply puts a null terminator at index 15 prior to ifr_name
processing.  So we do the same.

Original report by:
Sabas Rosales, Blanca E <blanca.e.sabas.rosales@intel.com>

 Buffer not null terminated (BUFFER_SIZE_WARNING) buffer_size_warning:
 Calling strncpy with a maximum size argument of 16 bytes on destination
 array ifr.ifr_ifrn.ifrn_name of size 16 bytes might leave the
 destination string unterminated.

  92        strncpy(ifr.ifr_name, interface, IFNAMSIZ);
2015-07-28 10:18:26 -05:00
Denis Kenzior
ca105f7040 ppp_net: Make static analysis tools happy
The kernel simply puts a null terminator at index 15 prior to ifr_name
processing.  So we do the same.

Original report by:
Sabas Rosales, Blanca E <blanca.e.sabas.rosales@intel.com>

 Buffer not null terminated (BUFFER_SIZE_WARNING) buffer_size_warning:
 Calling strncpy with a maximum size argument of 16 bytes on destination
 array ifr.ifr_ifrn.ifrn_name of size 16 bytes might leave the
 destination string unterminated.

  67        strncpy(ifr.ifr_name, net->if_name, sizeof(ifr.ifr_name));
2015-07-28 10:16:16 -05:00
Denis Kenzior
dbb3ec13e5 gprs: Try re-attaching when we switch cells 2015-07-20 13:51:29 -05:00
Alfonso Sanchez-Beato
1b3302322a message-waiting: Fix reading EF_MWIS records 2015-07-16 20:22:38 -05:00
Alfonso Sanchez-Beato
cd76f913f0 message-waiting: Update properly EF_MWIS SIM file 2015-07-16 20:17:27 -05:00
Denis Kenzior
8dc220bc11 AUTHORS: Mention Johannes' contributions 2015-07-16 14:11:14 -05:00
Johannes 'josch' Schauer
b04fabcda3 udevng: add support for Ericsson N5321 gw 2015-07-16 14:10:41 -05:00
Kuba Pawlak
71df8bb15e hfp_hf_bluez5: Fix crash on re-pairing a Device
It may happen that a Device object is unpaired an paired again
without being removed from DBus. This in turn triggers second
modem object to be created, but not fully initialized.
If this modem object is used, oFono will crash.
2015-07-12 21:19:31 -05:00
Denis Kenzior
35ebbf4c97 handsfree: Mark GetProperties method ASYNC 2015-07-06 04:06:45 -05:00
Marcel Holtmann
a2acb227fd u8500: Fix compiler warning with logical expression
CC       plugins/u8500.o
plugins/u8500.c: In function ‘reachable_cb’:
plugins/u8500.c:235:28: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
  if (!g_isi_msg_error(msg) < 0)
                            ^
2015-07-07 11:35:54 +02:00
Marcel Holtmann
def77f7653 n900: Fix compiler warning with logical expression
CC       plugins/n900.o
plugins/n900.c: In function ‘mtc_reachable_cb’:
plugins/n900.c:241:28: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
  if (!g_isi_msg_error(msg) < 0)
                            ^
2015-07-07 11:35:54 +02:00
Marcel Holtmann
c3af639874 isiusb: Fix compiler warning with logical expression
CC       plugins/isiusb.o
plugins/isiusb.c: In function ‘reachable_cb’:
plugins/isiusb.c:207:28: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
  if (!g_isi_msg_error(msg) < 0)
                            ^
2015-07-07 11:35:54 +02:00
Marcel Holtmann
b2b67fa74e gatchat: Fix compiler warning with logical expression
CC       gatchat/gatchat.o
gatchat/gatchat.c: In function ‘have_line’:
gatchat/gatchat.c:586:28: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
  if (!strncmp(str, "AT", 2) == TRUE)
                            ^
2015-07-07 11:35:54 +02:00
Denis Kenzior
96754c0dfc AUTHORS: Mention Marko's contributions 2015-07-05 05:44:46 -05:00
Marko Sulejic
f2c474c55a configure.ac: fix typo 2015-07-05 05:43:56 -05:00
Slava Monich
07144c2dd5 Merge pull request #294 from monich/mer1137
Don't drop SMS datagrams with unknown ports
2015-07-02 00:57:27 +03:00
Denis Kenzior
58076d9a00 AUTHORS: Mention Sergey's contributions 2015-07-01 08:10:39 -05:00
Sergey Alirzaev
4a937b96aa build: make ofono build against musl
ifdef away GNU libc extensions and use a POSIXly correct pointer type
2015-07-01 08:09:53 -05:00
Denis Kenzior
fceb5a41c2 handsfree: Fix potential buffer overflow
Function: ag_features_list
 static const char *list[10];  (Out of bounds write, line 75)
  Incrementing i the value is now 10, for “hf-indicators”

Reported by: blanca.e.sabas.rosales@intel.com
2015-06-30 16:58:36 -05:00
Slava Monich
0073dc7bfc [sms] Don't drop SMS datagrams with unknown ports. Fixes MER#1137 2015-06-26 15:52:35 +03:00
Tommi Kenakkala
297bdaba0f Merge pull request #293 from tkenakka/cherrypick-pin-upstr
[sim] Improve Emit LockedPins after pin_type is queried. MER#1082
2015-06-23 15:12:46 +03:00
Tommi Kenakkala
f14db3b2a6 Merge pull request #292 from tkenakka/sockpath
Read RILD command socket path from a conf file. MER#1107
2015-06-23 14:44:31 +03:00
Tommi Kenakkala
4a0182616d [ril] Read RILD socket path from a file at startup. MER#1107
This allows configuring at startup the socket path to which ril plugin
will connect to.
2015-06-23 11:44:48 +03:00
Tommi Kenakkala
bbdfc8f46d [sim] Improve Emit LockedPins after pin_type is queried. MER#1082
Merge additional upstreaming changes from upstream commit eebe2f3
to previous nemomobile ofono commit 10328e6
2015-06-23 11:38:10 +03:00
Tommi Kenakkala
fbd59a8dc9 [gril] Change oFono gril to take a socket path. MER#1107
This allows configuring at startup the socket path to which gril
will connect to.
2015-06-22 11:16:00 +03:00
Denis Kenzior
48da783732 sim: Fix up whitespace issues 2015-06-18 14:59:06 -05:00
Tommi Kenakkala
eebe2f3ac2 Emit LockedPins after pin_type is queried
Fixes property change not being emited when hot-swapping a
PIN-enabled card.
2015-06-18 14:56:05 -05:00
Tommi Kenakkala
7eb6d5559a Merge pull request #291 from tkenakka/pin
[sim] Reset ofono pin state to none when card removed
2015-06-18 12:14:18 +03:00
Tommi Kenakkala
9a47510eb5 [sim] Coding conventions improvements for sim.c
Improves 10328e626d
2015-06-18 12:11:03 +03:00
Tommi Kenakkala
8fc7ae836f [sim] Reset pin state to none when card removed
Improves d88af05dc3
sim_get_properties would have problems with OFONO_SIM_PASSWORD_INVALID.
2015-06-18 12:11:03 +03:00
Tommi Kenakkala
4677729502 sim: Reset pin_type on card remove
Fixes PinRequired not being emitted when a card is inserted
2015-06-17 23:09:03 -05:00
Tommi Kenakkala
8c0f4f27eb Merge pull request #290 from tkenakka/pin
Refactor rilmodem SIM PIN handling
2015-06-10 15:09:53 +03:00
Tommi Kenakkala
b932bed519 Merge pull request #288 from monich/features
Don't unnecessarily emit "Features" PropertyChanged signal
2015-06-10 15:08:34 +03:00
Tommi Kenakkala
db83ac369b Merge pull request #287 from monich/leak
Fix memory leak
2015-06-10 15:02:54 +03:00
Tommi Kenakkala
e26df8a645 [rilmodem] Minor sim related logging updates 2015-06-09 16:19:01 +03:00
Tommi Kenakkala
5144f3fa14 [rilmodem] Remove ofono_set_pin_lock_state. Contributes MER#1082
Core sets LockedPins when driver returns that a PIN query is
required.
2015-06-09 16:17:55 +03:00
Tommi Kenakkala
0d6459b9b0 [sim] Remove ofono_set_pin_lock_state. Contributes MER#1082 2015-06-09 16:17:44 +03:00
Tommi Kenakkala
10328e626d [sim] Emit LockedPins changed. Contributes MER#1082
org.ofono.SimManager "Present" is signalled by ofono_sim_inserted_notify,
but LockedPins and PinRequired are updated later by sim_pin_query_cb.
Without signalling a client does not know when LockedPins
becomes available.
2015-06-09 16:05:43 +03:00
Tommi Kenakkala
5b407d654a [rilmodem] Reset retry count on PIN state change
After this rilmodem driver reports retries only for the required PIN type
and does not remember counts for previous password types.
2015-06-09 16:05:43 +03:00
Tommi Kenakkala
d88af05dc3 [sim] Reset pin_type on card removal. Contributes MER#1083
With this the variable behind org.ofono.SimManager "PinRequired"
is reset when card is removed, allowing signalling property change
in sim_pin_query_cb when card is inserted back.
2015-06-09 16:05:43 +03:00
Tommi Kenakkala
99cae6876f [rilmodem] Reset rilmodem driver's PIN type on card removal. Contributes MER#1083
Getting the PIN state for a freshly inserted card takes a while,
without this change driver uses the old state until the new state
is known.
2015-06-09 16:05:43 +03:00
Tommi Kenakkala
89e6593f9c [rilmodem] Delay signalling SIM inserted until PIN state available
Delay ofono_sim_inserted_notify call to core until PIN state is parsed
from gsmumts application by rilmodem driver.
2015-06-09 16:05:43 +03:00
Kuba Pawlak
93ccb84761 hfpmodem: Fix connecting to AG with existing mpty
If there is more then one active or held call, we are in mpty calls.
We won't get indicator update if any of them is released by CHLD=1x.
So we have to poll it.
2015-06-04 16:18:08 -05:00
Alfonso Sanchez-Beato
e70afdd9dc gprs: Add comment to gprs_reset_contexts 2015-05-18 12:13:04 -05:00
Denis Kenzior
1edb6eec9b test: Fix file mode for reset-contexts 2015-05-18 10:02:10 -05:00
Alfonso Sanchez-Beato
946b568f43 gprs: Refactor to remove forward declaration 2015-05-18 09:08:33 -05:00
Alfonso Sanchez-Beato
f3f3dabfac test: Add script for resetting contexts 2015-05-18 09:08:28 -05:00
Alfonso Sanchez-Beato
4c0f783f5c doc: Add description for ResetContexts method 2015-05-18 09:08:20 -05:00
Alfonso Sanchez-Beato
444611c086 gprs: Add DBus method to reset contexts
Add DBus method that removes the current contexts and re-provisions
using the APN database.
2015-05-18 09:08:13 -05:00
Tommi Kenakkala
8e9085f5ab Merge pull request #289 from tkenakka/simmgr
[rilmodem] Fix simmanager removal handling. Contributes to MER#928
2015-05-15 12:47:15 +03:00
Tommi Kenakkala
c33a48ea0c [rilmodem] Fix simmanager removal handling. Contributes to MER#928
Improves 7d0d72a.
2015-05-15 11:38:21 +03:00
Alex J Lennon
f8d9485dc2 cinterion: Correct use of freed structure
On error struct cb_data *cbd was used after in cinterion_set_online
after already being freed.
2015-05-13 15:56:34 -05:00
Denis Kenzior
23c45abd57 ste: Fix out-of-order free
CALLBACK_WITH_FAILURE used data structure freed just beforehand
2015-05-13 15:55:00 -05:00
Denis Kenzior
a371f46735 dundee: Fix out-of-order free
CALLBACK_WITH_FAILURE used data structure freed just beforehand
2015-05-13 15:44:39 -05:00
Denis Kenzior
ce0529fcf6 AUTHORS: Mention Alex's contributions 2015-05-13 09:57:53 -05:00
Alex J Lennon
fc3f937a67 udev: Add support for ehs6 name
As with tc65, ehs6 makes use of cinterion plugin
2015-05-13 09:57:53 -05:00
Alex J Lennon
7d4a19b114 cinterion: Register as OFONO_VENDOR_CINTERION
This enables us to take advantage of vendor specific quirks
(e.g. signal strength handling specifics for tc65)
2015-05-13 09:57:53 -05:00
Alex J Lennon
4242f6ee72 atmodem: Add Cinterion quirk for signal strength
Implement OFONO_VENDOR_CINTERION specific vendor support to register
textual +CIEV indications for signal strength using AT^SIND command.
2015-05-13 09:57:53 -05:00
Alex J Lennon
b31a3c2390 tc65: Replace tc65 plugin with cinterion plugin
On the basis that tc6x and other Cinterion devices will likely
have similar firmware requirements, provide a generic Cinterion
plugin which is functionally identical to the replaced tc65 plugin.

The udev implementation retains support for "tc65" name for
backwards compatibility, and adds support for the new "cinterion"
name.
2015-05-13 09:57:53 -05:00
Denis Kenzior
8d47f97106 hfp_hf_bluez5: Implement sco_connected_hint 2015-05-13 09:57:53 -05:00
Denis Kenzior
fdba39b8ed handsfree-audio: Call sco_connected_hint 2015-05-13 09:57:52 -05:00
Denis Kenzior
288364295c include: Add sco_connected_hint to handsfree-audio 2015-05-13 09:57:52 -05:00
Denis Kenzior
bce5d9579c gatchat: Introduce g_at_chat_get_userdata 2015-05-13 09:57:52 -05:00
Denis Kenzior
1c2987670d handsfree-audio: Add additional debugs 2015-05-13 09:57:52 -05:00
Tommi Kenakkala
44585697c3 Merge pull request #286 from tkenakka/simmgr
Register SimManager interface always and simplify logic
2015-05-06 10:06:29 +03:00
Slava Monich
3860230644 [modem] Don't unnecessarily emit "Features" PropertyChanged signal
Not all interfaces have corresponding features, meaning that not every
interface addition or removal actually updates the feature list.
If nothing else, this reduces the number of D-Bus signals emitted.
2015-05-05 16:11:06 +03:00
Tommi Kenakkala
07da2f3fa7 [rilmodem] Minor updates to error debug logging
Added function name prefix printing.
2015-05-05 15:52:35 +03:00
Tommi Kenakkala
7d0d72a4a9 [rilmodem] Register SimManager always and simplify logic. MER#928
Register org.ofono.SimManager always, without this the dbus
interface does not exist when starting without a SIM card.
Simplified rilmodem SIM status handling.
Moved some debug logging from sim.c to rilutil.c.
2015-05-05 15:52:35 +03:00
Tommi Kenakkala
f9ee2ae9b8 [rilmodem] Remove rilplugin sim inserted notification. MER#928
Functionality combined in rilmodem/sim.c.
No need to notify from both ril.c and sim.c.
2015-05-05 15:52:35 +03:00
Slava Monich
063234a433 [rilmodem] Fixed memory leak in handle_sne() 2015-05-05 15:51:12 +03:00
Tommi Kenakkala
c006d822f1 [rilmodem] Improve rilutil debug logging
Move some logs from rilmodem/sim.c to rilmodem/rilutil.c
and do some additional improvements.
2015-04-30 16:17:12 +03:00
Luiz Augusto von Dentz
a5b040b781 gdbus: Close private connection if setup fails
Private connection should be properly closed with dbus_connection_close
otherwise libdbus exits with the following error:

  'The last reference on a connection was dropped without closing the
   connection. This is a bug in an application. See
   dbus_connection_unref() documentation for details. Most likely, the
   application was supposed to call dbus_connection_close(), since this
   is a private connection.'
2015-04-20 09:04:39 +02:00
Szymon Janc
97abe1751d gdbus: Fix crash in g_dbus_create_error_valist
Passing NULL format parameter to vsnprintf results in invalid argument
error on glibc. But with some other libc libraries (musl and uClibc)
this results in dereferencing NULL pointer and crash due to
segmentation fault.
2015-04-09 16:59:08 +02:00
Szymon Janc
2f75b13ecd gdbus: Use g_dbus_create_error_valist internally
There is no need to duplicate code in g_dbus_send_error_valist.
2015-04-09 16:59:08 +02:00
Michael Janssen
73e517bcca gdbus: Add g_dbus_get_flags function
The g_dbus_get_flags function enables detection of when the
G_DBUS_FLAG_ENABLE_EXPERIMENTAL is set.
2015-04-07 19:00:45 +02:00
Luiz Augusto von Dentz
dae225a0d6 gdbus: Make GDBusClient work without ObjectManager
This makes GDBusClient work normally without ObjectManager.
2015-03-26 10:02:05 +01:00
Arman Uguray
97ac3f7c76 gdbus/client: Allow specifying ObjectManager path
GDBusClient currently hard-codes "/" as the remote ObjectManager path.
This is generally incorrect, as an application can choose to expose an
ObjectManager at any well-known path. This patch fixes this by allowing
the user to pass in the ObjectManager path by introducing a new
conctructor "g_dbus_client_new_full".
2015-03-26 10:02:05 +01:00
Arman Uguray
26a00f2f31 gdbus/client: Don't GetManagedObjects w/o handlers
The client code currently issues GetManagedObjects if new handlers are
set via g_dbus_client_set_proxy_handlers. An application may set these
to NULL before unref'ing a client or to simply prevent further events.
Hence, there is no need to refresh objects or properties if all handlers
are NULL.
2015-03-26 10:02:05 +01:00
Kuba Pawlak
cede3700f7 hfpmodem: slc.c: make sure to use none_prefix 2015-03-24 11:05:03 -05:00
Kuba Pawlak
318d313fc9 hfpmodem: hfpmodem.c make sure to use none_prefix 2015-03-24 11:04:48 -05:00
Kuba Pawlak
8e6ebab83b hfp_ag_bluez5: use none prefix for AT+BCC.
iPhone 5s with iOS8.2 sometimes failes to acknowledge AT+BCC
with OK. This means +CIEV events get consumed by this command
and call ended notification is not parsed.

Nov 30 00:00:19 ofonod[938]: > AT+BCC\r
Nov 30 00:00:28 ofonod[938]: < \r\n+CIEV: 2,0\r\n
2015-03-24 09:12:58 -05:00
Tommi Kenakkala
7331c88b41 Merge pull request #285 from tkenakka/merge1.16
Merge oFono upstream release 1.16
2015-03-04 13:48:08 +02:00
Tommi Kenakkala
063eefbac1 [ofono] Disable build time he910 modem 2015-03-03 15:27:45 +02:00
Tommi Kenakkala
12b510b4e7 [ofono] Update version to 1.16 2015-03-03 15:27:38 +02:00
Tommi Kenakkala
c04f5df8ec [ofono] Merge upstream release 1.16 2015-02-27 15:56:55 +02:00
Tommi Kenakkala
011bc0741a Merge pull request #284 from tkenakka/master
[gprs] Fix pri_reset_context_properties crashes
2015-02-27 11:36:09 +02:00
Tommi Kenakkala
773834c5a3 [gprs] Fix pri_reset_context_properties crashes
Fixes issues of ff63e9b0
2015-02-27 11:08:03 +02:00
Tommi Kenakkala
14acafc581 Merge pull request #283 from tkenakka/norild
Rild comms socket detection and monitoring for oFono rilmodem plugin
2015-02-26 13:29:32 +02:00
Tommi Kenakkala
b4df40608b [gril] Minor updates to ofono gril logging 2015-02-26 11:52:24 +02:00
Tommi Kenakkala
26f750fe4f [plugins] Improved ofono rilmodem socket handling
- Fix rildev.c's rild socket inotify handling
- Fix gril creation fail handling
- Improve logic logging and add __func__ arg for some ofono_XXX log prints
- Same style for rildev plugin name descriptor as what rilmodem plugin has
2015-02-26 11:52:23 +02:00
Jarko Poutiainen
51f6837545 [plugins] rildev.c remove unnecessary modem reset
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-02-25 15:18:52 +02:00
Jarko Poutiainen
6919c43ff6 [plugins] rildev.c add error handling
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-02-25 15:18:52 +02:00
Jarko Poutiainen
621614e518 [Makefile] add rildev as builtin
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-02-25 15:18:52 +02:00
Jarko Poutiainen
8e820dfdd3 [gril] gril.h remove current_passwd
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-02-25 15:18:51 +02:00
Jarko Poutiainen
04cc2e9fd2 [gril] gril.c remove current_passwd
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-02-25 15:18:51 +02:00
Jarko Poutiainen
ae5c8e6e3a [rilmodem] remove current_passwd support from sim driver
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-02-25 15:18:51 +02:00
Jarko Poutiainen
1509cb811a [plugins] ril to support rild socket detection
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-02-25 15:18:51 +02:00
Jarko Poutiainen
5682df6d82 [plugins] rildev to detect rild socket
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-02-25 15:18:51 +02:00
Jarko Poutiainen
3e38512e2f [plugins] add rildev.h
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-02-25 15:18:51 +02:00
Alfonso Sanchez-Beato
dc5157c5d0 plugins: Add rildev for creation of ril modems
This new plugin will create ril modems, providing the same
functionality as udev/udevng does for USB-based modems.
2015-02-25 15:18:51 +02:00
Tommi Kenakkala
59449f74a1 Merge pull request #282 from monich/provision
Add ProvisionContext method to ConnectionContext interface
2015-02-25 15:16:31 +02:00
Slava Monich
ff63e9b057 [ofono] Added ProvisionContext method to ConnectionContext interface
Allows to reset connection context properties back to default.
2015-02-25 12:36:04 +02:00
Szymon Janc
d8edd49535 gdbus: Fix not calling disconnect function
If daemon gets disconnected from D-Bus sender is NULL. Watches that
was explicitly added with NULL sender (ie disconnected_signal in
g_dbus_set_disconnect_function) should be called anyway.
2015-02-24 18:24:42 +01:00
Pasi Sjöholm
7b73f569eb Merge pull request #280 from tigeli/master
[rilmodem] fix issue with only one nameserver being provided
2015-02-23 10:03:55 +01:00
Arman Uguray
8660527b11 gdbus: Don't refresh objects/props if disconnected
If g_dbus_client_set_proxy_handlers gets called from within a
proxy_removed callback, the code may end up refreshing the proxy's
properties and incorrectly access the client's proxy_list as it gets
freed. This patch fixes this, so that get_managed_objects does nothing
if it gets called during a service disconnect.
2015-02-22 19:42:25 +01:00
Pasi Sjöholm
5672f7248d [rilmodem] fix issue with only one nameserver being provided
No need to check if we have multiple nameserver provided
by the context, single one is enough.
2015-02-20 22:21:26 +02:00
Denis Kenzior
d6bc91ebfc hfpmodem: Make sure to use none_prefix
ofonod[253]: > AT+CCWA=1\r
ofonod[253]: < \r\n+BCS:2\r\n
ofonod[253]: < \r\nOK\r\n
2015-02-20 10:30:21 -06:00
Denis Kenzior
3d592d7d46 hfpmodem: Make sure to set the prefix properly
ofonod[1239]: > AT+COPS=3,0\r
ofonod[1239]: < \r\n+BCS:2\r\n
ofonod[1239]: < \r\nOK\r\n
2015-02-20 10:28:24 -06:00
Tommi Kenakkala
2ed0073bd1 Merge pull request #279 from tkenakka/log
[ofono] Add ril disconnect logging
2015-02-17 12:29:19 +02:00
Tommi Kenakkala
f6ade48648 Merge pull request #278 from tkenakka/sms-tp-oa
Fix received SMS alphanumeric TP-OA handling
2015-02-17 12:28:55 +02:00
Tommi Kenakkala
73ba48c9fb [ofono] Add ril disconnect logging 2015-02-17 11:12:18 +02:00
Tommi Kenakkala
f3611cef21 [ofono] unit: Add test to encode / decode 11 char SMS TP-OA 2015-02-16 10:31:16 +02:00
Tommi Kenakkala
15d682e62a [ofono] sms: Fix alphanumeric TP-OA handling
This fixes the issue of ofono ignoring received SMS if originator address
is a 11-character long alphanumeric string (with ext. ASCII).

TP-OA max length comparisons were incorrect because TP-OA's 7-bit coded
octets transport eleven 8-bit chars. The current code assumed only 10 chars
were possible.
- increases the array size to 23, (max 22 bytes for UTF8 + null terminator)
- Updates the sanity check to account for the correct maximum
- For encoding, checks the maximum length in UTF8 characters instead of bytes
- Make sure after the UTF8 -> GSM conversion that the number of GSM bytes is
not > 11, which is the maximum payload.
2015-02-16 10:30:18 +02:00
Denis Kenzior
e2398b4dfa smsutil: Add additional sanity check
We make sure that after performing the UTF8 -> GSM conversion, the
number of GSM bytes is not greater than 11, which is the maximum
payload.
2015-02-13 09:59:59 -06:00
Tommi Kenakkala
42deee76a1 unit: Add test to encode / decode 11 char TP-OA 2015-02-13 09:55:16 -06:00
Tommi Kenakkala
2af3c733b7 sms: Fix alphanumeric TP-OA handling
TP-OA max length comparisons were incorrect because TP-OA's 7-bit
coded octets transport eleven 8-bit chars.  The current code assumed
only 10 chars were possible.

The patch
- increases the array size to 23, (maximum of 22 bytes for UTF8
  encoding + null terminator)
- Updates the sanity check to account for the correct maximum
- For encoding, checks the maximum length in UTF8 characters instead of
  bytes
2015-02-13 09:49:39 -06:00
Denis Kenzior
604fa223f4 AUTHORS: Mention Tommi's contributions 2015-02-02 09:29:46 -06:00
Tommi Kenakkala
04218d3a86 handsfree-audio: Refactor manager init / cleanup 2015-02-02 09:28:34 -06:00
Tommi Kenakkala
41fadd3787 main: Remove handsfree_audio_manager init/cleanup
Init allocates a SCO audio socket always. oFono should do that
with bluez5 but not with bluez4.  This patch starts the refactoring of
the handsfree_audio_manager init/cleanup functionality.
2015-02-02 09:26:58 -06:00
Cedric Jehasse
d539ed19f3 atmodem: fix retries reporting from AT+CPINR
The retries array was not correctly filled in.
2015-02-02 09:22:21 -06:00
Cedric Jehasse
25f926c733 atmodem: Sierra modems should be polled after CPIN
Sierra modem will return "CME ERROR: 14" when polled right after pin has
been entered. Use the existing vendor quirk to handle this.
2015-02-02 09:21:10 -06:00
Cedric Jehasse
151b837428 sierra: add sim state polling after CFUN enable
When pin is queried shortly after a Siera dongle is plugged in,
"AT+CPIN?" responds with "CME ERROR 14: SIM".
Poll the sim, as already done by several other vendor plugins.
2015-01-31 10:20:18 -06:00
Tommi Kenakkala
0c23ed90b7 Merge pull request #276 from tkenakka/sco-sock
[ofono] hfp_hf_bluez5 typo fix
2015-01-27 10:44:12 +02:00
Tommi Kenakkala
54854c44a2 [ofono] hfp_hf_bluez5 typo fix 2015-01-27 10:41:00 +02:00
Tommi Kenakkala
da297d5722 Merge pull request #275 from tkenakka/sco-sock
[ofono] Move handsfree audio manager cleanup to hfp_hf_bluez5 plugin
2015-01-27 10:34:12 +02:00
Tommi Kenakkala
aba76cec73 [ofono] Move handsfree audio manager cleanup to hfp_hf_bluez5 plugin 2015-01-27 10:02:40 +02:00
Tommi Kenakkala
3cdc8f775d Merge pull request #274 from tkenakka/sco-sock
[ofono] Move SCO socket allocation to hfp_hf_bluez5 plugin
2015-01-27 09:02:20 +02:00
Tommi Kenakkala
bee03f8b56 [ofono] Move SCO socket allocation to hfp_hf_bluez5 plugin
SCO socket is handled by Bluez4 and conflicts with ofono's socket
allocation.
2015-01-27 08:58:48 +02:00
Tommi Kenakkala
7f4da6d59f Merge pull request #273 from jpoutiai/signal-context
Emit signal when context changed
2015-01-13 09:17:30 +02:00
Tommi Kenakkala
5754fff800 Merge pull request #272 from monich/noproxy
Setup route for mmsc if there's no mms proxy
2015-01-07 16:05:02 +02:00
Jarko Poutiainen
fff6952703 [rilmodem] if data call changed emit signal
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-01-07 09:44:06 +02:00
Jarko Poutiainen
96ff96ab1a [gril] compare data call lists based on cid
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-01-07 09:43:43 +02:00
Jarko Poutiainen
986ac50b9e [gril] publish g_ril_unsol_cmp_dcl
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-01-07 09:43:10 +02:00
Jarko Poutiainen
8600d8d293 [gprs] implement ofono_gprs_context_signal_change
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-01-07 09:42:52 +02:00
Jarko Poutiainen
369af1b401 [gprs] define ofono_gprs_context_signal_change
Signed-off-by: Jarko Poutiainen <jarko.poutiainen@oss.tieto.com>
2015-01-06 13:08:28 +02:00
Slava Monich
500b5234b2 [gprs] Setup route for mmsc if there's no mms proxy 2015-01-05 15:56:12 +03:00
Slava Monich
93eb292b75 Merge pull request #271 from monich/OperatorsChanged
Add NetworkRegistration.OperatorsChanged signal
2014-12-31 12:47:57 +03:00
Slava Monich
3cc42fb087 [network] Added NetworkRegistration.OperatorsChanged signal
This signal gets emitted when operator list has changed.
It contains the current list of operators.
2014-12-22 09:12:18 +01:00
Marcel Holtmann
c9e426ecd7 Release 1.16 2014-12-13 02:56:19 +01:00
Alfonso Sanchez-Beato
10f173981c radio-settings: Show all available technologies
Not all possible futures technologies were being showed on the DBus
interface.
2014-12-12 08:54:14 -06:00
Jarko Poutiainen
782f2327fd Merge pull request #270 from jpoutiai/ipv6
[RILMODEM] fix same gateway for ipv4 and ipv6 issue
2014-12-12 12:38:26 +02:00
Tommi Kenakkala
8bda4032ca Merge pull request #269 from tkenakka/master
[rilmodem] Log ril version
2014-12-12 10:40:53 +02:00
Tommi Kenakkala
b2f4bd7603 [rilmodem] Log ril version 2014-12-12 10:22:11 +02:00
Jarko Poutiainen
33bb6d829c [RILMODEM] fix same gateway for ipv4 and ipv6 issue
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-12-12 08:32:38 +02:00
Denis Kenzior
bb71141d79 phonesim: Instantiate radio-settings in post_sim 2014-12-10 11:03:17 -06:00
Denis Kenzior
4e466f6fec phonesim: Add minimal radio-settings functionality 2014-12-10 11:03:17 -06:00
Denis Kenzior
a89f8cd56d phonesim: Add skeleton of radio settings driver 2014-12-10 11:03:16 -06:00
Denis Kenzior
95482cb84a radio-settings: Always query available rats
If fast dormancy query is not implemented the available rats are not
queried.
2014-12-10 11:03:16 -06:00
Denis Kenzior
fce95b767a radio-settings: Add additional sanity check 2014-12-10 11:03:16 -06:00
Denis Kenzior
44049f064a radio-settings: rework AvailableTechnologies logic
Take advantage of the new enum structure to future proof and simplify
the logic of generating the AvailableTechnologies property
2014-12-10 11:03:16 -06:00
Denis Kenzior
b899f4aca2 include: No need for OFONO_FLAG* defines 2014-12-10 11:03:16 -06:00
Alfonso Sanchez-Beato
e1cbc5c5ea test: Add AvailableTechnologies to list-modems 2014-12-10 11:03:16 -06:00
Alfonso Sanchez-Beato
5210b85c22 src: Implement RAT list property 2014-12-10 11:03:16 -06:00
Alfonso Sanchez-Beato
e6048f1dc1 include: Add method to list RATs to radio-settings 2014-12-10 11:03:16 -06:00
Tommi Kenakkala
1bea99ac56 Merge pull request #267 from jpoutiai/ipv6
Ipv6
2014-12-10 13:46:16 +02:00
Alfonso Sanchez-Beato
6bdc109ec0 doc: Add AvailableTechnologies property
This new property in org.ofono.RadioSettings interface will hold the
possible values for radio access technology for the modem.
2014-12-09 22:29:21 -06:00
Jarko Poutiainen
aab24b3f24 Merge pull request #268 from hedayat/master
Re-enable CBS in n900 plugin and fix CBS related crash in N9
2014-12-09 07:47:42 +02:00
Jarko Poutiainen
65eea56efe [RILMODEM] use glib to split string to array and some style fixes
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-12-08 15:54:55 +02:00
Jarko Poutiainen
8ac7e502b7 [GRIL] use glib to split string to array
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-12-08 15:53:06 +02:00
Hedayat Vatankhah
9e8bdf0d64 [packaging] Fix error in changelog date format preventing mb2 builds 2014-12-08 01:46:41 +03:30
Hedayat Vatankhah
70e99152a3 Fix cbs related n900/isimodem crash
Don't remove cbs data during shutdown sequence in isimodem driver, since
it is already being removed.

[n900] Fix cbs related crash
2014-12-08 01:46:41 +03:30
Hedayat Vatankhah
a90fc92665 Revert "Remove the cbs creation for n900 plugin, this lead to crashes on n9 ofono init."
This reverts commit 804bef98ad.
2014-12-08 01:46:41 +03:30
Denis Kenzior
7dca0a7315 sim: Fix pin retries bogus values on some arch-es
On some architectures the SimManager.Retries property was getting bogus
values.  This is because we were sending an array which pointed to int
values instead of the expected unsigned char values.

This fix allocates a temporary array of unsigned chars to hold the
actual D-Bus values being sent.  Additionally, the dictionary array is
changed to point to the temporary unsigned char based values instead of
the raw 'int' based retry values.
2014-12-04 08:57:48 -06:00
Jarko Poutiainen
1d23793eb0 Merge pull request #266 from locusf/master
Remove the cbs creation for n900 plugin, this lead to crashes on n9 ofon...
2014-12-01 07:58:33 +02:00
Aleksi Suomalainen
804bef98ad Remove the cbs creation for n900 plugin, this lead to crashes on n9 ofono init.
For the latest release of ofono for Nemo Mobile, the modem fails to initialize
with the isimodem driver enabled. This is due to a segmentation fault occurring
in the flush of the atoms of the modem in cbs_assembly_free function. This
resulted in a segmentation fault when using n900 driver.

[n900] Remove cbs creation.
2014-11-30 16:06:58 +00:00
Jarko Poutiainen
1fdde8fecb [RILMODEM] gprs dual mode support
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-11-26 14:38:06 +02:00
Jarko Poutiainen
1c484a6d04 [GRIL] in reply parse all datacall settings
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-11-26 13:55:13 +02:00
Neil Jerram
19519b2132 test: Support receiving SMS with non-ASCII chars
Without this I get the following Python traceback, for an SMS that
contains the UK pound sign.

ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 230, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "./receive-sms", line 9, in incoming_message
    print("%s" % (message))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 51: ordinal not in range(128)
2014-11-24 12:29:45 -06:00
Jarko Poutiainen
64e888ef04 [RILMODEM] ipv6 support
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-11-20 09:54:33 +02:00
Jarko Poutiainen
b33e0061d0 Merge pull request #263 from jpoutiai/sim-fix
[RILMODEM] fix hotswap regression
2014-11-18 15:27:29 +02:00
Jarko Poutiainen
2babf82823 [RILMODEM] fix hotswap regression
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-11-18 14:10:20 +02:00
Jarko Poutiainen
87a35d5d83 Merge pull request #262 from nemomobile-packages/no-fake
No fake
2014-11-17 15:48:17 +02:00
Jarko Poutiainen
3d264276de [RILMODEM] style fixes
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-11-17 15:31:51 +02:00
Jarko Poutiainen
d6bd24add3 [RILMODEM] remove gprs state faking
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-11-13 10:33:55 +02:00
Jarko Poutiainen
9624eb9ace [gprs] publish ofono_gprs_get_modem
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-10-31 14:55:08 +02:00
Jarko Poutiainen
14672319d2 [gprs] implement ofono_gprs_get_modem
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-10-31 14:54:39 +02:00
Jarko Poutiainen
0d8b576ab6 Merge pull request #261 from jpoutiai/sim-fix
[RILMODEM] query password state and prevent double sim initialisation
2014-10-30 13:59:09 +02:00
Jarko Poutiainen
c16121469b [RILMODEM] query password state and prevent double sim initialisation
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-10-29 10:04:06 +02:00
Jarko Poutiainen
812f552ace Merge pull request #260 from jpoutiai/vc-delay-nro-storing
[voicecall] src/voicecall.c MO call delay storing number
2014-10-28 10:38:24 +02:00
Kuba Pawlak
42ebb69384 he910: Update copyright 2014-10-22 21:23:25 -05:00
Kuba Pawlak
45478b17cf he910: enable location raporting atom 2014-10-22 21:22:33 -05:00
Kuba Pawlak
88f46a9b01 udev: add GPS port definition for HE910 2014-10-22 21:22:24 -05:00
Denis Kenzior
2abcb85809 telitmodem: Fix a few coding style violations 2014-10-22 21:21:49 -05:00
Denis Kenzior
331700a697 AUTHORS: Mention Kuba's contributions 2014-10-22 21:21:18 -05:00
Kuba Pawlak
a753d6c012 telitmodem: location reporting driver 2014-10-22 21:15:35 -05:00
Kuba Pawlak
d39007c948 doc: new file doc/telit-modem.txt 2014-10-22 21:10:50 -05:00
Jarko Poutiainen
fe52d1dc53 [voicecall] src/voicecall.c MO call delay storing number
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-10-22 11:43:14 +03:00
Jarko Poutiainen
8be724836e Merge pull request #259 from jpoutiai/gprs
rilmodem gprs fixes
2014-10-22 10:58:42 +03:00
Jarko Poutiainen
8c96a7e091 Merge pull request #258 from jpoutiai/roaming-fix
Roaming fix
2014-10-22 10:13:01 +03:00
Jarko Poutiainen
f9bd555dc0 [RILMODEM] style fix
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-10-22 09:16:18 +03:00
Denis Kenzior
6c4ac05fbc emulator: Refine +BIND support 2014-10-20 13:40:29 -05:00
Denis Kenzior
934ea9a9fe hfp_ag_bluez5: Bump HFP version to 1.7 2014-10-20 13:40:28 -05:00
Denis Kenzior
cf90f1505d emulator_fuzz: Add test plugin
This plugin creates an org.ofono.test.EmulatorFuzz interface on path
/test.  Currently only one method is implemented, SetIndicatorActive.

SetIndicatorActive("DistractedDrivingReduction", True|False) allows to
activate / deactivate the HF indicator via +BIND unsolicited
notification.
2014-10-20 13:40:28 -05:00
Denis Kenzior
f9d5ee5fa9 emulator: Implement new API 2014-10-20 13:40:28 -05:00
Denis Kenzior
e2785b1865 include: Add API to (de)activate HF indicators 2014-10-20 13:40:28 -05:00
Denis Kenzior
fb1b213e22 test: Add test/set-ddr
Script to set DistractedDrivingReduction property
2014-10-20 13:40:28 -05:00
Denis Kenzior
d3560b3784 handsfree: Be extra pedantic with booleans 2014-10-20 13:40:28 -05:00
Denis Kenzior
017c1161d4 hfp_hf_bluez5: Use latest HFP version 2014-10-20 13:40:28 -05:00
Denis Kenzior
de02f68a2e handsfree: Don't try to send a method return
When we are simply updating the AG of HF indicator changes, do not try
to send a method return message.
2014-10-20 13:40:28 -05:00
Denis Kenzior
0f28d9206d slc: Make sure to initialize variables 2014-10-20 13:40:28 -05:00
Denis Kenzior
eef67018b6 hfp: Implement +BIND notifications 2014-10-20 13:40:28 -05:00
Denis Kenzior
299ffc9620 hfp: Notify core of HF indicators supported by AG
This information was obtained from SLC negotiation
2014-10-20 13:40:28 -05:00
Denis Kenzior
39f08a5e1c hfp: Track supported / active indicators
This information is obtained during SLC establishment
2014-10-20 13:40:28 -05:00
Denis Kenzior
6c0f90fc1b handsfree: Implement new HF indicators API 2014-10-20 13:40:28 -05:00
Denis Kenzior
33537adb9f include: Add HF Indicators related API 2014-10-20 13:40:28 -05:00
Denis Kenzior
e176a9019f hfp: Add implementation of +BIEV 2014-10-20 13:40:28 -05:00
Denis Kenzior
7166aebd51 emulator: Refactor data types 2014-10-20 13:40:28 -05:00
Denis Kenzior
debb0d2d3e hfp: Add HF Indicators BRSF feature for 1.7
If HFP 1.7 client is used, enable the right BRSF feature
2014-10-20 13:40:28 -05:00
Denis Kenzior
ab5b6d1217 handsfree: Skeleton implementation of DDR
Distracted Driving Reduction or Enhanced Safety is implemented using HF
indicator 0x0001
2014-10-20 13:40:28 -05:00
Denis Kenzior
7e3a6628fa handsfree: Add new driver method for HF indicators 2014-10-20 13:40:28 -05:00
Denis Kenzior
fa105c4ba6 hfp: Add initial SLC negotiation for HFP 1.7 2014-10-20 13:40:28 -05:00
Denis Kenzior
99c03292ad doc: Add Distracted Driving Reduction to Handsfree 2014-10-20 13:40:28 -05:00
Denis Kenzior
66cf2a30fa handsfree: Implement new Features property value 2014-10-20 13:40:28 -05:00
Denis Kenzior
a4fa356b16 doc: Add 'hf-indicators' feature to Handsfree API 2014-10-20 13:40:28 -05:00
Denis Kenzior
43e83852dc emulator: Enable HF Indicator feature 2014-10-20 13:40:28 -05:00
Denis Kenzior
36a21da227 emulator: Extend BRSF bitmap
The current check of 8 bits is not enough with HFP 1.7
2014-10-20 13:40:28 -05:00
Denis Kenzior
bef4d610a3 emulator: Add +BIEV implementation 2014-10-20 13:40:28 -05:00
Denis Kenzior
2d158167c2 emulator: Add +BIND implementation 2014-10-20 13:40:27 -05:00
Denis Kenzior
02c5b73f6e emulator: Fix CHLD=? not treated as part of SLC 2014-10-20 13:40:27 -05:00
Denis Kenzior
0727da1d5b emulator: Improve SLC establishment logic 2014-10-20 13:40:27 -05:00
Denis Kenzior
d292e0e0ed hfp: Add enum for known HF Indicators 2014-10-20 13:40:27 -05:00
Denis Kenzior
881207ce18 hfp: Update for new HFP 1.7 values 2014-10-20 13:40:27 -05:00
Denis Kenzior
0f0733c348 doc: Fixup Handsfree API 2014-10-20 13:40:27 -05:00
Jarko Poutiainen
71fd5c148a [RILMODEM] recheck status also in ril_data_probe_reg_cb
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-10-20 10:29:18 +03:00
Jarko Poutiainen
476e440f47 [RILMODEM] recheck status value before using it
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-10-20 10:26:54 +03:00
Jarko Poutiainen
35440277d1 [RILMODEM] prevent datacall slipping through when roaming disabled
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-10-20 09:56:07 +03:00
Jarko Poutiainen
4f67e6743e [RILMODEM]publish get_current_network_status
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-10-20 09:55:40 +03:00
Jarko Poutiainen
c9ba23ae3d [RILMODEM] get network status from core
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-10-20 09:50:15 +03:00
Jarko Poutiainen
dcdddee5c5 [RILMODEM] introduce ril_roaming_allowed
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-10-14 09:31:37 +03:00
Jarko Poutiainen
195c2c6a1e [RILMODEM] prepare ril_roaming_allowed to be published
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-10-14 09:30:53 +03:00
Jarko Poutiainen
51cf33c206 Merge pull request #257 from jpoutiai/master
[RILMODEM] free before calling g_strdup to avoid mem leak
2014-10-10 11:08:50 +03:00
Jarko Poutiainen
08ddddc8d2 [RILMODEM] free before calling g_strdup to avoid mem leak
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-10-10 10:51:02 +03:00
Tommi Kenakkala
dc5eed9c24 Merge pull request #256 from tkenakka/log-gprs
[rilmodem] Logging improvements to gprs
2014-10-09 15:29:08 +03:00
Tommi Kenakkala
72e656e1fb [rilmodem] Logging improvements to gprs
Rilmodem gprs logic slightly touched to store latest reg status
always to gprs_data struct. Reg status logged only when it changes
instead of always.
2014-10-08 15:26:00 +03:00
Marcel Holtmann
8ebb17977b handsfree-audio: Fix broken coding style in switch statement 2014-09-20 16:13:45 +02:00
Tommi Kenakkala
af1717977d Merge pull request #255 from tkenakka/loggingnetreg
[rilmodem] Logging updates to netreg
2014-09-19 11:48:55 +03:00
Tommi Kenakkala
cb48cfa9c3 [rilmodem] Logging updates to netreg 2014-09-18 08:22:38 +03:00
Tommi Kenakkala
759c0bbde4 Merge pull request #253 from tkenakka/logging2
Minor logging improvements to rilmodem
2014-09-18 08:18:27 +03:00
Tommi Kenakkala
300695d069 Merge pull request #254 from tkenakka/ussdnotifycrash
[rilmodem] Fix ussd notify ofono crash
2014-09-18 08:02:31 +03:00
Tommi Kenakkala
f88c1c3ab2 [rilmodem] Fix ussd notify ofono crash
Fixup e23e6ac
2014-09-18 07:56:09 +03:00
Jarko Poutiainen
7415ef7418 Merge pull request #252 from mkuukkane/fix_ofono_cleanup
[ofono] Fix ofono cleanup
2014-09-17 10:11:18 +03:00
Tommi Kenakkala
887d9cf5d1 [rilmodem] Logging updates to radiosettings 2014-09-16 14:06:05 +03:00
Tommi Kenakkala
6231d5cc1c [rilmodem] Minor logging update to voicecall 2014-09-16 14:06:05 +03:00
Tommi Kenakkala
5b1f978a5c [rilmodem] Minor logging update to ussd 2014-09-16 14:06:05 +03:00
Marko Kuukkanen
1d1b9df844 [ofono] Fix ofono cleanup 2014-09-16 10:14:42 +03:00
Alban Crequy
7fb4899970 gdbus: Fix match rule for NameOwnerChanged
When subscribing to the D-Bus signal NameOwnerChanged from the bus driver,
specify the object path and the sender in the match rule. Otherwise, random
connections on the bus could impersonate the bus driver.
2014-09-15 18:03:46 +02:00
Luiz Augusto von Dentz
1e0c41889f gdbus: Fix crash when watch is toggled or disconnected
This partially reverts 510b32b7156625b9df737c916b7a7a5c6fb285b9 since it
still necessary to take a reference before calling dbus_watch_handle
since internally it can call watch_info_free as in the following trace:

 Invalid read of size 8
   at 0x121085: watch_func (mainloop.c:105)
   by 0x4C72694: g_main_context_dispatch (gmain.c:2539)
   by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146)
   by 0x4C72DC1: g_main_loop_run (gmain.c:3340)
   by 0x120541: main (main.c:551)
 Address 0x5bbcd90 is 16 bytes inside a block of size 24 free'd
   at 0x4A079AE: free (vg_replace_malloc.c:427)
   by 0x4C7837E: g_free (gmem.c:252)
   by 0x4F708BF: dbus_watch_set_data (dbus-watch.c:614)
   by 0x4F70938: _dbus_watch_unref (dbus-watch.c:132)
   by 0x4F6E9A7: _dbus_transport_handle_watch (dbus-transport.c:884)
   by 0x4F59AFB: _dbus_connection_handle_watch (dbus-connection.c:1497)
   by 0x4F70AF9: dbus_watch_handle (dbus-watch.c:683)
   by 0x121084: watch_func (mainloop.c:103)
   by 0x4C72694: g_main_context_dispatch (gmain.c:2539)
   by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146)
   by 0x4C72DC1: g_main_loop_run (gmain.c:3340)
   by 0x120541: main (main.c:551)
2014-09-08 05:48:48 +02:00
Luiz Augusto von Dentz
08e673050a gdbus: Fix crash when calling g_dbus_add_service_watch
If g_dbus_add_service_watch is called for service which bus name is
already known the following crash can happen:

invalid read of size 1
  at 0x4C2A2F2: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0x4E97722: g_strdup (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x405B0C: update_name_cache (watch.c:435)
  by 0x405C37: update_service (watch.c:593)
  by 0x4E7A2A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E7A627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E7AA39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4038EA: client_ready (test-gdbus-client.c:1014)
  by 0x4E9E5E0: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E9E7A5: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E9EB1A: g_test_run_suite (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x403614: main (test-gdbus-client.c:1058)
Address 0x5dbe5d0 is 0 bytes inside a block of size 7 free'd
  at 0x4C28577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0x4E7FF7E: g_free (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x405B04: update_name_cache (watch.c:434)
  by 0x405C37: update_service (watch.c:593)
  by 0x4E7A2A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E7A627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E7AA39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4038EA: client_ready (test-gdbus-client.c:1014)
  by 0x4E9E5E0: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E9E7A5: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x4E9EB1A: g_test_run_suite (in /usr/lib64/libglib-2.0.so.0.3800.2)
  by 0x403614: main (test-gdbus-client.c:1058)
2014-09-08 05:48:48 +02:00
Luiz Augusto von Dentz
1b1b1861ab Revert "gdbus: Don't include just added interfaces in GetManagedObjects"
This actually creates a problem since the code now does flush any pending
message on the queue any signal will be send right away before the
actual reply to GetManagedObjects which will not contain those interfaces.
2014-09-08 05:48:48 +02:00
Andrei Emeltchenko
8a4c29ca74 gdbus: Fix use after free
Refactor filter_data_remove_callback so that we do not iterate over
freed pointer.
2014-09-08 05:48:48 +02:00
Claudio Takahasi
9aeea028ed gdbus: Avoid reporting GDBusClient disconnect twice
No matter if disconnection was reported previously, g_dbus_client_unref()
was always calling service disconnect callback. This patch fix the
following scenario:
1) service disconnects from the bus
2) disconnect callback gets called
3) client calls g_dbus_client_unref(), disconnect callback is called
   again.
2014-09-08 05:48:48 +02:00
Tommi Kenakkala
0adfefa0c4 Merge pull request #250 from tkenakka/gprs
[rilmodem] Gprs fake timer fixes
2014-09-05 12:22:21 +03:00
Tommi Kenakkala
7c8db19341 Merge pull request #249 from jpoutiai/master
[RILMODEM] fix sim mem leak and code cleaning
2014-09-02 13:35:16 +03:00
Jarko Poutiainen
37ec5f9221 [RILMODEM] fix sim mem leak and code cleaning
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-09-02 13:31:45 +03:00
Tommi Kenakkala
d2d6f57b5f [rilmodem] Gprs fake timer fixes
Fixes timer cancelation logic and a mem leak on timer
callback data cleanup.
2014-09-02 13:23:42 +03:00
Tommi Kenakkala
6a272bf700 Merge pull request #248 from tkenakka/leakfixes
Mem leak fixes
2014-09-01 14:15:43 +03:00
Tommi Kenakkala
e1c8e2e2dc [rilmodem] Call fwd mem leak fix
Signed-off-by: Tommi Kenakkala <tommi.kenakkala@oss.tieto.com>
2014-09-01 13:10:54 +03:00
Tommi Kenakkala
5fb138dc13 [rilmodem] Nw selection mem leak fix
Signed-off-by: Tommi Kenakkala <tommi.kenakkala@oss.tieto.com>
2014-09-01 12:14:48 +03:00
Tommi Kenakkala
e2790ae176 Merge pull request #247 from tkenakka/leak
Fix rilmodem memory leaks
2014-08-29 10:10:01 +03:00
Tommi Kenakkala
516700c84c [rilmodem] Fix supplementary service mem leak
Signed-off-by: Tommi Kenakkala <tommi.kenakkala@oss.tieto.com>
2014-08-28 14:32:42 +03:00
Tommi Kenakkala
e23e6aceae [rilmodem] Fix ussd mem leaks
Signed-off-by: Tommi Kenakkala <tommi.kenakkala@oss.tieto.com>
2014-08-28 14:31:34 +03:00
Tommi Kenakkala
0532e2a6ea [rilmodem] Fix stk mem leaks 2014-08-28 14:31:11 +03:00
Tommi Kenakkala
ce2f0f3642 Merge pull request #246 from tkenakka/leaksms
[rilmodem] Mem leak fixes to sms sending and receiving
2014-08-27 14:34:52 +03:00
Tommi Kenakkala
0400b250c9 [rilmodem] Mem leak fixes to sms sending and receiving
Signed-off-by: Tommi Kenakkala <tommi.kenakkala@oss.tieto.com>
2014-08-27 12:39:37 +03:00
Tommi Kenakkala
bfcad4f346 Merge pull request #245 from tkenakka/master
Minor code cleanup
2014-08-27 09:32:30 +03:00
Tommi Kenakkala
9d49e2cee1 [rilmodem] Updated devinfo comments
Signed-off-by: Tommi Kenakkala <tommi.kenakkala@oss.tieto.com>
2014-08-26 11:05:15 +03:00
Tommi Kenakkala
c99e70f97a [rilmodem] Minor phonebook code cleanup
Signed-off-by: Tommi Kenakkala <tommi.kenakkala@oss.tieto.com>
2014-08-26 11:05:06 +03:00
Tommi Kenakkala
edc0035d18 Merge pull request #244 from jpoutiai/master
Fix memory leaks in sms and phonebook
2014-08-25 14:19:08 +03:00
Jarko Poutiainen
121f308cdb [RILMODEM] fix memory leak in sms sca query
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-08-25 10:58:26 +03:00
Jarko Poutiainen
2fcf1aee03 [RILMODEM] fix phonebook memory leaks
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-08-25 10:57:08 +03:00
Tommi Kenakkala
a14ebf50e0 Merge pull request #243 from jpoutiai/master
[RILMODEM] return failure to manufacturer and model queries
2014-08-25 10:24:59 +03:00
Jarko Poutiainen
1b0d419355 [RILMODEM] return failure to manufacturer and model queries
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-08-21 09:25:36 +03:00
Tommi Kenakkala
43f444db00 Merge pull request #242 from tigeli/master
[gprs] limit internet interface MTU by 1280
2014-08-14 09:42:10 +03:00
Pasi Sjöholm
1eb6243bc9 [gprs] limit internet interface MTU by 1280 2014-08-14 09:30:46 +03:00
Tommi Kenakkala
6ed50ecab7 Merge pull request #241 from jpoutiai/master
[RILMODEM] PB crash fix
2014-08-08 15:38:05 +03:00
Jarko Poutiainen
17ddc04788 [RILMODEM] PB crash fix add logging
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-08-08 10:26:27 +03:00
Jarko Poutiainen
4fd3c6386a [RILMODEM] PB crash fix
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-08-07 15:13:37 +03:00
Jarko Poutiainen
a069557b27 Merge pull request #240 from monich/data_calls
Fixed a problem with multiple data calls
2014-08-05 12:49:49 +03:00
Tommi Kenakkala
da81a85578 Merge pull request #239 from monich/warnings
Fixed compilation warnings
2014-08-04 15:17:11 +03:00
Denis Kenzior
22e892a22e build: Avoid warnings about _FORTIFY_SOURCE
Gentoo (and others) define _FORTIFY_SOURCE=2 by default.  We redefine
it, resulting in an error / configure failure.
2014-08-01 09:29:40 -05:00
Slava Monich
79e18f9d77 [ofono] Fixed a problem with multiple data calls
When two contexts were active simultaneously, deactivating one of them
would mark the second one as disconnected although its data call would
actually remain active.
2014-07-21 13:46:49 +03:00
Slava Monich
38f4886a97 Fixed compilation warnings 2014-07-21 13:43:50 +03:00
Denis Kenzior
361eed7b9a ublox: Minor style cleanup 2014-07-08 08:58:48 -05:00
Denis Kenzior
864efe1add ublox: Remove unneeded VENDOR flags
devinfo and netreg atoms don't use vendor specific behavior
2014-07-08 08:56:55 -05:00
Philip Paeps
0d8a06af30 plugins: new driver for u-blox SARA-U270 modems
This driver may also work (perhaps with more or less trivial changes)
with other u-blox modems (SARA, LISA, LEON) but this hasn't been tested.
2014-07-08 08:53:13 -05:00
Philip Paeps
293c701e25 atmodem: set the auth method for u-blox modems 2014-07-08 08:52:25 -05:00
Philip Paeps
cca3e085b3 sim: query u-blox PIN retries with AT+UPINCNT 2014-07-08 08:51:54 -05:00
Philip Paeps
7f29608feb udevng: add detection logic for u-blox modems 2014-07-08 08:50:20 -05:00
Denis Kenzior
1f3e30f1ba quectel: Minor style cleanup 2014-07-08 08:44:21 -05:00
Denis Kenzior
7ab4034bf4 quectel: Remove unneeded VENDOR flags
Only the sim atom has QUECTEL specific code
2014-07-08 08:43:01 -05:00
Philip Paeps
bb1984cabb plugins: add a new driver for Quectel UC15 modems 2014-07-08 08:42:05 -05:00
Philip Paeps
6df64cd1a9 gprs: add support for u-blox +UREG URCs 2014-06-30 14:03:08 -05:00
Philip Paeps
4a0831bc80 atmodem: add vendor u-blox 2014-06-30 13:59:46 -05:00
Denis Kenzior
b2bfdd69d2 atmodem: Minor style fixups 2014-06-30 13:44:40 -05:00
Philip Paeps
1588e7c082 sim: query Quectel UC15 PIN retries with AT+QPINC? 2014-06-30 13:35:19 -05:00
Philip Paeps
5cffd8af95 udevng: add detection logic for Quectel modems 2014-06-30 13:26:51 -05:00
Philip Paeps
d2f6ffc18d atmodem: add vendor Quectel 2014-06-30 13:26:25 -05:00
Sergio Checa Blanco
6369cc902c hfpmodem: Fix crash with more than two calls
A periodic CLCC polling is started when there is an ongoing multiparty
call and a new call appears in the system. A simple way to reproduce
the crashing scenario is:

1. Place a call.
2. Place a second call.
3. Create a multiparty call with both calls.
4. Place a third call (incoming or outgoing does not matter).
5. Disconnect HFP from the modem.

Within the function ciev_callheld_notify, the AT+CLCC command is also
invoked, thus a new cyclic CLCC polling is started, and it overwrites
the timer resource identifier stored in voicecall_data.clcc_source.
This means that there are several timers doing the CLCC polling, but
only one of those is under control, i.e. it can be removed through its
source identifier, hence a timer source leak.

This has a fatal consequence when the HFP modem is disconnected. The
function hfp_voicecall_remove stops the timer that is under control
before freeing the voicecall_data struct. However there are other timers
that are still active and will execute its handler poll_clcc afterwards.
Inside poll_clcc the driver_data is accessed, which is already NULL.

A solution for this is to avoid starting a CLCC polling if there is
already one active, i.e. clcc_source is not 0. By doing this the
uncontrolled timers will not cycle forever.
2014-06-30 13:22:10 -05:00
Marcel Holtmann
d05b718cc0 Release 1.15 2014-06-29 22:20:08 +02:00
Tommi Kenakkala
b154268fd9 Merge pull request #238 from tkenakka/merge1.14part
Merge upstream ofono 1.14 changes up to 9bbc986
2014-06-26 16:41:59 +03:00
Tommi Kenakkala
cb3a89a702 Merge remote-tracking branch 'martti/merge1.14' into merge1.14part 2014-06-26 13:58:35 +03:00
Tommi Kenakkala
133d92f265 Merge pull request #236 from special/master
[ofono] Encode SMS as UTF-16 instead of UCS-2
2014-06-26 08:56:29 +03:00
Philip Paeps
c144fadca6 gprs: provision the authentication method 2014-06-24 12:46:18 -05:00
Philip Paeps
532e8020e5 mbpi: add support for provisioning the auth method
Use the authentication method from the mobile-broadband-provider-info
database if it is specified and supported (we support CHAP and PAP).
Default to CHAP if the database does not specify a method (i.e.: the
previous behaviour).
2014-06-24 12:46:18 -05:00
Philip Paeps
310915429b include: add auth method to the provisioning API 2014-06-24 12:46:18 -05:00
Tommi Kenakkala
ad6fd49dbc Merge pull request #237 from martinjones/cfu_change
[ofono] Fix call forwarding unconditional change signal emission.
Wrong property names signalled for conditional call forwarding types when status of unconditional type changed.
2014-06-24 14:01:06 +03:00
Denis Kenzior
9285ec0d89 AUTHORS: Mention Philip's contributions 2014-06-21 12:05:43 -05:00
Philip Paeps
8cbe061c3b atmodem: set the PPP authentication method to use 2014-06-21 12:02:51 -05:00
Denis Kenzior
3e13676766 gprs: Make the code a bit easier to read 2014-06-21 12:02:05 -05:00
Philip Paeps
73831c3d76 gprs: make PPP authentication method configurable
Add a new "AuthenticationMethod" property to select between "pap"
and "chap" PPP authentication, defaulting to "chap" (i.e.: previous
behaviour).
2014-06-21 11:58:03 -05:00
Philip Paeps
7011dcdf2f include: add auth method to the gprs context API 2014-06-21 11:55:30 -05:00
Philip Paeps
f6341502c8 doc: describe the AuthenticationMethod property 2014-06-21 11:55:03 -05:00
Denis Kenzior
8edaaaf210 gatchat: Fix up minor coding style issues 2014-06-21 11:54:26 -05:00
Philip Paeps
a88662d23c gatchat: implement PAP authentication
Make the authentication method configurable, CHAP or PAP, defaulting to
CHAP (i.e.: previous behaviour).

Implementation details:

 o If PAP is configured, we NAK the CHAP authentication protocol option
   in LCP configuration requests and suggest PAP instead.  This works
   around the amusing requirement of 3GPP TS 29.061 that modems must
   send a forced positive acknowledgement of the authentication method
   tried (i.e.: the modem will successfully accept any CHAP handshake,
   but if the network only supports PAP, the modem will hang up
   when it tries and fails to activate the PDP context)

 o The PAP Authenticate-Request is resent a hard-coded three times at
   ten-second intervals.  This may be a bit too persistent.  Chances
   are if it doesn't work the first time, it'll never work, but the
   RFC insists that we MUST retry.
2014-06-21 11:50:34 -05:00
Denis Kenzior
1dd8580930 AUTHORS: Mention Sergio's contributions 2014-06-21 11:46:28 -05:00
Sergio Checa Blanco
65be2b344c hfpmodem: Split AT+VTS command into multiple +VTS
According to the standard "3GPP 27.007 v6.8.0" Appendix C.2.11,
when sending multiple DTMF characters, these must go in individual
+VTS commands for each tone. This adopts the AT modem approach.

Before: AT+VTS=1234\r
After:  AT+VTS=1;+VTS=2;+VTS=3;+VTS=4\r
2014-06-21 11:45:44 -05:00
Martin Jones
888e857779 [ofono] Fix call forwarding unconditional change signal emission.
When toggling cfu the change signals for the other types didn't have the
prefix applied.
2014-06-20 02:01:37 +00:00
Tommi Kenakkala
e189cd138b Merge pull request #235 from jpoutiai/sms-on-sim
[RILMODEM] initial support to read and delete sms from sim (class2, voicemail mwi)
2014-06-18 16:21:14 +03:00
John Brooks
6b8b5d29a1 [ofono] Encode SMS as UTF-16 instead of UCS-2
UCS-2 is an older 16-bit encoding compatible with the unicode BMP.
UTF-16 extends UCS-2 to add support for surrogate pairs and the rest of
the unicode set. All valid UCS-2 text is also valid UTF-16 text, and all
UTF-16 text not containing surrogate pairs is valid UCS-2.

We decode incoming SMS as UTF-16 instead of UCS-2 to add support for
these extended characters. We should do the same for encoding outgoing
SMS messages.
2014-06-18 06:04:38 -06:00
Jarko Poutiainen
960ef29014 [RILMODEM] removing unnecessary empty lines and null check
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-06-17 15:14:10 +03:00
Jarko Poutiainen
30f3dd2c53 [RILMODEM] change cb_data_new2 to abort in failure
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-06-17 15:13:49 +03:00
Jarko Poutiainen
feb1126123 [RILMODEM] initial support to read and delete sms from sim
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-06-17 11:57:44 +03:00
Tommi Kenakkala
420651829a Merge pull request #234 from mkuukkane/remove-dundee
Remove dundee from ofono compilation.
2014-06-16 12:32:05 +03:00
Jarko Poutiainen
0835875b65 Merge pull request #233 from tkenakka/netregfix
[rilmodem] Null netreg pointer on netreg remove
2014-06-13 15:00:28 +03:00
Tommi Kenakkala
153599eb70 [rilmodem] Null netreg pointer on netreg remove
Netreg driver has a static copy of the netreg pointer.
Missing NULLing may cause problems on corner cases after
netreg is freed (when core atom is flushed).

Signed-off-by: Tommi Kenakkala <tommi.kenakkala@oss.tieto.com>
2014-06-13 10:52:24 +03:00
Marko Kuukkanen
fafef8bfd3 [ofono] Remove dundee (service) 2014-06-12 10:40:27 +03:00
Alfonso Sanchez-Beato
62c34467a2 test: Adapt data test scripts to multi-modem
Some tests scripts were not ready to handle situations with more than
one modem present. This change fixes the data context scripts.
2014-06-10 23:36:09 -05:00
Alfonso Sanchez-Beato
d9f252fb61 test: Adapt voice call test scripts to multi-modem
Some tests scripts were not ready to handle situations with more than
one modem present. This change fixes the scripts that handle voice
calls.
2014-06-10 23:23:51 -05:00
Jarko Poutiainen
3bce306f6e Merge pull request #231 from jpoutiai/gprs
[RILMODEM] gprs set detach notified only for callback
2014-06-09 10:14:00 +03:00
Tommi Kenakkala
68767f6ea2 Merge pull request #232 from mkuukkane/ussd
[rilmodem] Don't send <CR> with USSD string
2014-06-06 15:05:58 +03:00
Marko Kuukkanen
a3cd7b0898 [rilmodem] Don't send <CR> with USSD string 2014-06-06 15:00:04 +03:00
Jarko Poutiainen
d0364f89cd [RILMODEM] gprs set detach notified only for callback
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-06-05 15:05:58 +03:00
Jarko Poutiainen
9aa8375233 Merge pull request #230 from martinjones/master
[voicecall] Cancel pending DTMF tones before hanging up call.
2014-06-04 12:57:54 +03:00
Martin Jones
77b3adfd60 [voicecall] Cancel pending DTMF tones before hanging up call. 2014-06-04 09:27:43 +00:00
Marko Kuukkanen
b4bb7e72d8 Merge pull request #229 from mkuukkane/transfer
Explicit call transfer rilmodem implementation
2014-06-02 14:23:45 +03:00
Marko Kuukkanen
8e20975660 [rilmodem] Explicit call transfer driver implementation 2014-06-02 08:39:55 +03:00
Marko Kuukkanen
0e8a53bdf0 [test] Add test script for explicit call transfer 2014-06-02 08:38:31 +03:00
Denis Kenzior
815d62888f hfp: Fix case where RING never arrives 2014-05-30 12:25:23 -05:00
Jarko Poutiainen
9a29fdde06 Merge pull request #228 from jpoutiai/master
Refactoring rilmodem gprs implementation
2014-05-30 14:09:37 +03:00
Jarko Poutiainen
269fa3db0e [RILMODEM] fake also roaming
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-05-27 12:42:56 +03:00
Jarko Poutiainen
64dab08751 [RILMODEM] code review and checkpatch cleaning
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-05-27 12:39:50 +03:00
Jarko Poutiainen
7a72726d9a [RILMODEM] code review and checkpatch cleaning
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-05-27 12:39:39 +03:00
Jarko Poutiainen
b6fb89c3a0 [RILMODEM] refactor gprs-context driver
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-05-26 11:17:34 +03:00
Jarko Poutiainen
d51d858cd6 [RILMODEM] refactor gprs driver
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-05-26 11:17:15 +03:00
Tommi Kenakkala
24d1be80c5 Merge pull request #227 from tkenakka/logging
[rilmodem] Improve ril.c logging
2014-05-26 09:23:03 +03:00
Tommi Kenakkala
19c2a6fc64 [rilmodem] Improve ril.c logging
Signed-off-by: Tommi Kenakkala <tommi.kenakkala@oss.tieto.com>
2014-05-23 23:58:41 +03:00
Denis Kenzior
35feae07e5 hfp: Use proper prefix
Otherwise the BCS command can consume unsolicited notifications.

ofonod[3270]: < \r\n+BCS: 2\r\n
ofonod[3270]: > AT+BCS=2\r
ofonod[3270]: < \r\n+CIEV: 1,1\r\n
ofonod[3270]: < \r\n+CIEV: 2,0\r\n
ofonod[3270]: < \r\nOK\r\n
2014-05-21 12:08:37 -05:00
Martti Piirainen
6e3236b739 Merge pull request #226 from jpoutiai/master
more default logging
2014-05-20 14:21:43 +03:00
Martti Piirainen
22b20efdc4 [test] Port remaining test scripts to Python3 2014-05-20 12:01:32 +03:00
Martti Piirainen
ce1ed053fd [rpm] Make test scripts depend on Python3 2014-05-20 11:22:13 +03:00
Martti Piirainen
e9d562e4a3 Merge branch 'ofono1.14' into merge1.14
Conflicts:
	ofono/test/test-ss-control-cb
	ofono/unit/test-simutil.c
2014-05-20 11:21:19 +03:00
Jarko Poutiainen
e5223ac8af [RILMODEM] add more logging
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-05-19 10:28:18 +03:00
Jarko Poutiainen
9505b6baf3 [RILMODEM] add more logging
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-05-19 10:28:04 +03:00
Jarko Poutiainen
4c268731b9 [RILMODEM] add more logging
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-05-19 10:27:50 +03:00
Martti Piirainen
5b158c3a28 Merge pull request #224 from jpoutiai/master
[RILMODEM] prevent ofono crash when sim removed while reading
2014-05-19 09:51:34 +03:00
Tommi Kenakkala
9745d202d3 Merge pull request #225 from marttipiirainen/nettime
Fix crash in network time plugin
2014-05-15 14:15:10 +03:00
Martti Piirainen
2329468e25 [nettime] Prevent crash if MNC or MCC is missing 2014-05-15 07:36:07 +03:00
Martti Piirainen
2b352aedb4 [nettime] Export test script to .rpm 2014-05-15 07:21:07 +03:00
Jarko Poutiainen
b319c77bcc [RILMODEM] prevent ofono crash when sim removed while reading
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-05-14 14:08:21 +03:00
Martti Piirainen
4b95656d72 Merge pull request #223 from jpoutiai/master
[RILMODEM] hardening phonebook driver implementation
2014-05-14 13:57:51 +03:00
Jarko Poutiainen
b3dc0d0146 [RILMODEM] hardening phonebook driver implementation
Signed-off-by: Jarko Poutiainen <Jarko.Poutiainen@oss.tieto.com>
2014-05-12 15:08:28 +03:00
Andrew Earl
9bbc98651f handsfree: correct crash on connect of hfp 2014-04-22 13:10:32 -05:00
Denis Kenzior
516165c311 handsfree: Rename driver function
To be more consistent with others in the same file
2014-04-10 10:04:36 -05:00
Denis Kenzior
b37f5e842d handsfree: Simplify logic 2014-04-10 10:04:12 -05:00
Andrew Earl
e7f055385f hfp: Add CNUM query to handsfree interface for subscriber number 2014-04-10 09:52:11 -05:00
Denis Kenzior
8cfcfa4519 handsfree: Rename variable 2014-04-10 09:43:47 -05:00
Denis Kenzior
ca3ae87d0a handsfree: Reflow logic 2014-04-10 09:43:44 -05:00
Denis Kenzior
02138901d3 handsfree: Remove function
No need for one line functions that are only used once
2014-04-10 09:43:41 -05:00
Denis Kenzior
24e87d2580 handsfree: Rename function
No need for the ofono_ prefix here
2014-04-10 09:31:58 -05:00
Denis Kenzior
057c4d788f handsfree: Remove unneeded variable 2014-04-10 09:29:32 -05:00
Denis Kenzior
805c3068be handsfree: Remove unneeded variable i 2014-04-10 09:29:11 -05:00
Denis Kenzior
eb4fd9f5aa handsfree: style fixes for previous commit 2014-04-10 09:25:30 -05:00
Andrew Earl
8327d528a9 hfp: Add subscriber number to handsfree properties 2014-04-10 09:21:23 -05:00
Andrew Earl
7420d327e3 include: Add subscriber number to handsfree API 2014-04-10 09:18:15 -05:00
Andrew Earl
e589094113 doc: Add subscriber number to handsfree-api 2014-04-10 09:17:47 -05:00
Denis Kenzior
ca5b269002 AUTHORS: Mention Jussi's contributions 2014-03-27 09:51:49 -05:00
Denis Kenzior
910ec60927 phonesim: Fixup whitespace 2014-03-27 09:51:49 -05:00
Jussi Pakkanen
5f76525961 phonesim: Add conf file override
OFONO_PHONESIM_CONFIG allows the configuration file location to be
overriden from the default $CONFIGDIR/phonesim.conf (typically /etc)
2014-03-27 09:51:49 -05:00
Claudio Takahasi
6fdcfc309c gdbus: Add g_dbus_proxy_set_property_array
This patch adds a new gdbus utility function to allow setting a property
of fixed, and non-fixed values array.
2014-03-24 14:27:51 -07:00
Denis Kenzior
4585969568 he910: Fix unused variable warning
plugins/he910.c: In function ‘qss_query_cb’:
plugins/he910.c:174:21: error: unused variable ‘data’
[-Werror=unused-variable]
2014-03-20 12:55:20 -05:00
Denis Kenzior
f8819b588b he910: Switch to permissive parser
Seems the CCFC implementation on Telit firmware is not v.250 compliant:
ofonod[445]: Aux: > AT+CCFC=0,2\r
ofonod[445]: Aux: < \r\n\r\n+CCFC:0,7\r\n\r\nOK\r\n
2014-03-19 10:30:10 -05:00
Denis Kenzior
c3f528908d he910: Fixup SIM detection
In certain cases the #QSS notification is never sent, or sent too early.
Make sure that we enable #QSS notification only after the modem has been
set as powered.  Also make sure that we explicitly query #QSS in case we
missed the earlier #QSS notification.
2014-03-19 10:30:05 -05:00
Denis Kenzior
29fefe6450 hfp: Use enum from hfp.h 2014-03-19 10:24:57 -05:00
Denis Kenzior
65e6df8e50 hfp: Fixup variable names 2014-03-19 10:20:28 -05:00
Krzysztof Wilk
8a7b8b0521 hfp: Add CHLD features to drver data 2014-03-19 10:19:53 -05:00
Denis Kenzior
5705a0078e handsfree: Fixup variable names 2014-03-19 10:19:35 -05:00
Krzysztof Wilk
b2b3943717 hfp: extend Features to three way calling and CHLD 2014-03-19 10:15:55 -05:00
Krzysztof Wilk
6b8f46a916 include: Declaration function to set CHLD features 2014-03-19 10:13:15 -05:00
Krzysztof Wilk
2e78ea1830 hfp: Define hfp_ag_chld_feature 2014-03-19 10:12:16 -05:00
Krzysztof Wilk
dafbd0da25 doc: Extend Features property 2014-03-19 10:11:40 -05:00
Denis Kenzior
13ce99e360 AUTHORS: Mention Alfonso's contributions 2014-03-14 12:24:54 -05:00
Alfonso Sanchez-Beato
352e3ebb76 unit: Fix test to use valid EF_PNN
test-simutil was not using EF_PNN files with a valid format.
2014-03-14 12:24:26 -05:00
Alfonso Sanchez-Beato
46de4df677 simutil: Fix EF_PNN access
EF_PNN was not being read properly (see TS 24.008, section 10.5.3.5a,
for network names format), which affected the displayed PLMN name for
some MVNOs. Some modems already read the file and return the right
string: these do not show the problem.
2014-03-14 12:24:26 -05:00
Denis Kenzior
6a96eea978 stktest: Remove some unneeded output 2014-03-14 10:32:32 -05:00
Denis Kenzior
ebe25412a4 test: Make sure test-stk-menu works with python3 2014-03-14 10:32:06 -05:00
Denis Kenzior
c94c4fad54 AUTHORS: Mention Martin's contributions 2014-03-11 19:34:45 -05:00
Martin Pitt
c027ab9fbc test: Convert to Python 3
Change raw_input() to input() and unicode to str. This is *not*
compatible with Python 2. Update the hashbangs to run with Python 3.
2014-03-11 19:34:08 -05:00
Martin Pitt
ad4f90684f test: Move from static gobject bindings to GI
Use GLib gobject-introspection bindings so that we can also use the
scripts with Python 3.
2014-03-11 19:33:16 -05:00
Martin Pitt
5bf5cf8ddd test: Replace obsolete has_key() with "in"
In order to also work with Python 3
2014-03-11 19:33:04 -05:00
Martin Pitt
0393a41e35 test: Make exceptions compatible with Python 3
Use "except Type as var" syntax to work with both Python >= 2.6
and Python 3.
2014-03-11 19:32:46 -05:00
Martin Pitt
0c1fcd2b50 test: Make print calls compatible with Python 3
Turn print calls into print() function calls and avoid using
comma-separated arguments, so that they work and look the same with
both Python 2 and 3.
2014-03-11 19:32:18 -05:00
Denis Kenzior
c54e4763f8 he910: Fix whitespace 2014-03-10 11:53:22 -05:00
Claudio Takahasi
ea2b34eacd gdbus: Add g_dbus_client_set_ready_watch()
This patch adds a new gdbus helper to notify the clients that
GetManagedObjects reply was received and the last proxy has been
informed previously by the proxy_added callback.
2014-03-06 09:36:48 -08:00
Denis Kenzior
472e6650d4 AUTHORS: Mention Tony's contributions 2014-03-05 08:51:06 -06:00
Tony Espy
201d34b0a1 idmap: use UL for bitshift literals
The current bitshift logic in idmap incorrectly uses
the literal 1 for the value to shift in idmap_alloc(),
idmap_take(), and idmap_alloc_next().  This causes the
resulting value to be an int instead of a long, which
results in the wrong bit being set once the number of
bits to shift operand exceeds sizeof(int).  Also
on some platforms, the behavior of the left bitshift
operator is undefined when this overflow occurs.
2014-03-05 08:49:50 -06:00
Luiz Augusto von Dentz
76a7f9014d gdbus: Replace g_timeout_add with g_idle_add
Passing 0 as timeout to g_timeout_add should equivalent to g_idle_add.
2014-02-18 23:13:53 -08:00
Anderson Lizardo
29401d8587 gdbus: Fix incorrect DBusConnection reference counting
Commit abfc2b0dd5c3e33abfdf1a815b16d492c1751c06 attempted to fix a crash
related to improper reference counting, but the main issue was that the
reference was taken only during the function call (which is usually
unnecessary for single thread), but still passed a pointer to
DBusConnection to a function that is called by the mainloop. This left a
window where the DBusConnection can be destroyed.

Fixes this crash on unit/test-gdbus-client:

==32642== Invalid read of size 4
==32642==    at 0x690D0A6: dbus_connection_ref (in
/lib/i386-linux-gnu/libdbus-1.so.3.7.6)
==32642==    by 0x804CEDB: message_dispatch (mainloop.c:73)
==32642==    by 0x684580E: g_timeout_dispatch (gmain.c:4450)
==32642==    by 0x6844A75: g_main_context_dispatch (gmain.c:3065)
==32642==    by 0x6844E14: g_main_context_iterate.isra.23 (gmain.c:3712)
==32642==    by 0x68452FA: g_main_loop_run (gmain.c:3906)
==32642==    by 0x804C7D3: client_connect_disconnect
(test-gdbus-client.c:188)
==32642==    by 0x6868DB2: g_test_run_suite_internal (gtestutils.c:2067)
==32642==    by 0x6868F8D: g_test_run_suite_internal (gtestutils.c:2138)
==32642==    by 0x6869320: g_test_run_suite (gtestutils.c:2189)
==32642==    by 0x686936B: g_test_run (gtestutils.c:1508)
==32642==    by 0x696D4D2: (below main) (libc-start.c:226)
==32642==  Address 0x709c6e4 is 140 bytes inside a block of size 144
free'd
==32642==    at 0x67E806C: free (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==32642==    by 0x692D62E: dbus_free (in
/lib/i386-linux-gnu/libdbus-1.so.3.7.6)
==32642==    by 0x690E1C2: ??? (in
/lib/i386-linux-gnu/libdbus-1.so.3.7.6)
==32642==    by 0x804AAEC: destroy_context (test-gdbus-client.c:104)
==32642==    by 0x6868DB2: g_test_run_suite_internal (gtestutils.c:2067)
==32642==    by 0x6868F8D: g_test_run_suite_internal (gtestutils.c:2138)
==32642==    by 0x6869320: g_test_run_suite (gtestutils.c:2189)
==32642==    by 0x686936B: g_test_run (gtestutils.c:1508)
==32642==    by 0x696D4D2: (below main) (libc-start.c:226)
2014-02-18 23:13:53 -08:00
Anderson Lizardo
90abd44ead gdbus: Fix memory leak
data->conn and data->path must be destroyed before freeing "data".
2014-02-18 23:13:53 -08:00
Slava Monich
278dba2ec8 mbpi: Pop subparser stack after mmsc and mmsproxy 2014-02-07 08:56:44 -06:00
Marcel Holtmann
f83233d295 gatchat: Fix handling of WRITE_SCHEDULER_DEBUG 2014-01-19 16:48:04 -08:00
Slava Monich
c2e58405ee include: Be more const-correct in ofono_dbus_* 2014-01-13 10:19:54 -06:00
587 changed files with 80426 additions and 15793 deletions

61
.gitignore vendored
View File

@@ -1,61 +0,0 @@
*.o
*.lo
*.la
.deps
.libs
.dirstamp
Makefile
Makefile.in
aclocal.m4
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
depcomp
compile
install-sh
libtool
ltmain.sh
missing
stamp-h1
autom4te.cache
test-driver
test-suite.log
ofono.pc
include/ofono
include/version.h
src/builtin.h
src/ofonod
src/ofono.service
dundee/dundee
dundee/dundee.service
unit/test-common
unit/test-util
unit/test-idmap
unit/test-sms
unit/test-sms-root
unit/test-simutil
unit/test-mux
unit/test-caif
unit/test-stkutil
unit/test-cdmasms
unit/test-*.log
unit/test-*.trs
tools/huawei-audio
tools/auto-enable
tools/get-location
tools/lookup-apn
tools/lookup-provider-name
tools/tty-redirector
tools/qmi
tools/stktest
gatchat/gsmdial
gatchat/test-server
gatchat/test-qcdm

View File

@@ -1,7 +0,0 @@
Luiz Augusto von Dentz <luiz.dentz-von@nokia.com> <luiz.dentz-von@nokia.com>
Zhenhua Zhang <zhenhua.zhang@intel.com> <zhenhua.zhang@intel.com>
Pekka Pessi <pekka.pessi@nokia.com> <Pekka.Pessi@nokia.com>
Pekka Pessi <pekka.pessi@nokia.com> <ppessi@hamsa.research.nokia.com>
Lasse Kunnasluoto <lasse.kunnasluoto@tieto.com> <Lasse.Kunnasluoto@tieto.com>
Syam Sidhardhan <s.syam@samsung.com> <syamsidhardh@gmail.com>
Michael Dietrich <mdt@emdete.de> <mdt@emdete.de>

49
ofono/.gitignore vendored
View File

@@ -9,7 +9,7 @@ Makefile.in
aclocal.m4
config.guess
config.h
config.h.in
config.h.in*
config.log
config.status
config.sub
@@ -32,6 +32,8 @@ src/ofono.service
dundee/dundee
dundee/dundee.service
test-driver
test-suite.log
unit/test-common
unit/test-util
unit/test-idmap
@@ -40,8 +42,53 @@ unit/test-sms-root
unit/test-simutil
unit/test-mux
unit/test-caif
unit/test-cell-info
unit/test-cell-info-control
unit/test-cell-info-dbus
unit/test-stkutil
unit/test-cdmasms
unit/test-conf
unit/test-dbus-access
unit/test-dbus-clients
unit/test-dbus-queue
unit/test-gprs-filter
unit/test-ril_config
unit/test-ril_ecclist
unit/test-ril_util
unit/test-ril_vendor
unit/test-ril-transport
unit/test-rilmodem-cb
unit/test-rilmodem-cs
unit/test-rilmodem-gprs
unit/test-rilmodem-sms
unit/test-sailfish_access
unit/test-slot-manager
unit/test-watch
unit/test-sim-info
unit/test-sim-info-dbus
unit/test-sms-filter
unit/test-voicecall-filter
unit/test-*.log
unit/test-*.trs
unit/test-mbim
unit/test-grilreply
unit/test-grilrequest
unit/test-grilunsol
unit/test-provision
unit/html
plugins/sailfish_manager/*.gcda
plugins/sailfish_manager/*.gcno
drivers/*/*.gcda
drivers/*/*.gcno
drivers/*/*.gcov
plugins/*/*.gcda
plugins/*/*.gcno
plugins/*/*.gcov
*/*.gcda
*/*.gcno
*/*.gcov
tools/huawei-audio
tools/auto-enable

View File

@@ -92,3 +92,52 @@ Jesper Larsen <jesper.larsen@ixonos.com>
Slava Monich <slava.monich@jolla.com>
Andrew Earl <andrewx.earl@intel.com>
Krzysztof Wilk <krzysztofx.wilk@intel.com>
Tony Espy <espy@canonical.com>
Martin Pitt <martin.pitt@ubuntu.com>
Alfonso Sanchez-Beato <alfonso.sanchez-beato@canonical.com>
Jussi Pakkanen <jussi.pakkanen@canonical.com>
Sergio Checa Blanco <sergio.checa@bmw-carit.de>
Philip Paeps <philip@paeps.cx>
Kuba Pawlak <kubax.t.pawlak@intel.com>
Tommi Kenakkala <tommi.kenakkala@tieto.com>
Alex J Lennon <ajlennon@dynamicdevices.co.uk>
Sergey Alirzaev <zl29ah@gmail.com>
Marko Sulejic <marko.sulejic@hale.at>
Johannes 'josch' Schauer <josch@mister-muffin.de>
Simon Fels <simon.fels@canonical.com>
John Ernberg <john.ernberg@actia.se>
Dongsu Park <dongsu@endocode.com>
Dragos Tatulea <dragos@endocode.com>
Samrat Guha Niyogi <samrat.guha.niyogi@intel.com>
Anirudh Gargi <anirudh.gargi@intel.com>
Nishanth V <nishanth.v@intel.com>
Antara Borwankar <antara.borwankar@gmail.com>
Martin Chaplet <m.chaplet@kerlink.fr>
Suman Mallela <suman.m@intel.com>
Rajagopal Aravindan <rajagopalx.aravindan@intel.com>
Ankit Navik <ankit.p.navik@intel.com>
Antoine Aubert <a.aubert@overkiz.com>
Djalal Harouni <djalal@endocode.com>
Christophe Ronco <c.ronco@kerlink.fr>
Vincent Cesson <vincent.cesson@smile.fr>
Piotr Haber <gluedig@gmail.com>
André Draszik <git@andred.net>
Lukasz Nowak <lnowak@tycoint.com>
Jonas Bonn <jonas@southpole.se>
Matthijs Kooijman <matthijs@stdin.nl>
Clayton Craft <clayton@craftyguy.net>
Joey Hewitt <joey@joeyhewitt.com>
Richard Röjfors <richard.rojfors@gmail.com>
Philippe De Swert <philippe.deswert@nomovok.com>
Gabriel Lucas <gabriel.lucas@smile.fr>
Mariem Cherif <mariem.cherif@ardia.com.tn>
Bassem Boubaker <bassem.boubaker@actia.fr>
Bob Ham <bob.ham@puri.sm>
Varun Gargi <varun.gargi@intel.com>
Florent Beillonnet <florent.beillonnet@gmail.com>
Martin Hundebøll <martin@geanix.com>
Julien Tournier <tournier.julien@gmail.com>
Nandini Rebello <nandini.rebello@intel.com>
Giacinto Cifelli <gciofono@gmail.com>
Khaled Romdhani <khaledromdhani216@gmail.com>
Pavel Machek <pavel@ucw.cz>

View File

@@ -1,3 +1,162 @@
ver 1.29:
Fix issue with QMI and SIM initialized notification.
Add support for multiple PDP contexts and xmm7xxx modems.
Add support for handling Dual SIM Single Active feature
Add support for SIM PIN caching feature.
ver 1.28:
Fix issue with SIM initialization and Gemalto modems.
ver 1.27:
Add support for handling SIMCom based SIM800 modems.
Add support for SIM lock state with xmm7xxx modems.
Add support for coexistence feature with xmm7xxx modems.
ver 1.26:
Fix issue with AT callback handler and GPRS.
Fix issue with handling EUTRAN SMS only states.
Fix issue with handling MBIM strings on big endian.
Fix issue with missing char and SMS national language.
Fix issue with unsolicited notifications of +CGAUTH/+CGDCONT.
Add support for setting "none" authentication method.
Add support for SMS and phonebook with xmm7xxx modems.
Add support for voice features and Gemalto modems.
Add support for Bengali and Gujrati SMS alphabets.
Add support for 8 additional languages for GSM 7 bit
Add support for using internal Embedded Linux library.
ver 1.25:
Fix issue with handling GPRS context release.
Fix issue with GPRS context shutdown and Huawei modems.
Fix issue with roaming status report and QMI devices.
Add support for voice call handling of U-Blox modems
Add support for EUTRAN technology reporting.
ver 1.24:
Fix issue with property changed signals and CDMA networks.
Fix issue with handling SIM filesystem and SIM removal.
Fix issue with handling PIN state and incorrect codes.
Fix issue with handling of parsing AID type.
Fix issue with SIM detection and QMI devices.
Fix issue with PIN handling and QMI devices.
Fix issue with USSD handling and QMI devices.
Fix issue with handling USSD TERMINATED response.
Fix issue with handling USSD reset and STK REFRESH.
Add support for detecting Gemalto ALS3 modems.
Add support for SIMCom based SIM7100E modems.
ver 1.23:
Fix issue with handling SIM AID sessions.
Add support for QMI LTE bearer handling.
Add support for memory location dialing.
ver 1.22:
Fix issue with GPIO handling and Nokia modems.
Fix issue with SIM state callback and AT modems.
Fix issue with data mode and DCD for U-Blox modems.
Fix issue with SMS receive on QMI based Quectel EC21.
Fix issue with HFP support and last call dialed request.
Fix issue with PIM retires handling and Gemalto modems.
Fix issue with atom registration and SIM state handling.
Add support for handling SIM card AID session management.
Add support for handling GSM/UMTS and IMS authentication.
Add support for IP Multimedia Subsystem (IMS) atom.
Add support for MBIM based modems.
ver 1.21:
Fix issue with USSD notification received handling.
Fix issue with crashing SIM filesystem notifications.
Fix issue with LTE bearer reporting and Huawei modems.
Fix issue with invalid memory access and QMI.
Add support for QMI SIM writing functionality.
Add support for RAT selection for QMI modems.
Add support for network monitor agent interface.
Add support for Cinterion Hardware Monitor interface.
Add support for LTE atom driver for Huawei modems.
Add support for LTE atom driver for AT modems.
Add support for Intel xmm7xxx series modems.
ver 1.20:
Fix issue with context removal before activation.
Fix issue with update during GPRS context activation.
Fix issue with receiving UTF-16 encoded messages.
Fix issue with invalid access in CBS decoding.
Fix issue with signal strength on QMI modems.
Fix issue with PIN handling with QMI modems.
Fix issue with QMI notification message handling.
Fix issue with facility lock query on SIM removal.
Fix issue with parsing +CLCC and +CCWA fields.
Add support for obtaining IMSI via EF reading.
Add support for additional netmon info types.
Add support for provisioning via configuration files.
Add support for Gemalto P-family series of modems.
Add support for Telit HE910 and UE910 variants.
Add support for Intel SoFIA SIM Toolkit interfaces.
Add support for Intel SoFIA LTE features.
Add support for U-Blox TOBY-L2 LTE feature.
Add support for dedicated LTE atom.
ver 1.19:
Fix issue with DHCP parsing and Huawei modems.
Fix issue with detecting Huawei E3372 modem.
Fix issue with handling serving cell info.
Fix issue with handling SIM SC facility lock.
Fix issue with Android RIL PIN retry logic.
Fix issue with Android RIL and RAT handling.
Add support for Android RIL cell broadcast.
Add support for SoFIA 3GR thermal management.
ver 1.18:
Fix issue with cell broadcast and use-after-fee.
Fix issue with repeated held call indicator.
Fix issue with +CCWA and connection setup.
Fix issue with empty operator scan results.
Fix issue with persistent RAT mode handling.
Fix issue with multiparty call introspection.
Fix issue with GRPS context introspection.
Fix issue with stale context deactivation.
Add support for automatic context activation.
Add support for SIM service provider names.
Add support for handling allowed APN lists.
Add support for network monitoring interface.
Add support for U-Blox TOBY-L2 modem series.
Add support for Sierra MC73xx QMI modems.
Add support for SoFIA 3GR modem series.
Add support for upower battery monitoring.
Add support for gateway audio card types.
Add support for Handsfree audio driver.
Add support for Android RIL integration.
ver 1.17:
Fix issue with alphanumeric TP-OA handling.
Fix issue with push notification origin port.
Fix issue with reading of EF_MWIS records.
Fix issue with handling AT+CPINR results.
Fix issue with SIM state polling for Sierra modems.
Fix issue with HFP handling and AT command prefixes.
Fix issue with HFP and extra CCWA event handling.
Fix issue with HFP call state and +CHUP errors.
ver 1.16:
Fix issue with PIN retry handling.
Fix issue with HFP and multiple calls.
Add support for Distracted Driving Reduction.
Add support for available technologies property.
Add support for Telit location reporting driver.
Add support for u-blox SARA-U270 modems.
Add support for Quectel UC15 modems.
ver 1.15:
Fix issue with EF_PNN access affecting PLMN display.
Fix issue with SIM detection and Telit HE910 modems.
Fix issue with Mobile Provider Database provisioning.
Fix issue with bit-shifting and ID mapping allocations.
Fix issue with Handsfree and unsolicited notifications.
Fix issue with Handsfree and three way calling feature.
Add support for Handsfree subscriber number feature.
Add support for Handsfree multiple DTMF characters.
Add support for PAP authentication.
ver 1.14:
Add support for Apple Siri specific Handsfree commands.
Add support for provisioning of MMSC and Message Proxy.

View File

@@ -113,3 +113,5 @@ doc/coding-style.txt.
a feature that touches files under 'include/', 'src/' and 'drivers/'
directories, split in three separated patches, taking care not to
break compilation.
4) Submit patches using git send-email to ofono@ofono.org

View File

@@ -21,8 +21,16 @@ pkginclude_HEADERS = include/log.h include/plugin.h include/history.h \
include/cdma-connman.h include/gnss.h \
include/private-network.h include/cdma-netreg.h \
include/cdma-provision.h include/handsfree.h \
include/handsfree-audio.h include/sim-mnclength.h \
include/oemraw.h include/siri.h
include/sim-mnclength.h \
include/handsfree-audio.h include/siri.h \
include/sms-filter.h include/gprs-filter.h \
include/voicecall-filter.h include/dbus-access.h \
include/ril-constants.h include/ril-transport.h \
include/watch.h gdbus/gdbus.h include/dbus-clients.h \
include/netmon.h include/lte.h include/ims.h \
include/slot.h include/cell-info.h \
include/storage.h include/conf.h include/misc.h \
include/mtu-limit.h
nodist_pkginclude_HEADERS = include/version.h
@@ -57,7 +65,7 @@ endif
builtin_modules =
builtin_sources =
builtin_libadd =
builtin_cflags =
builtin_cflags = -DSAILFISH_OS
noinst_LTLIBRARIES += gdbus/libgdbus-internal.la
@@ -96,20 +104,19 @@ gisi_sources = gisi/client.c gisi/client.h gisi/common.h \
gisi/server.c gisi/server.h \
gisi/socket.c gisi/socket.h
gril_sources = gril/gril.h gril/gril.c gril/grilio.h \
gril/grilio.c gril/grilutil.h \
gril/grilutil.c gril/ringbuffer.h \
gril/gfunc.h gril/ril.h \
gril_sources = gril/gril.h gril/gril.c \
gril/grilio.h gril/grilio.c \
gril/grilutil.h gril/grilutil.c \
gril/gfunc.h gril/gril.h \
gril/parcel.c gril/parcel.h \
gril/grilreply.c gril/grilreply.h \
gril/grilrequest.c gril/grilrequest.h \
gril/grilunsol.c gril/grilunsol.h
gril/ril_constants.h
btio_sources = btio/btio.h btio/btio.c
builtin_modules += cellinfo_netmon generic_phonebook
builtin_sources += plugins/cellinfo-netmon.c plugins/generic-phonebook.c
if UDEV
builtin_modules += udev
builtin_sources += plugins/udev.c
builtin_cflags += @UDEV_CFLAGS@
builtin_libadd += @UDEV_LIBS@
@@ -117,18 +124,34 @@ builtin_modules += udevng
builtin_sources += plugins/udevng.c
endif
if SAILFISH_ACCESS
builtin_modules += sailfish_access
builtin_sources += plugins/sailfish_access.c
endif
if RILMODEM
builtin_sources += $(gril_sources)
builtin_modules += rildev
builtin_sources += plugins/rildev.c
builtin_modules += ril
builtin_sources += plugins/ril.c
builtin_sources += plugins/ril.c plugins/ril.h
builtin_modules += infineon
builtin_sources += plugins/infineon.c
builtin_modules += ril_intel
builtin_sources += plugins/ril_intel.c
builtin_modules += rilmodem
builtin_sources += drivers/rilmodem/rilmodem.h \
drivers/rilmodem/vendor.h \
drivers/rilmodem/rilmodem.c \
drivers/rilmodem/devinfo.c \
drivers/rilmodem/network-registration.c \
drivers/rilmodem/voicecall.c \
drivers/rilmodem/voicecall.h \
drivers/rilmodem/call-volume.c \
drivers/rilmodem/gprs.c \
drivers/rilmodem/gprs-context.c \
@@ -136,16 +159,16 @@ builtin_sources += drivers/rilmodem/rilmodem.h \
drivers/rilmodem/sms.c \
drivers/rilmodem/rilutil.c \
drivers/rilmodem/rilutil.h \
drivers/rilmodem/radio-settings.c \
drivers/rilmodem/phonebook.c \
drivers/rilmodem/ussd.c \
drivers/rilmodem/call-settings.c \
drivers/rilmodem/call-forwarding.c \
drivers/rilmodem/cbs.c \
drivers/rilmodem/oemraw-messages.c \
drivers/rilmodem/radio-settings.c \
drivers/rilmodem/call-barring.c \
drivers/rilmodem/stk.c
drivers/rilmodem/netmon.c \
drivers/rilmodem/stk.c \
drivers/rilmodem/cbs.c \
drivers/infineonmodem/infineon_constants.h \
drivers/rilmodem/lte.c
endif
if ISIMODEM
@@ -203,11 +226,14 @@ qmi_sources = drivers/qmimodem/qmi.h drivers/qmimodem/qmi.c \
drivers/qmimodem/ctl.h \
drivers/qmimodem/dms.h \
drivers/qmimodem/nas.h \
drivers/qmimodem/nas.c \
drivers/qmimodem/uim.h \
drivers/qmimodem/wms.h \
drivers/qmimodem/wds.h \
drivers/qmimodem/pds.h \
drivers/qmimodem/common.h
drivers/qmimodem/common.h \
drivers/qmimodem/wda.h \
drivers/qmimodem/voice.h
builtin_modules += qmimodem
builtin_sources += $(qmi_sources) \
@@ -223,8 +249,10 @@ builtin_sources += $(qmi_sources) \
drivers/qmimodem/ussd.c \
drivers/qmimodem/gprs.c \
drivers/qmimodem/gprs-context.c \
drivers/qmimodem/lte.c \
drivers/qmimodem/radio-settings.c \
drivers/qmimodem/location-reporting.c
drivers/qmimodem/location-reporting.c \
drivers/qmimodem/netmon.c
builtin_modules += gobi
builtin_sources += plugins/gobi.c
@@ -232,8 +260,7 @@ endif
if ATMODEM
builtin_modules += atmodem
builtin_sources += $(gatchat_sources) \
drivers/atmodem/atmodem.h \
builtin_sources += drivers/atmodem/atmodem.h \
drivers/atmodem/atmodem.c \
drivers/atmodem/call-settings.c \
drivers/atmodem/sms.c \
@@ -255,8 +282,8 @@ builtin_sources += $(gatchat_sources) \
drivers/atmodem/atutil.c \
drivers/atmodem/gprs.c \
drivers/atmodem/gprs-context.c \
drivers/atmodem/sim-auth.c \
drivers/atmodem/gnss.c
drivers/atmodem/gnss.c \
drivers/atmodem/lte.c
builtin_modules += nwmodem
builtin_sources += drivers/atmodem/atutil.h \
@@ -309,6 +336,13 @@ builtin_sources += drivers/atmodem/atutil.h \
drivers/mbmmodem/stk.c \
drivers/mbmmodem/location-reporting.c
builtin_modules += telitmodem
builtin_sources += drivers/atmodem/atutil.h \
drivers/telitmodem/telitmodem.h \
drivers/telitmodem/telitmodem.c \
drivers/telitmodem/location-reporting.c \
drivers/telitmodem/gprs-context-ncm.c
builtin_modules += hsomodem
builtin_sources += drivers/atmodem/atutil.h \
drivers/hsomodem/hsomodem.h \
@@ -365,15 +399,36 @@ builtin_sources += drivers/atmodem/atutil.h \
drivers/speedupmodem/speedupmodem.c \
drivers/speedupmodem/ussd.c
builtin_modules += ubloxmodem
builtin_sources += drivers/atmodem/atutil.h \
drivers/ubloxmodem/ubloxmodem.h \
drivers/ubloxmodem/ubloxmodem.c \
drivers/ubloxmodem/gprs-context.c \
drivers/ubloxmodem/netmon.c \
drivers/ubloxmodem/lte.c
builtin_modules += gemaltomodem
builtin_sources += drivers/atmodem/atutil.h \
drivers/gemaltomodem/gemaltomodem.h \
drivers/gemaltomodem/gemaltomodem.c \
drivers/gemaltomodem/location-reporting.c \
drivers/gemaltomodem/voicecall.c
builtin_modules += xmm7modem
builtin_sources += drivers/atmodem/atutil.h \
drivers/xmm7modem/xmm7modem.h \
drivers/xmm7modem/xmm7modem.c \
drivers/xmm7modem/radio-settings.c \
drivers/xmm7modem/ims.c \
drivers/xmm7modem/netmon.c
if PHONESIM
builtin_modules += phonesim
builtin_sources += plugins/phonesim.c
if DATAFILES
dist_conf_DATA += plugins/phonesim.conf
if RILMODEM
dist_conf_DATA += gril/ril_subscription.conf
endif
endif
endif
@@ -386,7 +441,7 @@ builtin_sources += drivers/cdmamodem/cdmamodem.h \
drivers/cdmamodem/connman.c
endif
if !RILMODEM
if EXTRA_MODEMS
builtin_modules += g1
builtin_sources += plugins/g1.c
@@ -429,8 +484,11 @@ builtin_sources += plugins/stemgr.c
builtin_modules += caif
builtin_sources += plugins/caif.c
builtin_modules += tc65
builtin_sources += plugins/tc65.c
builtin_modules += cinterion
builtin_sources += plugins/cinterion.c
builtin_modules += gemalto
builtin_sources += plugins/gemalto.c
builtin_modules += nokia
builtin_sources += plugins/nokia.c
@@ -458,33 +516,56 @@ builtin_sources += plugins/samsung.c
builtin_modules += sim900
builtin_sources += plugins/sim900.c
builtin_modules += sim7100
builtin_sources += plugins/sim7100.c
builtin_modules += telit
builtin_sources += plugins/telit.c
builtin_modules += quectel
builtin_sources += plugins/quectel.c
builtin_modules += ublox
builtin_sources += plugins/ublox.c
builtin_modules += xmm7xxx
builtin_sources += plugins/xmm7xxx.c
endif
builtin_modules += connman
builtin_sources += plugins/connman.c
builtin_modules += he910
builtin_sources += plugins/he910.c
builtin_modules += mnclength
builtin_sources += plugins/mnclength.c
if BLUETOOTH
if BLUEZ4
builtin_modules += bluez4
builtin_sources += plugins/bluez4.c plugins/bluez4.h
builtin_modules += telit
builtin_sources += plugins/telit.c plugins/bluez4.h
builtin_modules += sap
builtin_sources += plugins/sap.c plugins/bluez4.h
builtin_modules += hfp_bluez4
builtin_sources += plugins/hfp_hf_bluez4.c plugins/bluez4.h
builtin_modules += hfp_ag_bluez4
builtin_sources += plugins/hfp_ag_bluez4.c plugins/bluez4.h
builtin_modules += dun_gw_bluez4
builtin_sources += plugins/dun_gw_bluez4.c plugins/bluez4.h
else
builtin_modules += hfp_bluez5
builtin_sources += plugins/hfp_hf_bluez5.c plugins/bluez5.h
builtin_modules += dun_gw_bluez5
builtin_sources += plugins/dun_gw_bluez5.c plugins/bluez5.h
endif
endif
endif
if BLUETOOTH
if BLUEZ4
builtin_modules += bluez4
builtin_sources += plugins/bluez4.c plugins/bluez4.h
builtin_modules += hfp_ag_bluez4
builtin_sources += plugins/hfp_ag_bluez4.c plugins/bluez4.h
builtin_sources += $(btio_sources)
builtin_cflags += @BLUEZ_CFLAGS@
@@ -493,16 +574,19 @@ else
builtin_modules += bluez5
builtin_sources += plugins/bluez5.c plugins/bluez5.h
builtin_modules += hfp_bluez5
builtin_sources += plugins/hfp_hf_bluez5.c plugins/bluez5.h
builtin_modules += hfp_ag_bluez5
builtin_sources += plugins/hfp_ag_bluez5.c plugins/bluez5.h
builtin_modules += dun_gw_bluez5
builtin_sources += plugins/dun_gw_bluez5.c plugins/bluez5.h
if SAILFISH_BT
builtin_modules += sfos_bt
builtin_sources += plugins/sailfish_bt.c
endif
endif
if UPOWER
builtin_modules += upower
builtin_sources += plugins/upower.c
endif
endif
if NETTIME
@@ -510,17 +594,32 @@ builtin_modules += nettime
builtin_sources += plugins/nettime.c
endif
if SAILFISH_DEBUGLOG
builtin_modules += debuglog
builtin_sources += plugins/sailfish_debuglog.c
endif
if SAILFISH_PROVISION
builtin_sources += plugins/sailfish_provision.c
PROVISION = 1
else
if PROVISION
builtin_sources += plugins/provision.c
endif
endif
if PROVISION
builtin_sources += plugins/mbpi.h plugins/mbpi.c
builtin_modules += provision
builtin_sources += plugins/provision.h plugins/provision.c
builtin_sources += plugins/provision.h
builtin_modules += cdma_provision
builtin_sources += plugins/cdma-provision.c
builtin_modules += mnclength
builtin_sources += plugins/mnclength.c
builtin_modules += file_provision
builtin_sources += plugins/file-provision.c
endif
if MAINTAINER_MODE
@@ -541,6 +640,9 @@ builtin_sources += examples/private-network.c
builtin_modules += stktest
builtin_sources += plugins/stktest.c
builtin_modules += emulator_fuzz
builtin_sources += plugins/emulator_fuzz.c
endif
builtin_modules += smart_messaging
@@ -549,19 +651,51 @@ builtin_sources += plugins/smart-messaging.c
builtin_modules += push_notification
builtin_sources += plugins/push-notification.c
if PUSHFORWARDER
builtin_modules += push_forwarder
builtin_sources += plugins/push-forwarder.c
builtin_cflags += @WSPCODEC_CFLAGS@
builtin_libadd += @WSPCODEC_LIBS@
if SAILFISH_PUSHFORWARDER
builtin_modules += pushforwarder
builtin_sources += plugins/sailfish_pushforwarder.c
endif
builtin_modules += sms_history
builtin_sources += plugins/smshistory.c
builtin_modules += allowed_apns
builtin_sources += plugins/allowed-apns.c
if ELL
builtin_cflags += @ELL_CFLAGS@
builtin_libadd += @ELL_LIBS@
if MBIMMODEM
mbim_sources = drivers/mbimmodem/mbim.h \
drivers/mbimmodem/mbim.c \
drivers/mbimmodem/mbim-private.h \
drivers/mbimmodem/mbim-desc.h \
drivers/mbimmodem/mbim-desc.c \
drivers/mbimmodem/mbim-message.h \
drivers/mbimmodem/mbim-message.c
builtin_modules += mbimmodem
builtin_sources += $(mbim_sources) \
drivers/mbimmodem/util.h \
drivers/mbimmodem/util.c \
drivers/mbimmodem/mbimmodem.h \
drivers/mbimmodem/mbimmodem.c \
drivers/mbimmodem/devinfo.c \
drivers/mbimmodem/sim.c \
drivers/mbimmodem/network-registration.c \
drivers/mbimmodem/sms.c \
drivers/mbimmodem/gprs.c \
drivers/mbimmodem/gprs-context.c
builtin_modules += mbim
builtin_sources += plugins/mbim.c
endif
endif
sbin_PROGRAMS = src/ofonod
src_ofonod_SOURCES = $(builtin_sources) src/ofono.ver \
src_ofonod_SOURCES = $(builtin_sources) $(gatchat_sources) src/ofono.ver \
src/main.c src/ofono.h src/log.c src/plugin.c \
src/modem.c src/common.h src/common.c \
src/manager.c src/dbus.c src/util.h src/util.c \
@@ -586,8 +720,18 @@ src_ofonod_SOURCES = $(builtin_sources) src/ofono.ver \
src/cdma-sms.c src/private-network.c src/cdma-netreg.c \
src/cdma-provision.c src/handsfree.c \
src/handsfree-audio.c src/bluetooth.h \
src/hfp.h src/sim-mnclength.c src/oemraw.c \
src/siri.c src/voicecallagent.c
src/sim-mnclength.c src/voicecallagent.c \
src/sms-filter.c src/gprs-filter.c \
src/dbus-clients.c src/dbus-queue.c src/dbus-access.c \
src/voicecall-filter.c src/ril-transport.c \
src/hfp.h src/siri.c src/watchlist.c \
src/netmon.c src/lte.c src/ims.c \
src/netmonagent.c src/netmonagent.h \
src/slot-manager.c src/slot-manager-dbus.c \
src/cell-info.c src/cell-info-dbus.c \
src/cell-info-control.c \
src/sim-info.c src/sim-info-dbus.c \
src/conf.c src/mtu-limit.c
src_ofonod_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \
@GLIB_LIBS@ @DBUS_LIBS@ -ldl
@@ -597,7 +741,8 @@ src_ofonod_LDFLAGS = -Wl,--export-dynamic \
BUILT_SOURCES = $(local_headers) src/builtin.h
CLEANFILES = $(BUILT_SOURCES) $(rules_DATA)
CLEANFILES = $(BUILT_SOURCES) $(rules_DATA) \
$(shell find . -name "*.gcda") $(shell find . -name "*.gcno")
plugindir = $(pkglibdir)/plugins
@@ -630,9 +775,15 @@ doc_files = doc/overview.txt doc/ofono-paper.txt doc/release-faq.txt \
doc/sim-api.txt doc/stk-api.txt \
doc/audio-settings-api.txt doc/text-telephony-api.txt \
doc/calypso-modem.txt doc/message-api.txt \
doc/location-reporting-api.txt doc/smshistory-api.txt \
doc/oemraw-api.txt \
doc/certification.txt doc/siri-api.txt
doc/location-reporting-api.txt \
doc/smshistory-api.txt doc/oemraw-api.txt \
doc/certification.txt doc/siri-api.txt \
doc/telit-modem.txt \
doc/networkmonitor-api.txt \
doc/allowed-apns-api.txt \
doc/lte-api.txt \
doc/cinterion-hardware-monitor-api.txt \
doc/ims-api.txt
test_scripts = test/backtrace \
@@ -666,6 +817,7 @@ test_scripts = test/backtrace \
test/receive-sms \
test/remove-contexts \
test/send-sms \
test/cancel-sms \
test/set-mic-volume \
test/set-speaker-volume \
test/test-stk-menu \
@@ -720,6 +872,7 @@ test_scripts = test/backtrace \
test/set-context-property \
test/test-gnss \
test/swap-calls \
test/transfer-call \
test/release-and-answer \
test/release-and-swap \
test/hold-and-answer \
@@ -727,7 +880,24 @@ test_scripts = test/backtrace \
test/hangup-call \
test/display-icon \
test/set-msisdn \
test/test-voicecallagent
test/test-voicecallagent \
test/get-network-time \
test/set-ddr \
test/register-auto \
test/register-operator \
test/set-sms-smsc \
test/set-sms-bearer \
test/get-serving-cell-info \
test/list-allowed-access-points \
test/enable-throttling \
test/disable-throttling \
test/set-lte-property \
test/test-serving-cell-info \
test/ims-register \
test/ims-unregister \
test/list-applications \
test/set-sms-alphabet
if TEST
testdir = $(pkglibdir)/test
@@ -739,35 +909,138 @@ EXTRA_DIST = src/genbuiltin plugins/ofono.rules plugins/ofono-speedup.rules \
dist_man_MANS = doc/ofonod.8
if TEST_COVERAGE
COVERAGE_OPT = --coverage
endif
unit_objects =
unit_tests = unit/test-common unit/test-util unit/test-idmap \
unit/test-simutil unit/test-stkutil \
unit/test-sms unit/test-cdmasms \
unit/test-grilrequest \
unit/test-grilreply \
unit/test-grilunsol \
unit/test-sms unit/test-cdmasms \
unit/test-provision
unit/test-sms unit/test-cdmasms
unit_test_conf_SOURCES = unit/test-conf.c src/conf.c src/log.c
unit_test_conf_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT)
unit_test_conf_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_conf_OBJECTS)
unit_tests += unit/test-conf
unit_test_cell_info_SOURCES = unit/test-cell-info.c src/cell-info.c src/log.c
unit_test_cell_info_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT)
unit_test_cell_info_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_cell_info_OBJECTS)
unit_tests += unit/test-cell-info
unit_test_cell_info_control_SOURCES = unit/test-cell-info-control.c \
unit/fake_cell_info.c src/cell-info.c \
src/cell-info-control.c src/log.c
unit_test_cell_info_control_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT)
unit_test_cell_info_control_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_cell_info_control_OBJECTS)
unit_tests += unit/test-cell-info-control
unit_test_cell_info_dbus_SOURCES = unit/test-dbus.c \
unit/test-cell-info-dbus.c unit/fake_cell_info.c \
src/cell-info.c src/cell-info-dbus.c \
src/cell-info-control.c gdbus/object.c \
src/dbus-clients.c src/dbus.c src/log.c
unit_test_cell_info_dbus_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT) \
@DBUS_GLIB_CFLAGS@
unit_test_cell_info_dbus_LDADD = @DBUS_GLIB_LIBS@ @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_cell_info_dbus_OBJECTS)
unit_tests += unit/test-cell-info-dbus
unit_test_sim_info_SOURCES = unit/test-sim-info.c unit/fake_watch.c \
src/sim-info.c src/storage.c src/watchlist.c src/log.c
unit_test_sim_info_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS) \
-DSTORAGEDIR='"/tmp/ofono"'
unit_test_sim_info_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_sim_info_OBJECTS)
unit_tests += unit/test-sim-info
unit_test_sim_info_dbus_SOURCES = unit/test-sim-info-dbus.c \
unit/test-dbus.c unit/fake_watch.c \
src/sim-info.c src/sim-info-dbus.c \
gdbus/object.c \
src/dbus.c src/storage.c src/watchlist.c src/log.c
unit_test_sim_info_dbus_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS) \
@DBUS_GLIB_CFLAGS@ -DSTORAGEDIR='"/tmp/ofono"'
unit_test_sim_info_dbus_LDADD = @DBUS_GLIB_LIBS@ @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_sim_info_dbus_OBJECTS)
unit_tests += unit/test-sim-info-dbus
unit_test_slot_manager_SOURCES = unit/test-slot-manager.c unit/fake_watch.c \
unit/fake_cell_info.c src/slot-manager.c \
src/cell-info.c src/cell-info-control.c \
src/sim-info.c src/storage.c src/log.c
unit_test_slot_manager_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT) \
-DSTORAGEDIR='"/tmp/ofono"'
unit_test_slot_manager_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_slot_manager_OBJECTS)
unit_tests += unit/test-slot-manager
unit_test_watch_SOURCES = unit/test-watch.c src/watch.c \
src/cell-info.c src/cell-info-control.c \
src/log.c src/watchlist.c
unit_test_watch_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT) \
-DSTORAGEDIR='"/tmp/ofono"'
unit_test_watch_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_watch_OBJECTS)
unit_tests += unit/test-watch
if SAILFISH_ACCESS
unit_test_sailfish_access_SOURCES = unit/test-sailfish_access.c \
plugins/sailfish_access.c src/dbus-access.c src/log.c
unit_test_sailfish_access_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT)
unit_test_sailfish_access_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_sailfish_access_OBJECTS)
unit_tests += unit/test-sailfish_access
endif
unit_test_dbus_access_SOURCES = unit/test-dbus-access.c src/dbus-access.c \
src/log.c
unit_test_dbus_access_CFLAGS = $(AM_CFLAGS) $(COVERAGE_OPT)
unit_test_dbus_access_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_dbus_access_OBJECTS)
unit_tests += unit/test-dbus-access
if RILMODEM
unit_tests += unit/test-rilmodem-cs \
unit/test-rilmodem-cs \
unit/test-rilmodem-sms \
unit/test-rilmodem-cb \
unit/test-rilmodem-gprs
endif
if ELL
if MBIMMODEM
unit_tests += unit/test-mbim
endif
endif
noinst_PROGRAMS = $(unit_tests) \
unit/test-sms-root unit/test-mux unit/test-caif
unit_test_common_SOURCES = unit/test-common.c src/common.c src/util.c
unit_test_common_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_common_LDADD = @GLIB_LIBS@
unit_objects += $(unit_test_common_OBJECTS)
unit_test_util_SOURCES = unit/test-util.c src/util.c
unit_test_util_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_util_LDADD = @GLIB_LIBS@
unit_objects += $(unit_test_utils_OBJECTS)
unit_test_idmap_SOURCES = unit/test-idmap.c src/idmap.c
unit_test_idmap_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_idmap_LDADD = @GLIB_LIBS@
unit_objects += $(unit_test_idmap_OBJECTS)
unit_test_simutil_SOURCES = unit/test-simutil.c src/util.c \
src/simutil.c src/smsutil.c src/storage.c
unit_test_simutil_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_simutil_LDADD = @GLIB_LIBS@
unit_objects += $(unit_test_simutil_OBJECTS)
@@ -775,19 +1048,23 @@ unit_test_stkutil_SOURCES = unit/test-stkutil.c unit/stk-test-data.h \
src/util.c \
src/storage.c src/smsutil.c \
src/simutil.c src/stkutil.c
unit_test_stkutil_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_stkutil_LDADD = @GLIB_LIBS@
unit_objects += $(unit_test_stkutil_OBJECTS)
unit_test_sms_SOURCES = unit/test-sms.c src/util.c src/smsutil.c src/storage.c
unit_test_sms_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_sms_LDADD = @GLIB_LIBS@
unit_objects += $(unit_test_sms_OBJECTS)
unit_test_cdmasms_SOURCES = unit/test-cdmasms.c src/cdma-smsutil.c
unit_test_cdmasms_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_cdmasms_LDADD = @GLIB_LIBS@
unit_objects += $(unit_test_cdmasms_OBJECTS)
unit_test_sms_root_SOURCES = unit/test-sms-root.c \
src/util.c src/smsutil.c src/storage.c
unit_test_sms_root_CFLAGS = -DSTORAGEDIR='"/tmp/ofono"' $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_sms_root_LDADD = @GLIB_LIBS@
unit_objects += $(unit_test_sms_root_OBJECTS)
@@ -798,30 +1075,106 @@ unit_objects += $(unit_test_mux_OBJECTS)
unit_test_caif_SOURCES = unit/test-caif.c $(gatchat_sources) \
drivers/stemodem/caif_socket.h \
drivers/stemodem/if_caif.h
unit_test_caif_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_caif_LDADD = @GLIB_LIBS@
unit_objects += $(unit_test_caif_OBJECTS)
unit_test_grilrequest_SOURCES = unit/test-grilrequest.c $(gril_sources) \
src/log.c gatchat/ringbuffer.c
unit_test_grilrequest_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_grilrequest_OBJECTS)
unit_test_dbus_clients_SOURCES = unit/test-dbus-clients.c unit/test-dbus.c \
src/dbus-clients.c gdbus/object.c \
src/dbus.c src/log.c
unit_test_dbus_clients_CFLAGS = @DBUS_GLIB_CFLAGS@ $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_dbus_clients_LDADD = @DBUS_GLIB_LIBS@ @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_dbus_clients_OBJECTS)
unit_tests += unit/test-dbus-clients
unit_test_grilreply_SOURCES = unit/test-grilreply.c $(gril_sources) \
src/log.c gatchat/ringbuffer.c
unit_test_grilreply_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_grilreply_OBJECTS)
unit_test_grilunsol_SOURCES = unit/test-grilunsol.c $(gril_sources) \
src/log.c gatchat/ringbuffer.c
unit_test_grilunsol_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_grilunsol_OBJECTS)
unit_test_dbus_queue_SOURCES = unit/test-dbus-queue.c unit/test-dbus.c \
src/dbus-queue.c gdbus/object.c \
src/dbus.c src/log.c
unit_test_dbus_queue_CFLAGS = @DBUS_GLIB_CFLAGS@ $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_dbus_queue_LDADD = @DBUS_GLIB_LIBS@ @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_dbus_queue_OBJECTS)
unit_tests += unit/test-dbus-queue
unit_test_provision_SOURCES = unit/test-provision.c \
plugins/provision.h plugins/provision.c \
plugins/mbpi.c src/gprs-provision.c \
src/log.c
plugins/provision.h plugins/mbpi.c \
plugins/sailfish_provision.c \
src/gprs-provision.c src/log.c
unit_test_provision_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_provision_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_provision_OBJECTS)
unit_tests += unit/test-provision
unit_test_ril_transport_SOURCES = unit/test-ril-transport.c \
src/ril-transport.c src/log.c
unit_test_ril_transport_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_ril_transport_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_ril_transport_OBJECTS)
unit_tests += unit/test-ril-transport
unit_test_sms_filter_SOURCES = unit/test-sms-filter.c \
src/sms-filter.c src/log.c
unit_test_sms_filter_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_sms_filter_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_sms_filter_OBJECTS)
unit_tests += unit/test-sms-filter
unit_test_gprs_filter_SOURCES = unit/test-gprs-filter.c \
src/gprs-filter.c src/log.c
unit_test_gprs_filter_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_gprs_filter_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_gprs_filter_OBJECTS)
unit_tests += unit/test-gprs-filter
unit_test_voicecall_filter_SOURCES = unit/test-voicecall-filter.c \
src/voicecall-filter.c src/log.c \
src/common.c src/util.c
unit_test_voicecall_filter_CFLAGS = $(COVERAGE_OPT) $(AM_CFLAGS)
unit_test_voicecall_filter_LDADD = @GLIB_LIBS@ -ldl
unit_objects += $(unit_test_voicecall_filter_OBJECTS)
unit_tests += unit/test-voicecall-filter
test_rilmodem_sources = $(gril_sources) src/log.c src/common.c src/util.c \
gatchat/ringbuffer.h gatchat/ringbuffer.c \
unit/rilmodem-test-server.h \
unit/rilmodem-test-server.c \
unit/rilmodem-test-engine.h \
unit/rilmodem-test-engine.c \
src/simutil.c \
drivers/rilmodem/rilutil.c
unit_test_rilmodem_cs_SOURCES = $(test_rilmodem_sources) \
unit/test-rilmodem-cs.c \
drivers/rilmodem/call-settings.c
unit_test_rilmodem_cs_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \
@GLIB_LIBS@ @DBUS_LIBS@ -ldl
unit_objects += $(unit_test_rilmodem_cs_OBJECTS)
unit_test_rilmodem_sms_SOURCES = $(test_rilmodem_sources) \
unit/test-rilmodem-sms.c \
drivers/rilmodem/sms.c
unit_test_rilmodem_sms_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \
@GLIB_LIBS@ @DBUS_LIBS@ -ldl
unit_objects += $(unit_test_rilmodem_sms_OBJECTS)
unit_test_rilmodem_cb_SOURCES = $(test_rilmodem_sources) \
unit/test-rilmodem-cb.c \
drivers/rilmodem/call-barring.c
unit_test_rilmodem_cb_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \
@GLIB_LIBS@ @DBUS_LIBS@ -ldl
unit_objects += $(unit_test_rilmodem_cb_OBJECTS)
unit_test_rilmodem_gprs_SOURCES = $(test_rilmodem_sources) \
unit/test-rilmodem-gprs.c \
drivers/rilmodem/gprs.c
unit_test_rilmodem_gprs_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \
@GLIB_LIBS@ @DBUS_LIBS@ -ldl
unit_objects += $(unit_test_rilmodem_gprs_OBJECTS)
unit_test_mbim_SOURCES = unit/test-mbim.c \
drivers/mbimmodem/mbim-message.c \
drivers/mbimmodem/mbim.c
unit_test_mbim_LDADD = @ELL_LIBS@
unit_objects += $(unit_test_mbim_OBJECTS)
TESTS = $(unit_tests)
@@ -849,13 +1202,6 @@ tools_lookup_provider_name_LDADD = @GLIB_LIBS@
tools_tty_redirector_SOURCES = tools/tty-redirector.c
tools_tty_redirector_LDADD = @GLIB_LIBS@
if QMIMODEM
noinst_PROGRAMS += tools/qmi
tools_qmi_SOURCES = $(qmi_sources) tools/qmi.c
tools_qmi_LDADD = @GLIB_LIBS@
endif
if MAINTAINER_MODE
noinst_PROGRAMS += tools/stktest
@@ -924,6 +1270,10 @@ include/ofono/version.h: include/version.h
$(AM_V_at)$(MKDIR_P) include/ofono
$(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@
include/ofono/gdbus.h: $(abs_top_srcdir)/gdbus/gdbus.h
$(AM_V_at)$(MKDIR_P) include/ofono
$(AM_V_GEN)$(LN_S) $< $@
include/ofono/%.h: $(abs_top_srcdir)/include/%.h
$(AM_V_at)$(MKDIR_P) include/ofono
$(AM_V_GEN)$(LN_S) $< $@

View File

@@ -256,6 +256,16 @@ Voicecall
Priority: Medium
Complexity: C1
- DTMF Driver hints
Currently multiple DTMF tones are sent to the driver in batches of up to 8
characters. For those drivers that can only accept a limited set of DTMF
characters at a time (e.g. one), add a setting to the core that will change
this batch size limit.
Priority: Medium
Complexity: C1
Sim Toolkit
===========

View File

@@ -12,7 +12,8 @@ AC_DEFUN([AC_PROG_CC_PIE], [
AC_DEFUN([COMPILER_FLAGS], [
if (test "${CFLAGS}" = ""); then
CFLAGS="-Wall -O2 -D_FORTIFY_SOURCE=2"
CFLAGS="-Wall -O2 -fsigned-char -fno-exceptions"
CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
fi
if (test "$USE_MAINTAINER_MODE" = "yes"); then
CFLAGS="$CFLAGS -Werror -Wextra"
@@ -22,6 +23,7 @@ AC_DEFUN([COMPILER_FLAGS], [
CFLAGS="$CFLAGS -Wmissing-declarations"
CFLAGS="$CFLAGS -Wredundant-decls"
CFLAGS="$CFLAGS -Wcast-align"
CFLAGS="$CFLAGS -Wno-format-truncation"
CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED"
fi
])

View File

@@ -1,5 +1,5 @@
AC_PREREQ(2.60)
AC_INIT(ofono, 1.14)
AC_INIT(ofono, 1.29)
AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
AC_CONFIG_HEADERS(config.h)
@@ -33,7 +33,7 @@ AC_PROG_LIBTOOL
AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
[disable code optimization through compiler]), [
if (test "${enableval}" = "no"); then
CFLAGS="$CFLAGS -O0"
CFLAGS="$CFLAGS -O0 -U_FORTIFY_SOURCE"
fi
])
@@ -42,6 +42,7 @@ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
if (test "${enableval}" = "yes" &&
test "${ac_cv_prog_cc_g}" = "yes"); then
CFLAGS="$CFLAGS -g"
CPPFLAGS="$CPPFLAGS -DDEBUG"
fi
])
@@ -54,27 +55,26 @@ AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
fi
])
AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads],
[enable threading support]), [enable_threads=${enableval}])
AC_CHECK_FUNC(signalfd, dummy=yes,
AC_MSG_ERROR(signalfd support is required))
AC_CHECK_LIB(dl, dlopen, dummy=yes,
AC_MSG_ERROR(dynamic linking loader is required))
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
AC_MSG_ERROR(GLib >= 2.28 is required))
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.32, dummy=yes,
AC_MSG_ERROR(GLib >= 2.32 is required))
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
if (test "${enable_threads}" = "yes"); then
AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
AC_MSG_ERROR(GThread >= 2.16 is required))
GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
fi
PKG_CHECK_MODULES(GOBJECT, gobject-2.0, dummy=yes,
AC_MSG_ERROR(GObject is required))
GLIB_CFLAGS="$GLIB_CFLAGS $GOBJECT_CFLAGS"
GLIB_LIBS="$GLIB_LIBS $GOBJECT_LIBS"
PKG_CHECK_MODULES(GIO, gio-2.0, dummy=yes,
AC_MSG_ERROR(GIO is required))
GLIB_CFLAGS="$GLIB_CFLAGS $GIO_CFLAGS"
GLIB_LIBS="$GLIB_LIBS $GIO_LIBS"
PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
AC_MSG_ERROR(D-Bus >= 1.4 is required))
@@ -166,6 +166,35 @@ AC_ARG_ENABLE(rilmodem, AC_HELP_STRING([--disable-rilmodem],
[enable_rilmodem=${enableval}])
AM_CONDITIONAL(RILMODEM, test "${enable_rilmodem}" != "no")
AC_ARG_ENABLE(extra-modems,
AC_HELP_STRING([--enable-extra-modems],
[enable modems not used by Sailfish OS]),
[enable_extra_modems=${enableval}])
AM_CONDITIONAL(EXTRA_MODEMS, test "${enable_extra_modems}" = "yes")
PKG_CHECK_MODULES(GLIBUTIL, libglibutil >= 1.0.51, dummy=yes,
AC_MSG_ERROR(libglibutil >= 1.0.51 is required))
CFLAGS="$CFLAGS $GLIBUTIL_CFLAGS"
LIBS="$LIBS $GLIBUTIL_LIBS"
PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1, dummy=yes,
AC_MSG_ERROR(dbus-glib is required by unit tests))
AC_SUBST(DBUS_GLIB_CFLAGS)
AC_SUBST(DBUS_GLIB_LIBS)
AC_ARG_ENABLE(add-remove-context, AC_HELP_STRING([--disable-add-remove-context],
[don't allow to add or remove connection context over D-Bus]), [
if (test "${enableval}" = "no"); then
CFLAGS="$CFLAGS -DDISABLE_ADD_REMOVE_CONTEXT"
fi
])
AC_ARG_ENABLE(test-coverage,
AC_HELP_STRING([--enable-test-coverage], [enable test code coverage]),
[enable_test_coverage=${enableval}],
[enable_test_coverage="no"])
AM_CONDITIONAL(TEST_COVERAGE, test "${enable_test_coverage}" != "no")
AC_ARG_ENABLE(qmimodem, AC_HELP_STRING([--disable-qmimodem],
[disable Qualcomm QMI modem support]),
[enable_qmimodem=${enableval}])
@@ -189,6 +218,16 @@ fi
AM_CONDITIONAL(BLUEZ4, test "${enable_bluetooth}" != "no" && test "${enable_bluez4}" = "yes")
AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
AC_ARG_ENABLE(sailfish-bt, AC_HELP_STRING([--enable-sailfish-bt],
[enable Sailfish OS Bluetooth plugin]),
[enable_sailfish_bt=${enableval}])
AM_CONDITIONAL(SAILFISH_BT, test "${enable_sailfish_bt}" = "yes")
AC_ARG_ENABLE(sailfish-provision, AC_HELP_STRING([--enable-sailfish-provision],
[enable Sailfish OS provisioning plugin]),
[enable_sailfish_provision=${enableval}])
AM_CONDITIONAL(SAILFISH_PROVISION, test "${enable_sailfish_provision=$}" = "yes")
AC_ARG_ENABLE(nettime, AC_HELP_STRING([--disable-nettime],
[disable Nettime plugin]),
[enable_nettime=${enableval}])
@@ -201,7 +240,7 @@ AC_ARG_WITH([provisiondb], AC_HELP_STRING([--with-provisiondb=FILE],
[location of provision database]), [path_provisiondb=${withval}])
AC_ARG_ENABLE(provision, AC_HELP_STRING([--disable-provision],
[disable provisioning suport]),
[disable provisioning support]),
[enable_provision=${enableval}])
if (test "${enable_provision}" != "no"); then
if (test -n "${path_provisiondb}"); then
@@ -221,20 +260,70 @@ if (test "${enable_provision}" != "no"); then
fi
AM_CONDITIONAL(PROVISION, test "${enable_provision}" != "no")
AC_ARG_ENABLE(upower, AC_HELP_STRING([--disable-upower],
[disable UPower plugin]),
[enable_upower=${enableval}])
AM_CONDITIONAL(UPOWER, test "${enable_power}" != "no")
AC_ARG_ENABLE(mbimmodem, AC_HELP_STRING([--enable-mbimmodem],
[enable MBIM based modem support]),
[enable_mbimmodem=${enableval}])
AC_ARG_ENABLE(ell, AC_HELP_STRING([--enable-ell],
[enable support for ell]),
[enable_ell=${enableval}])
if (test "${enable_ell}" = "yes"); then
AC_DEFINE(HAVE_ELL, 1, [Defined if Ell is enabled])
PKG_CHECK_MODULES(ELL, ell >= 0.2, dummy=yes,
AC_MSG_ERROR(ell library >= 0.2 is required))
AC_SUBST(ELL_CFLAGS)
AC_SUBST(ELL_LIBS)
fi
AM_CONDITIONAL(MBIMMODEM, test "${enable_ell}" != "no" && test "${enable_mbimmodem}" = "yes")
AM_CONDITIONAL(ELL, test "${enable_ell}" != "no")
AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
[do not install configuration and data files]),
[enable_datafiles=${enableval}])
AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
AC_ARG_ENABLE(pushforwarder, AC_HELP_STRING([--disable-pushforwarder],
[disable Push Forwarder plugin]),
[enable_pushforwarder=${enableval}])
AM_CONDITIONAL(PUSHFORWARDER, test "${enable_pushforwarder}" != "no")
if (test "${enable_pushforwarder}" != "no"); then
AC_ARG_ENABLE(sailfish-pushforwarder, AC_HELP_STRING([--enable-sailfish-pushforwarder],
[enable Sailfish OS push forwarder plugin]),
[enable_sailfish_pushforwarder=${enableval}],
[enable_sailfish_pushforwarder="no"])
AM_CONDITIONAL(SAILFISH_PUSHFORWARDER, test "${enable_sailfish_pushforwarder}" != "no")
if (test "${enable_sailfish_pushforwarder}" != "no"); then
PKG_CHECK_MODULES(WSPCODEC, libwspcodec >= 2.0, dummy=yes,
AC_MSG_ERROR(WSP decoder is required))
AC_SUBST(WSPCODEC_CFLAGS)
AC_SUBST(WSPCODEC_LIBS)
AC_MSG_ERROR(WSP decoder is required))
CFLAGS="$CFLAGS $WSPCODEC_CFLAGS"
LIBS="$LIBS $WSPCODEC_LIBS"
fi
AC_ARG_ENABLE(sailfish-access, AC_HELP_STRING([--enable-sailfish-access],
[enable Sailfish OS access plugin]),
[enable_sailfish_access=${enableval}],
[enable_sailfish_access="no"])
AM_CONDITIONAL(SAILFISH_ACCESS, test "${enable_sailfish_access}" != "no")
if (test "${enable_sailfish_access}" == "yes"); then
PKG_CHECK_MODULES(DBUSACCESS, libdbusaccess, dummy=yes,
AC_MSG_ERROR(libdbusaccess is required))
CFLAGS="$CFLAGS $DBUSACCESS_CFLAGS"
LIBS="$LIBS $DBUSACCESS_LIBS"
fi
AC_ARG_ENABLE(sailfish-debuglog, AC_HELP_STRING([--enable-sailfish-debuglog],
[enable Sailfish OS debug log plugin]),
[enable_sailfish_debuglog=${enableval}],
[enable_sailfish_debuglog="no"])
AM_CONDITIONAL(SAILFISH_DEBUGLOG, test "${enable_sailfish_debuglog}" != "no")
if (test "${enable_sailfish_debuglog}" = "yes"); then
PKG_CHECK_MODULES(DBUSLOG, libdbuslogserver-dbus, dummy=yes,
AC_MSG_ERROR(libdbuslogserver-dbus is required))
CFLAGS="$CFLAGS $DBUSLOG_CFLAGS"
LIBS="$LIBS $DBUSLOG_LIBS"
fi
if (test "${prefix}" = "NONE"); then
@@ -251,7 +340,7 @@ if (test "$localstatedir" = '${prefix}/var'); then
else
storagedir="${localstatedir}/lib/ofono"
fi
AC_DEFINE_UNQUOTED(STORAGEDIR, "${storagedir}",
AC_DEFINE_UNQUOTED(DEFAULT_STORAGEDIR, "${storagedir}",
[Directory for the storage files])
if (test "$sysconfdir" = '${prefix}/etc'); then

View File

@@ -0,0 +1,17 @@
Allowed APNs hierarchy
=========================
Service org.ofono
Interface org.ofono.AllowedAccessPoints
Object path [variable prefix]/{modem0,modem1,...}
Methods array{string} GetAllowedAccessPoints()
Get the list of allowed access points provided
in the SIM card.
This method returns an array of strings which
contains a list of Access Point Names supported
by network provider. Returns with an error if
SIM reading failed or an empty list if there
are no access points listed on the SIM.

View File

@@ -0,0 +1,16 @@
HardwareMonitor hierarchy
=========================
Service org.ofono
Interface org.ofono.cinterion.HardwareMonitor
Object path /{device0,device1,...}
Methods array{string,variant} GetStatistics
Returns an array of dict entries representing the
current temperature and supply voltage of the modem.
Units:
Temperature: Celsius
Voltage: mV

View File

@@ -19,7 +19,7 @@ Besides the kernel coding style above, oFono has special flavors for its own.
Some of them are mandatory (marked as 'M'), while some others are optional
(marked as 'O'), but generally preferred.
M1: Blank line before and after an if/while/do/for statement
M1: Blank line before and after an if/while/do/for/switch statement
============================================================
There should be a blank line before if statement unless the if is nested and
not preceded by an expression or variable declaration.
@@ -306,6 +306,13 @@ Example:
2)
0x1 << y // Wrong
M17: Avoid forward-declaration of static functions
==================================================
Functions that are static should not be forward-declared. The only exception
to this rule is if a circular dependency condition exists, and the forward
declaration cannot be avoided.
O1: Shorten the name
====================
Better to use abbreviation, rather than full name, to name a variable,

View File

@@ -0,0 +1,164 @@
Every project has its own recursive patterns, and oFono is not an exception.
This document describes the most common ones found in the code.
Typical flow for atom <-> atom driver operations
================================================
Most of the time, the core atom for a given request calls a function in
the atom driver, which generally executes some commands against the modem,
and can then return the results to the core.
For example:
dbus call: lte/SetProperty(DefaultAPN)
|
v
core: check APN validity, call the modem atom for execution in the modem
|
v
atom driver: schedules 'AT+CGDCONT=0,"IP","MyNiceAPN"' for execution
|
[ break in the flow: the functions return back to the core, the dbus request ]
[ is not answered at this time ]
...
[GLibMain event loop schedules the command, it is sent to the modem and the ]
[ modem's reply is obtained ]
|
v
atom driver: a callback function, optionally provided when AT command was
scheduled is now called
|
v
core: atom driver core callback function is now called. This was passed from
the core as an argument, earlier, when the atom driver operation was invoked,
along with some context data (opaque info for the atom driver containing core
atom owned data)
|
v
the core can now answer the dbus message
In the code, it looks like this:
//core call:
static DBusMessage *lte_set_property(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct ofono_lte *lte = data;
/*
* a block of code here processes the msg and fills the
* lte->pending_info structure
*/
lte->driver->set_default_attach_info(lte, &lte->pending_info,
lte_set_default_attach_info_cb, lte);
return NULL;
}
// lte_set_default_attach_info_cb is the core callback function,
// the lte structure is the parameter that it takes
//atom:
static void at_lte_set_default_attach_info(const struct ofono_lte *lte,
const struct ofono_lte_default_attach_info *info,
ofono_lte_cb_t cb, void *data)
{
struct lte_driver_data *ldd = ofono_lte_get_data(lte);
// next line creates a structure for the in-atom callback
struct cb_data *cbd = cb_data_new(cb, data);
if (g_at_chat_send(ldd->chat, "AT", NULL,
at_lte_set_default_attach_info_cb,
cbd, g_free) > 0)
return;
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, data);
}
// here the structure is allocate dynamically, and since it is quite common,
// the function g_at_chat_send accepts the last 3 parameters:
// - in-atom callback function
// - in-atom callback data
// - destroy function for dynamically-allocated callback data
// NOTE: if g_at_chat_send fails, it does not free the memory, so it must be
// done after the call.
// Note also the callback to the core directly here if the g_at_chat_send fails.
//atom callback:
static void at_lte_set_default_attach_info_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
if (result == NULL) {
CALLBACK_WITH_FAILURE(cbd->cb, cbd->data);
return;
}
decode_at_error(&error, g_at_result_final_response(result));
cbd->cb(&error, cbd->data);
}
// note that here cbd must not be released, it will be done by the GAtChat
// after invoking the callback (at_lte_set_default_attach_info_cb)
// note also that the core function will be executed before cbd is released,
// so the last line of the code is ok.
Use of the cb_data in AT command based atom drivers
===================================================
the cb_data can be used by creating the structure with cb_data_new,
and then there are two possibilities:
- use it in a single callback function, and destroy it with a call to
g_free.
Example:
- calling function:
struct cb_data *cbd = cb_data_new(cb, data);
if (g_at_chat_send(chat, buf, NULL, at_cgatt_cb, cbd, g_free) > 0)
return;
g_free(cbd);
- called function (here at_cgatt_cb):
static void at_cgatt_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_gprs_cb_t cb = cbd->cb;
struct ofono_error error;
decode_at_error(&error,
g_at_result_final_response(result));
cb(&error, cbd->data);
}
note the absence of explicit g_free(cbd);
- pass it through a train of callback functions, adding a reference at
each pass cb_data_ref, and removing it with cb_data_unref.
the use of cb_data_ref would replace a new object creation, while the
use of cb_data_unref the use of g_free.
Example:
- calling function:
struct cb_data *cbd = cb_data_new(cb, data);
// no cb_ref at the creation
if (g_at_chat_send(chat, buf, NULL,
at_lte_set_default_attach_info_cb,
cbd, cb_data_unref) > 0)
goto end;
cb_data_unref(cbd);
- called function 1 (at_lte_set_default_attach_info_cb):
static void at_lte_set_default_attach_info_cb(gboolean ok,
GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
cbd = cb_data_ref(cbd);
if (g_at_chat_send(chat, buf, NULL,
at_cgatt_cb, cbd, cb_data_unref) > 0)
return;
cb_data_unref(cbd);
}
- called function 2 (at_cgatt_cb):
like above. no call to g_free or cb_data_unref. The terminal function
doesn't need to know about the reference scheme.

View File

@@ -60,6 +60,16 @@ Methods dict GetProperties()
[service].Error.NotFound
[service].Error.Failed
void ResetContexts()
Removes all contexts and re-provisions from the APN
database. Contexts must all be deactivated for this
method to work, and the atom must not be powered.
Possible Errors: [service].Error.InProgress
[service].Error.InvalidArguments
[service].Error.NotAllowed
Signals PropertyChanged(string property, variant value)
This signal indicates a changed value of the given
@@ -96,7 +106,7 @@ Properties boolean Attached [readonly]
GPRS service registration (if known).
Possible values are:
"none", "gsm", "edge", "umts", "hsdpa", "hsupa",
"none", "gprs", "edge", "umts", "hsdpa", "hsupa",
"hspa" (HSDPA and HSUPA at the same time) and
"lte"
@@ -155,6 +165,15 @@ Methods dict GetProperties()
[service].Error.AttachInProgress
[service].Error.NotImplemented
Methods void ProvisionContext()
Resets all properties back to default. Fails to make
any changes to the context if it is active or in the
process of being activated or deactivated.
Possible Errors: [service].Error.Failed
[service].Error.InProgress
[service].Error.NotAvailable
Signals PropertyChanged(string property, variant value)
This signal indicates a changed value of the given
@@ -180,6 +199,11 @@ Properties boolean Active [readwrite]
"wap" - Used by WAP related services
"ims" - Used by IMS related services
string AuthenticationMethod [readwrite]
Holds the PPP authentication method to use. Valid
values are "pap", "chap" and "none".
Defaults to "chap".
string Username [readwrite]
Holds the username to be used for authentication
@@ -255,6 +279,13 @@ Properties boolean Active [readwrite]
via this proxy. All other values are left
out in this case.
array{string} ProxyCSCF [readonly, optional]
Holds the list of P-CSCF (SIP proxy) for this
context. Only used by IMS connections.
This is a Sailfish OS specific extension.
dict IPv6.Settings [readonly, optional]
Holds all the IPv6 network settings
@@ -281,6 +312,13 @@ Properties boolean Active [readwrite]
Holds the gateway IP for this connection.
array{string} ProxyCSCF [readonly, optional]
Holds the list of P-CSCF (SIP proxy) for this
context. Only used by IMS connections.
This is a Sailfish OS specific extension.
string MessageProxy [readwrite, MMS only]
Holds the MMS Proxy setting.

View File

@@ -14,7 +14,7 @@ What oFono will do:
- Post online atoms will be created.
- Upon reception of Dial request, Emergency mode is activated.
- Once the call is ended, Emergency mode is deactivated.
- Modem remains in online mode with full funcationality.
- Modem remains in online mode with full functionality.
Case 2: Call in SIM Present and PIN required state

View File

@@ -19,6 +19,8 @@ Methods dict GetProperties()
Possible Errors: [service].Error.InProgress
[service].Error.InvalidArguments
[service].Error.NotImplemented
[service].Error.NotSupported
string RequestPhoneNumber()
@@ -45,6 +47,13 @@ Properties array{string} Features [readonly]
"voice-recognition"
"attach-voice-tag"
"echo-canceling-and-noise-reduction"
"three-way-calling"
"release-all-held"
"release-specified-active-call"
"private-chat"
"create-multiparty"
"transfer"
"hf-indicators"
boolean InbandRinging [readonly]
@@ -57,7 +66,7 @@ Properties array{string} Features [readonly]
to activate or deactivate the function from the HF, or
the AG could autonomously initiate it.
boolean EchoCancelingNoiseReduction [readwrite]
boolean EchoCancelingNoiseReduction [readwrite, optional]
Non-persistent Boolean property representing whether
echo canceling and noise reduction is enabled in the
@@ -70,3 +79,14 @@ Properties array{string} Features [readonly]
The current charge level of the battery. The value
can be between 0 and 5 respectively.
array{string} SubscriberNumbers [readonly]
List of subscriber numbers provided by the AG.
boolean DistractedDrivingReduction [readwrite, optional]
Non-persistent property representing whether
distracted driving reduction mode should be enabled in
the AG. Support for this feature is optional on the
AG.

View File

@@ -76,6 +76,22 @@ Methods dict GetProperties()
[service].Error.NotImplemented
[service].Error.NotAllowed
fd, byte Acquire()
Attempts to establish the SCO audio connection
returning the filedescriptor of the connection and the
codec in use.
Note: Contrary to Connect this does not call
NewConnection so it can be called in a blocking
manner.
Possible Errors: [service].Error.InProgress
[service].Error.Failed
[service].Error.NotAvailable
[service].Error.NotImplemented
[service].Error.NotAllowed
Signals PropertyChanged(string name, variant value)
This signal indicates a changed value of the given
@@ -89,6 +105,10 @@ Properties string RemoteAddress [readonly]
Bluetooth address of the local adapter.
string Type [readonly]
Type of the card. Valid values are "gateway" or
"handsfree".
Handsfree Audio Agent hierarchy [experimental]
===============================

74
ofono/doc/ims-api.txt Normal file
View File

@@ -0,0 +1,74 @@
IpMultimediaSystem Hierarchy
============================
Service org.ofono
Interface org.ofono.IpMultimediaSystem
Object path [variable prefix]/{modem0,modem1,...}
Methods dict GetProperties()
Returns all IpMultimediaSystem configuration properties.
void SetProperty(string property, variant value)
Changes the value of the specified property. Only
properties that are listed as readwrite are
changeable. On success a PropertyChanged signal
will be emitted.
Possible Errors: [service].Error.AccessDenied
[service].Error.InvalidArguments
[service].Error.Failed
void Register()
Attempts to register to IMS. A successful method return
indicates that the registration process could be
initiated successfully. The actual registration state
will be reflected by the 'Registered' property.
Possible Errors: [service].Error.AccessDenied
[service].Error.NotAllowed
[service].Error.NotImplemented
[service].Error.Failed
void Unregister()
Attempts to unregister from IMS. A successful method
return indicates that the unregistration process could
be initiated successfully. The actual unregistration
state will be reflected by the 'Registered' property.
Possible Errors: [service].Error.AccessDenied
[service].Error.NotImplemented
[service].Error.Failed
Signals PropertyChanged(string property, variant value)
This signal indicates a changed value of the given
property.
Properties boolean Registered [readonly]
Contains the current IMS registration state.
boolean VoiceCapable [readonly, optional]
Boolean representing whether voice call transfer over
RTP (IMS) is available.
boolean SmsCapable [readonly, optional]
Boolean representing whether SMS-over-IMS is available.
string Registration [readwrite, Sailfish OS specific]
The IMS registration strategy. Valid values are:
"disabled" keep registration off
"enabled" manual registration
"auto" keep registration on
The Register() method, if implemented, will fail
with [service].Error.NotAllowed if the value of
this property is "disabled".

View File

@@ -0,0 +1,137 @@
LTE Coexistence hierarchy
=========================
Service org.ofono
Interface org.ofono.intel.LteCoexistence
Object path [variable prefix]/{modem0,modem1,...}
Methods dict GetProperties()
Returns all coexistence configuration properties.
void SetProperty(string property, variant value)
Changes the value of the specified property. Only
properties that are listed as Read-write are changeable.
On success a PropertyChanged signal will be emitted.
Possible Errors: [service].Error.InProgress
[service].Error.InvalidArguments
[service].Error.Failed
void RegisterAgent(object path)
Registers an agent which will be called whenever the
modem initiates LTE Coexistence information.
Possible Errors: [service].Error.InProgress
[service].Error.InvalidArguments
[service].Error.InvalidFormat
[service].Error.Failed
void UnregisterAgent(object path)
Unregisters an agent.
Possible Errors: [service].Error.InvalidArguments
[service].Error.Failed
a(a{sv}) GetPlmnHistory()
Requests for LTE Plmn history list stored in NVM to
retrieve geo location history like MobileNetworkCode,
MobileCountryCode, LteBandsFDD, LteBandsTDD,
ChannelBandwidth.
Refer to the sections below for which property types
are available, their valid value ranges and
applicability to different cell types.
Signals PropertyChanged(string property, variant value)
This signal indicates a changed value of the given
property.
Properties string Band [readwrite]
Frequency band in which the modem is operating when
using "lte" mode.
boolean BTActive [readwrite]
Contains whether BT Coex is activated or not.
boolean WLANActive [readwrite]
Contains whether WLAN Coex is activated or not.
string WLANBandwidth [readwrite]
Contains the frequency WLAN Coex is activated on, when
"CoexWLANActive" is active.
The possible values are:
- "20MHz"
- "40MHz"
- "80MHz"
LTECoexistenceAgent Hierarchy [experimental]
=============================
Service unique name
Interface org.ofono.intel.LteCoexistenceAgent
Object path freely definable
Methods void ReceiveBluetoothNotification(array{byte} notification,
dict info) [noreply]
Requests the agent to process Bluetooth related LTE
Coexistence information. The dictionary info contains
vector table with modem recommended Safe Tx/Rx band and
range information.The properties involved are
'SafeTxMin', 'SafeRxMin', 'SafeTxMax', 'SafeRxMax' and
'SafeVector'.
Possible Errors: None
void ReceiveWiFiNotification(array{byte} notification,
dict info) [noreply]
Requests the agent to process WiFi related LTE
Coexistence information. The dictionary info contains
vector table with modem recommended SafeTx/Rx band and
range information. The properties involved are
'SafeTxMin', 'SafeRxMin', 'SafeTxMax', 'SafeRxMax' and
'SafeVector'.
Possible Errors: None
void Release() [noreply]
Agent is being released, possibly because of oFono
terminating, Coex interface is being torn down or modem
off. No UnregisterAgent call is needed.
LTE Plmn history params
=======================
uint16 MobileNetworkCode [readonly, optional]
Contains the MNC of the cell.
uint16 MobileCountryCode [readonly, optional]
Contains the MCC of the cell.
uint32 LteBandsFDD [readonly, optional]
Contains the Lte FDD band. Valid range of values is 1 to 32 as per
3GPP 36.101 Section 5.5.
uint32 LteBandsTDD [readonly, optional]
Contains the Lte TDD band. Valid range of values is 33 to 64 as per
3GPP 36.101 Section 5.5.
byte ChannelBandwidth [readonly, optional]
Contains the Channel bandwidth. Valid range of values is 0 to 6 as per
3GPP 36.101 Section 5.6.

View File

@@ -13,7 +13,7 @@ Methods dict GetProperties()
filedescriptor Request()
Asks to turn ON the NMEA stream and supplies the
gps device file descriptor. The external cliend should
gps device file descriptor. The external client should
use the file descriptor to receive the NMEA data.
Possible Errors: [service].Error.InProgress

71
ofono/doc/lte-api.txt Normal file
View File

@@ -0,0 +1,71 @@
LongTermEvolution Hierarchy
Service org.ofono
Interface org.ofono.LongTermEvolution
Object path [variable prefix]/{modem0,modem1,...}
Methods dict GetProperties()
Returns all LongTermEvolution configuration properties.
void SetProperty(string property, variant value)
Changes the value of the specified property. Only
properties that are listed as readwrite are
changeable. On success a PropertyChanged signal
will be emitted.
Possible Errors: [service].Error.InProgress
[service].Error.InvalidArguments
[service].Error.Failed
Signals PropertyChanged(string property, variant value)
This signal indicates a changed value of the given
property.
Properties string DefaultAccessPointName [readwrite]
On LongTermEvolution, contexts activate automatically.
This property allows selection of an APN to be used on
next automatic activation.
Setting this property to an empty string clears the
default APN from the modem.
string Protocol [readwrite, experimental]
Holds the protocol for this context. Valid values
are: "ip", "ipv6" and "dual". Default value is "ip".
string AuthenticationMethod [readwrite, experimental]
Sets the Method used for the authentication
for the default APN.
Available values are "none", "pap" and "chap".
Default is "none".
If the AuthenticationMethod is set to 'none',
no authentication is performed for the default attach
APN. Username and Password properties are ignored,
even if containing a valid value. If Username or
Password are empty, AuthenticationMethod is implicitly
assumed to be set to 'none'.
If the default APN supports authentication and it
fails, then it is up to the network how to proceed.
In general LTE access is denied and the modem can
fallback to a legacy technology if capable and another
radio technology is available.
string Username [readwrite, experimental]
Holds the username to be used for authentication
purposes.
string Password [readwrite, experimental]
Holds the password to be used for authentication
purposes.

View File

@@ -104,6 +104,16 @@ Properties string ServiceCenterAddress
"turkish" - Turkish alphabet
"spanish" - Spanish alphabet
"portuguese" - Portuguese alphabet
"bengali" - Bengali alphabet
"gujarati" - Gujarati alphabet
"hindi" - Hindi alphabet
"kannada" - Kannada alphabet
"malayalam" - Malayalam alphabet
"oriya" - Oriya alphabet
"punjabi"- Punjabi alphabet
"tamil" - Tamil alphabet
"telugu" - Telugu alphabet
"urdu" - Urdu alphabet
The standard, language-specific alphabets are defined
in 3GPP TS23.038, Annex A. By default, oFono uses

View File

@@ -90,6 +90,18 @@ Properties boolean Powered [readwrite]
"hfp") this corresponds to the Bluetooth Device
Address of the remote device.
string SoftwareVersionNumber [readonly, optional]
String representing the software version number of the
modem device.
string SystemPath [readonly, optional]
String representing the system path for the modem
device.
For modems detected by udev events, this corresponds to
the modem sysfs path.
array{string} Features [readonly]
List of currently enabled features. It uses simple
@@ -122,6 +134,8 @@ Properties boolean Powered [readwrite]
org.ofono.CallVolume
org.ofono.CellBroadcast
org.ofono.Handsfree
org.ofono.IpMultimediaSystem
org.ofono.LongTermEvolution
org.ofono.LocationReporting
org.ofono.MessageManager
org.ofono.MessageWaiting

View File

@@ -57,6 +57,11 @@ Signals PropertyChanged(string property, variant value)
This signal indicates a changed value of the given
property.
OperatorsChanged(array{object,dict})
Signal that gets emitted when operator list has
changed. It contains the current list of operators.
Properties string Mode [readonly]
The current registration mode. The default of this
@@ -77,7 +82,9 @@ Properties string Mode [readonly]
string Status [readonly]
The current registration status of a modem.
The current registration status of a modem. In case
technology is 'lte', 'registered' and 'roaming' may
not necessarily mean voice calling available.
The possible values are:
"unregistered" Not registered to any network

View File

@@ -0,0 +1,150 @@
Network Monitor hierarchy
=========================
Service org.ofono
Interface org.ofono.NetworkMonitor
Object path [variable prefix]/{modem0,modem1,...}
Methods a{sv} GetServingCellInformation()
Requests the latest serving cell information and basic
measurements from oFono. The returned value is a
dictionary with the possible key / values documented
below. The type of cell is given by the 'Technology'
property.
Based on the type of cell, the dictionary will contain
additional key/value pairs. If a given key/value pair
is not present, then it is not known or unsupported
by the underlying driver.
Refer to the sections below for which property types
are available, their valid value ranges and
applicability to different cell types.
void RegisterAgent(object path)
Registers an agent which will be called whenever the
modem registers to or moves to a new cell.
void UnregisterAgent(object path)
Unregisters an agent.
NetworkMonitorAgent Hierarchy [experimental]
=============================
Service unique name
Interface org.ofono.NetworkMonitorAgent
Object path freely definable
Methods void ServingCellInformationChanged(a{sv}) [noreply]
This method is called whenever the serving cell
information has been updated.
Possible Errors: None
void Release() [noreply]
Agent is being released, possibly because of oFono
terminating, NetworkMonitor interface is being torn
down or modem off. No UnregisterAgent call is needed.
Network Monitor Property Types
==============================
string Technology
Contains the cell type. Possible values are:
"gsm", "umts", "lte"
uint16 LocationAreaCode [optional, gsm, umts]
Contains the current location area code. Valid range of values is
0-65535.
uint32 CellId [optional, gsm, umts]
Contains the current network cell id. Valid range of values is
0-65535 for gsm and 0-268435455 in umts.
string MobileNetworkCode [optional, gsm, umts]
Contains the MNC of the cell.
string MobileCountryCode [optional, gsm, umts]
Contains the MCC of the cell.
uint16 ARFCN [optional, gsm]
Contains the Absolute Radio Frequency Channel Number. Valid range of
values is 0-1023.
byte ReceivedSignalStrength [optional, gsm]
Contains the received signal strength level in dBm. Refer to <rxlev>
in 27.007, Section 8.69 for more details. Valid range of values is
0-63.
byte BSIC [optional, gsm]
Contains the Base Station Identity Code. Valid range of values is 0-63.
byte BitErrorRate [optional, gsm]
Contains the bit error rate. Refer to <ber> in 27.007, Section 8.69
for more details. Valid range of values is 0-7.
uint16 PrimaryScramblingCode [optional, umts]
Contains the scrambling code. Valid range of values is 0-512.
byte TimingAdvance [optional, gsm]
Contains the Timing Advance. Valid range of values is 0-219.
byte Strength [optional, gsm, umts, lte]
Contains the signal strength. Valid values are 0-31. Refer to <rssi>
in 27.007, Section 8.5.
byte ReceivedSignalCodePower [optional, umts]
Contains the Received Signal Code Power. Valid range of values
is 0-96. Refer to <rscp> in 27.007, Section 8.69 for more details.
byte ReceivedEnergyRatio [optional, umts]
Contains the Ratio of received energy per PN chip to the total
received power spectral density. Valid range of values is 0-49.
Refer to <ecno> in 27.007, Section 8.69 for more details.
byte ReferenceSignalReceivedQuality [optional, lte]
Contains the Reference Signal Received Quality. Valid range of
values is 0-34. Refer to <rsrq> in 27.007, Section 8.69 for more
details.
byte ReferenceSignalReceivedPower [optional, lte]
Contains the Reference Signal Received Power. Valid range of values
is 0-97. Refer to <rsrp> in 27.007, Section 8.69 for more details.
uint16 EARFCN [optional, lte]
Contains E-UTRA Absolute Radio Frequency Channel Number. Valid
range of values is 0-65535. Refer to Carrier frequency and
EARFCN in 36.101, Section 5.7.3 for more details.
byte EBand [optional, lte]
Contains E-UTRA operating Band. Valid range of values is 1-43.
Refer to Operating bands in 36.101, Section 5.5 for more
details.
byte ChannelQualityIndicator [optional, lte]
Contains Channel Quality Indicator. Refer to Channel Quality
Indicator definition in 36.213, Section 7.2.3 for more details.

View File

@@ -45,6 +45,11 @@ Properties string TechnologyPreference [readwrite]
"umts" Only UMTS used for radio access.
"lte" Only LTE used for radio access.
array{string} AvailableTechnologies [readonly, optional]
List of values for TechnologyPreference property
supported by the modem.
string GsmBand [readwrite, optional]
Frequency band in which the modem is allowed to

View File

@@ -93,6 +93,11 @@ Properties boolean Present [readonly]
Contains the IMSI of the SIM, if available.
string ServiceProviderName [readonly, optional]
Contains the service provider name fetched from the
SIM card, if available.
string MobileCountryCode [readonly, optional]
Contains the Mobile Country Code (MCC) of the home
@@ -195,3 +200,20 @@ Properties boolean Present [readonly]
might have changed the retry counters, i.e. calls to
ChangePin(), EnterPin(), ResetPin() LockPin(),
UnlockPin().
string ImsPrivateIdentity [readonly, optional]
Contains the SIM's ImsPrivateIdentity, read from the
ISIM.
uint32 CardSlotCount [readonly, experimental]
Contains the count of number of SIM card slots available.
uint32 ActiveCardSlot [readwrite, experimental]
Contains the index of the currently active SIM card slot
for dual SIM single active mode.
This property will range from 1 (default) to
CardSlotCount (max) value.

104
ofono/doc/sim-auth-api.txt Normal file
View File

@@ -0,0 +1,104 @@
SimAuthentication heiarchy [experimental]
===========================================
Service org.ofono
Interface org.ofono.SimAuthentication
Object path [variable prefix]/{modem0,modem1,...}
Methods array{object,dict} GetApplications()
Get an array of all SIM applications found during
discovery. In the format "a{oa{sv}}" where 'o' is
the object path for the application e.g.
o = "/modem1/A0000000871004FFFFFFFF8906190000"
Each dictionary will contain 'Type' e.g. 'Ims' and
'Name' e.g. 'ISim'
For each application there will be a corresponding
object that matches the path (o). The type will
signify which interfaces are under that object (below).
type = Umts --> org.ofono.USimApplication
type = Ims --> org.ofono.ISimApplication
SimAuth USIM application heiarchy [experimental]
===========================================
Service org.ofono
Interface org.ofono.USimApplication
Object path [variable prefix]/{modem0,modem1,...}/{AID name}
Methods dict GetProperties()
Returns properties for the USimApplication. See
properties section for available properties.
array{dict{string, array{byte}}}
GsmAuthenticate(array{array{byte}} rands)
Run the USIM application GSM AUTHENTICATE algorithm
with N random challenges 'rands'. This should be an
array of an array of bytes ("aay"). The number of
random challenges is limited to a maximum of 3.
Returns the derived Kc/SRES values as an array of
dictionaries. The index of each dictionary matches
the index of the rand value in the method call. The
keys for each dictionary are "Kc" and "SRES" and both
are arrays of bytes.
Possible Errors:
[service].Error.NotSupported
[service].Error.Busy
dict{string, array{byte}}
UmtsAuthenticate(array{byte} rand, array{byte} autn)
Run the UMTS AUTHENTICATE algorithm in the 3G
context with 'rand' and 'autn'. A dictionary will be
returned containing 'RES', 'CK', 'IK' and possibly
'Kc' if service 27 is available. If there was a
sync error 'AUTS' will be returned.
Possible Errors: [service].Error.NotSupported
Properties string Type [readonly]
Type of application: 'Umts'
string Name [readonly]
Human readable name: 'USim'
SimAuth ISIM application heiarchy [experimental]
===========================================
Service org.ofono
Interface org.ofono.ISimApplication
Object [variable prefix]/{modem0,modem1,...}/{AID name}
Methods dict GetProperties()
Returns properties for the ISimApplication. See
the properties section for available properties.
dict{string, array{byte}
ImsAuthenticate(array{byte} rand, array{byte} autn)
Run the UMTS AUTHENTICATE algorithm in the IMS
context with 'rand' and 'autn'. A dictionary will be
returned containing 'RES', 'CK', 'IK' and possibly
'Kc' if service 27 is available. If there was a
sync error 'AUTS' will be returned.
Possible Errors: [service].Error.NotSupported
Properties string Type [readonly]
Type of application: 'Ims'
string Name [readonly]
Human readable name: 'ISim'

View File

@@ -10,3 +10,13 @@ On the i-Tetra tracking device, the SIM900 is accessed
via N_GSM mux device. We use ofono as SMS message
service and incoming voice calls service, so we
use /dev/gsmtty1 provided by N_GSM mux.
SIM800 modem usage
==================
When using sim800 modem, the udev rule is the same as the
sim900 rule :
KERNEL=="ttyS3", ENV{OFONO_DRIVER}="sim900"
Because the SIM800 and SIM900 code are the merged into one driver.

46
ofono/doc/telit-modem.txt Normal file
View File

@@ -0,0 +1,46 @@
oFono - Open Source Telephony
*****************************
Purpose
=======
The purpose of this document is to identify issues and configuration
requirements with Telit's modems.
HE910
=====
GPS:
To enable location reporting on the Telit HE910 the modem needs to be
switched to Port Configuration #8. Please refer to Telit's
'HE910 UE910 Family Ports Arrangements' section 4.1.3 for rationale and
'AT Commands Reference Guide' section 3.5.7.1.96 for specific AT command.
After setting the configuration, a power cycle is required.
Port Configiuration #8 is available since firmware 12.00.004. Firmware version
can be checked using 'AT+CGMR'.
LE910 V2
========
Default USB composition of LE910V2 uses PID 0x36 (AT#PORTCFG=0)
and consists of 6 serial ports (CDC-ACM standard, /dev/ttyACMx)
and 1 network adapter using CDC-NCM standard (wwanx or usbx).
NCM interface configuration follows Telit documentation
(both documents available on Telit Download Zone - registration required)
"GE/HE/UE910, UL865, LE910 V2 Linux USB Driver - User Guide r0"
(document 1VV0301255 Rev.0 - 2016-01-22)
and "Telit LE910-V2 NCM SETUP r3"
(document 1VV0301246 Rev.3 - 2016-11-29).
After context is setup, NCM mode activated and PDP context activated
connection configuration can be read using
AT+CGPADDR=context_id and AT+CGCONTRDP=context_id commands.
This is done automatically and results available via
org.ofono.ConnectionContext.GetProperties DBus method.
Then Linux network interface needs to be configured:
ifconfig <Interface> <Address> netmask <Netmask> up
route add default gw <Gateway>
arp -s <Gateway> 11:22:33:44:55:66
Only after these steps network interface is usable.

View File

@@ -59,6 +59,27 @@ Methods dict GetProperties()
[service].Error.NotImplemented
[service].Error.Failed
object DialLast()
Initiates a new outgoing call to the last dialled number.
Possible Errors: [service].Error.InProgress
[service].Error.InvalidArguments
[service].Error.InvalidFormat
[service].Error.NotImplemented
[service].Error.Failed
object DialMemory(string memory position, string hide_callerid)
Initiates a new outgoing call to the number in the given memory
position/favourite. For callerid see the Dial method.
Possible Errors: [service].Error.InProgress
[service].Error.InvalidArguments
[service].Error.InvalidFormat
[service].Error.NotImplemented
[service].Error.Failed
void Transfer()
Joins the currently Active (or Outgoing, depending

View File

@@ -50,15 +50,14 @@ static int atmodem_init(void)
at_call_volume_init();
at_gprs_init();
at_gprs_context_init();
at_sim_auth_init();
at_gnss_init();
at_lte_init();
return 0;
}
static void atmodem_exit(void)
{
at_sim_auth_exit();
at_stk_exit();
at_sim_exit();
at_sms_exit();
@@ -76,6 +75,7 @@ static void atmodem_exit(void)
at_gprs_exit();
at_gprs_context_exit();
at_gnss_exit();
at_lte_exit();
}
OFONO_PLUGIN_DEFINE(atmodem, "AT modem driver", VERSION,

View File

@@ -74,3 +74,6 @@ extern void at_sim_auth_exit(void);
extern void at_gnss_init(void);
extern void at_gnss_exit(void);
extern void at_lte_init(void);
extern void at_lte_exit(void);

View File

@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
* Copyright (C) 2018 Gemalto M2M
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -27,6 +28,7 @@
#include <gatchat.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#define OFONO_API_SUBJECT_TO_CHANGE
#include <ofono/log.h>
@@ -614,3 +616,85 @@ void at_util_sim_state_query_free(struct at_util_sim_state_query *req)
g_free(req);
}
/*
* CGCONTRDP returns addr + netmask in the same string in the form
* of "a.b.c.d.m.m.m.m" for IPv4.
* address/netmask must be able to hold
* 255.255.255.255 + null = 16 characters
*/
int at_util_get_ipv4_address_and_netmask(const char *addrnetmask,
char *address, char *netmask)
{
const char *s = addrnetmask;
const char *net = NULL;
int ret = -EINVAL;
int i;
/* Count 7 dots for ipv4, less or more means error. */
for (i = 0; i < 9; i++, s++) {
s = strchr(s, '.');
if (!s)
break;
if (i == 3) {
/* set netmask ptr and break the string */
net = s + 1;
}
}
if (i == 7) {
memcpy(address, addrnetmask, net - addrnetmask);
address[net - addrnetmask - 1] = '\0';
strcpy(netmask, net);
ret = 0;
}
return ret;
}
int at_util_gprs_auth_method_to_auth_prot(
enum ofono_gprs_auth_method auth_method)
{
switch (auth_method) {
case OFONO_GPRS_AUTH_METHOD_ANY:
case OFONO_GPRS_AUTH_METHOD_PAP:
return 1;
case OFONO_GPRS_AUTH_METHOD_CHAP:
return 2;
case OFONO_GPRS_AUTH_METHOD_NONE:
return 0;
}
return 0;
}
const char *at_util_gprs_proto_to_pdp_type(enum ofono_gprs_proto proto)
{
switch (proto) {
case OFONO_GPRS_PROTO_IPV6:
return "IPV6";
case OFONO_GPRS_PROTO_IPV4V6:
return "IPV4V6";
break;
case OFONO_GPRS_PROTO_IP:
return "IP";
}
return NULL;
}
char *at_util_get_cgdcont_command(guint cid, enum ofono_gprs_proto proto,
const char *apn)
{
const char *pdp_type = at_util_gprs_proto_to_pdp_type(proto);
if (!apn)
return g_strdup_printf("AT+CGDCONT=%u", cid);
return g_strdup_printf("AT+CGDCONT=%u,\"%s\",\"%s\"", cid, pdp_type,
apn);
}

View File

@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
* Copyright (C) 2018 Gemalto M2M
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -83,7 +84,27 @@ struct at_util_sim_state_query *at_util_sim_state_query_new(GAtChat *chat,
GDestroyNotify destroy);
void at_util_sim_state_query_free(struct at_util_sim_state_query *req);
int at_util_get_ipv4_address_and_netmask(const char *addrnetmask,
char *address, char *netmask);
int at_util_gprs_auth_method_to_auth_prot(
enum ofono_gprs_auth_method auth_method);
const char *at_util_gprs_proto_to_pdp_type(enum ofono_gprs_proto proto);
/*
* at_util_get_cgdcont_command
* if the apn pointer is NULL, the context will be removed: the resulting
* string will be like: AT+CGDCONT=7
* but if apn pointer is not NULL and the string is empty, then
* this function will create a normal context with empty apn, like:
* AT+CGDCONT=4,"IPV6",""
*/
char *at_util_get_cgdcont_command(guint cid, enum ofono_gprs_proto proto,
const char *apn);
struct cb_data {
gint ref_count;
void *cb;
void *data;
void *user;
@@ -94,12 +115,29 @@ static inline struct cb_data *cb_data_new(void *cb, void *data)
struct cb_data *ret;
ret = g_new0(struct cb_data, 1);
ret->ref_count = 1;
ret->cb = cb;
ret->data = data;
return ret;
}
static inline struct cb_data *cb_data_ref(struct cb_data *cbd)
{
cbd->ref_count++;
return cbd;
}
static inline void cb_data_unref(gpointer user_data)
{
struct cb_data *cbd = user_data;
if (--cbd->ref_count)
return;
g_free(cbd);
}
static inline int at_util_convert_signal_strength(int strength)
{
int result;

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -212,7 +211,7 @@ static void at_call_barring_remove(struct ofono_call_barring *cb)
ofono_call_barring_set_data(cb, NULL);
}
static struct ofono_call_barring_driver driver = {
static const struct ofono_call_barring_driver driver = {
.name = "atmodem",
.probe = at_call_barring_probe,
.remove = at_call_barring_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -264,7 +263,7 @@ static void at_ccfc_remove(struct ofono_call_forwarding *cf)
ofono_call_forwarding_set_data(cf, NULL);
}
static struct ofono_call_forwarding_driver driver = {
static const struct ofono_call_forwarding_driver driver = {
.name = "atmodem",
.probe = at_ccfc_probe,
.remove = at_ccfc_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -331,7 +330,7 @@ static void at_caoc_remove(struct ofono_call_meter *cm)
ofono_call_meter_set_data(cm, NULL);
}
static struct ofono_call_meter_driver driver = {
static const struct ofono_call_meter_driver driver = {
.name = "atmodem",
.probe = at_caoc_probe,
.remove = at_caoc_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -398,7 +397,7 @@ static void at_call_settings_remove(struct ofono_call_settings *cs)
ofono_call_settings_set_data(cs, NULL);
}
static struct ofono_call_settings_driver driver = {
static const struct ofono_call_settings_driver driver = {
.name = "atmodem",
.probe = at_call_settings_probe,
.remove = at_call_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
@@ -207,7 +206,7 @@ static void at_call_volume_remove(struct ofono_call_volume *cv)
g_free(cvd);
}
static struct ofono_call_volume_driver driver = {
static const struct ofono_call_volume_driver driver = {
.name = "atmodem",
.probe = at_call_volume_probe,
.remove = at_call_volume_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
@@ -48,6 +47,51 @@ struct cbs_data {
unsigned int vendor;
};
static void at_xmm_etw_sec_notify(GAtResult *result, gpointer user_data)
{
struct ofono_cbs *cbs = user_data;
const char *hexpdu;
int pdulen;
GAtResultIter iter;
unsigned char pdu[88];
long hexpdulen;
DBG("");
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+XETWSECWARN:"))
return;
if (!g_at_result_iter_next_number(&iter, &pdulen))
return;
if (pdulen != 88) {
ofono_error("Got a CBM message with invalid PDU size!");
return;
}
hexpdu = g_at_result_pdu(result);
if (hexpdu == NULL) {
ofono_error("Got a CBM, but no PDU. Are we in text mode?");
return;
}
DBG("Got new Cell Broadcast via XETWSECWARN: %s, %d", hexpdu, pdulen);
if (decode_hex_own_buf(hexpdu, -1, &hexpdulen, 0, pdu) == NULL) {
ofono_error("Unable to hex-decode the PDU");
return;
}
if (hexpdulen != pdulen) {
ofono_error("hexpdu length not equal to reported pdu length");
return;
}
ofono_cbs_notify(cbs, pdu, pdulen);
}
static void at_cbm_notify(GAtResult *result, gpointer user_data)
{
struct ofono_cbs *cbs = user_data;
@@ -121,9 +165,14 @@ static void at_cbs_set_topics(struct ofono_cbs *cbs, const char *topics,
switch (data->vendor) {
case OFONO_VENDOR_GOBI:
case OFONO_VENDOR_QUALCOMM_MSM:
case OFONO_VENDOR_GEMALTO:
g_at_chat_send(data->chat, "AT+CSCB=0", none_prefix,
NULL, NULL, NULL);
break;
case OFONO_VENDOR_XMM:
g_at_chat_send(data->chat, "AT+XETWNTFYSTART=2", none_prefix,
NULL, NULL, NULL);
break;
default:
break;
}
@@ -151,6 +200,10 @@ static void at_cbs_clear_topics(struct ofono_cbs *cbs,
DBG("");
if (data->vendor == OFONO_VENDOR_XMM)
g_at_chat_send(data->chat, "AT+XETWNTFYSTOP=2", none_prefix,
NULL, NULL, NULL);
if (g_at_chat_send(data->chat, "AT+CSCB=0", none_prefix,
at_cscb_set_cb, cbd, g_free) > 0)
return;
@@ -175,6 +228,10 @@ static void at_cbs_register(gboolean ok, GAtResult *result, gpointer user)
*/
g_at_chat_register(data->chat, "+CBM:", at_cbm_notify, TRUE, cbs, NULL);
if (data->vendor == OFONO_VENDOR_XMM)
g_at_chat_register(data->chat, "+XETWSECWARN:",
at_xmm_etw_sec_notify, TRUE, cbs, NULL);
ofono_cbs_register(cbs);
}
@@ -223,6 +280,13 @@ static int at_cbs_probe(struct ofono_cbs *cbs, unsigned int vendor,
ofono_cbs_set_data(cbs, data);
if (vendor == OFONO_VENDOR_XMM) {
g_at_chat_send(data->chat, "AT+XCMAS=1", cscb_prefix,
NULL, NULL, NULL);
g_at_chat_send(data->chat, "AT+XETWCFG=1,1,0,0; ", none_prefix,
NULL, NULL, NULL);
}
g_at_chat_send(data->chat, "AT+CSCB=?", cscb_prefix,
at_cscb_support_cb, cbs, NULL);
@@ -239,7 +303,7 @@ static void at_cbs_remove(struct ofono_cbs *cbs)
g_free(data);
}
static struct ofono_cbs_driver driver = {
static const struct ofono_cbs_driver driver = {
.name = "atmodem",
.probe = at_cbs_probe,
.remove = at_cbs_remove,

View File

@@ -153,7 +153,7 @@ static void at_devinfo_remove(struct ofono_devinfo *info)
g_at_chat_unref(chat);
}
static struct ofono_devinfo_driver driver = {
static const struct ofono_devinfo_driver driver = {
.name = "atmodem",
.probe = at_devinfo_probe,
.remove = at_devinfo_remove,

View File

@@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -263,7 +262,7 @@ static void at_gnss_remove(struct ofono_gnss *gnss)
g_free(gd);
}
static struct ofono_gnss_driver driver = {
static const struct ofono_gnss_driver driver = {
.name = "atmodem",
.probe = at_gnss_probe,
.remove = at_gnss_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -43,10 +42,11 @@
#include "atmodem.h"
#include "vendor.h"
#define TUN_SYSFS_DIR "/sys/devices/virtual/misc/tun"
#define TUN_DEV "/dev/net/tun"
#define STATIC_IP_NETMASK "255.255.255.255"
static const char *cgdata_prefix[] = { "+CGDATA:", NULL };
static const char *none_prefix[] = { NULL };
enum state {
@@ -59,6 +59,7 @@ enum state {
struct gprs_context_data {
GAtChat *chat;
unsigned int active_context;
GAtPPPAuthMethod auth_method;
char username[OFONO_GPRS_MAX_USERNAME_LENGTH + 1];
char password[OFONO_GPRS_MAX_PASSWORD_LENGTH + 1];
GAtPPP *ppp;
@@ -66,6 +67,7 @@ struct gprs_context_data {
ofono_gprs_context_cb_t cb;
void *cb_data; /* Callback data */
unsigned int vendor;
gboolean use_atd99;
};
static void ppp_debug(const char *str, void *data)
@@ -154,6 +156,7 @@ static gboolean setup_ppp(struct ofono_gprs_context *gc)
if (getenv("OFONO_PPP_DEBUG"))
g_at_ppp_set_debug(gcd->ppp, ppp_debug, "PPP");
g_at_ppp_set_auth_method(gcd->ppp, gcd->auth_method);
g_at_ppp_set_credentials(gcd->ppp, gcd->username, gcd->password);
/* set connect and disconnect callbacks */
@@ -208,7 +211,7 @@ static void at_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
return;
}
if (gcd->vendor == OFONO_VENDOR_SIMCOM_SIM900)
if (gcd->use_atd99)
sprintf(buf, "ATD*99***%u#", gcd->active_context);
else
sprintf(buf, "AT+CGDATA=\"PPP\",%u", gcd->active_context);
@@ -243,6 +246,20 @@ static void at_gprs_activate_primary(struct ofono_gprs_context *gc,
memcpy(gcd->username, ctx->username, sizeof(ctx->username));
memcpy(gcd->password, ctx->password, sizeof(ctx->password));
/* We only support CHAP and PAP */
switch (ctx->auth_method) {
case OFONO_GPRS_AUTH_METHOD_ANY:
case OFONO_GPRS_AUTH_METHOD_NONE:
case OFONO_GPRS_AUTH_METHOD_CHAP:
gcd->auth_method = G_AT_PPP_AUTH_METHOD_CHAP;
break;
case OFONO_GPRS_AUTH_METHOD_PAP:
gcd->auth_method = G_AT_PPP_AUTH_METHOD_PAP;
break;
default:
goto error;
}
gcd->state = STATE_ENABLING;
if (gcd->vendor == OFONO_VENDOR_ZTE) {
@@ -268,9 +285,36 @@ static void at_gprs_activate_primary(struct ofono_gprs_context *gc,
len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IP\"", ctx->cid);
if (ctx->apn)
snprintf(buf + len, sizeof(buf) - len - 3, ",\"%s\"",
ctx->apn);
if (ctx->apn) {
switch (gcd->vendor) {
case OFONO_VENDOR_UBLOX:
/*
* U-blox modems require a magic prefix to the APN to
* specify the authentication method to use in the
* network. See UBX-13002752 - R21.
*
* As the response of the read command omits this magic
* prefix, this is the least invasive place to set it.
*/
switch (ctx->auth_method) {
case OFONO_GPRS_AUTH_METHOD_ANY:
case OFONO_GPRS_AUTH_METHOD_NONE:
case OFONO_GPRS_AUTH_METHOD_CHAP:
snprintf(buf + len, sizeof(buf) - len - 3,
",\"CHAP:%s\"", ctx->apn);
break;
case OFONO_GPRS_AUTH_METHOD_PAP:
snprintf(buf + len, sizeof(buf) - len - 3,
",\"PAP:%s\"", ctx->apn);
break;
}
break;
default:
snprintf(buf + len, sizeof(buf) - len - 3, ",\"%s\"",
ctx->apn);
break;
}
}
if (g_at_chat_send(gcd->chat, buf, none_prefix,
at_cgdcont_cb, gc, NULL) > 0)
@@ -339,6 +383,43 @@ static void cgev_notify(GAtResult *result, gpointer user_data)
g_at_ppp_shutdown(gcd->ppp);
}
static void at_cgdata_test_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct ofono_gprs_context *gc = user_data;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
GAtResultIter iter;
const char *data_type;
gboolean found = FALSE;
gcd->use_atd99 = TRUE;
if (!ok) {
DBG("not ok");
goto error;
}
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+CGDATA:")) {
DBG("no +CGDATA line");
goto error;
}
if (!g_at_result_iter_open_list(&iter)) {
DBG("no list found");
goto error;
}
while (!found && g_at_result_iter_next_string(&iter, &data_type)) {
if (g_str_equal(data_type, "PPP")) {
found = TRUE;
gcd->use_atd99 = FALSE;
}
}
error:
DBG("use_atd99:%d", gcd->use_atd99);
}
static int at_gprs_context_probe(struct ofono_gprs_context *gc,
unsigned int vendor, void *data)
{
@@ -348,7 +429,7 @@ static int at_gprs_context_probe(struct ofono_gprs_context *gc,
DBG("");
if (stat(TUN_SYSFS_DIR, &st) < 0) {
if (stat(TUN_DEV, &st) < 0) {
ofono_error("Missing support for TUN/TAP devices");
return -ENODEV;
}
@@ -366,6 +447,15 @@ static int at_gprs_context_probe(struct ofono_gprs_context *gc,
if (chat == NULL)
return 0;
switch (vendor) {
case OFONO_VENDOR_SIMCOM_SIM900:
gcd->use_atd99 = FALSE;
break;
default:
g_at_chat_send(chat, "AT+CGDATA=?", cgdata_prefix,
at_cgdata_test_cb, gc, NULL);
}
g_at_chat_register(chat, "+CGEV:", cgev_notify, FALSE, gc, NULL);
return 0;
@@ -374,10 +464,19 @@ static int at_gprs_context_probe(struct ofono_gprs_context *gc,
static void at_gprs_context_remove(struct ofono_gprs_context *gc)
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
GAtIO *io;
DBG("");
if (gcd->state != STATE_IDLE && gcd->ppp) {
if ((gcd->vendor == OFONO_VENDOR_HUAWEI) && gcd->chat) {
/* immediately send escape sequence */
io = g_at_chat_get_io(gcd->chat);
if (io)
g_at_io_write(io, "+++", 3);
}
g_at_ppp_unref(gcd->ppp);
g_at_chat_resume(gcd->chat);
}
@@ -388,7 +487,7 @@ static void at_gprs_context_remove(struct ofono_gprs_context *gc)
g_free(gcd);
}
static struct ofono_gprs_context_driver driver = {
static const struct ofono_gprs_context_driver driver = {
.name = "atmodem",
.probe = at_gprs_context_probe,
.remove = at_gprs_context_remove,

View File

@@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -49,6 +48,9 @@ static const char *none_prefix[] = { NULL };
struct gprs_data {
GAtChat *chat;
unsigned int vendor;
unsigned int last_auto_context_id;
gboolean telit_try_reattach;
int attached;
};
static void at_cgatt_cb(gboolean ok, GAtResult *result, gpointer user_data)
@@ -72,8 +74,10 @@ static void at_gprs_set_attached(struct ofono_gprs *gprs, int attached,
snprintf(buf, sizeof(buf), "AT+CGATT=%i", attached ? 1 : 0);
if (g_at_chat_send(gd->chat, buf, none_prefix,
at_cgatt_cb, cbd, g_free) > 0)
at_cgatt_cb, cbd, g_free) > 0) {
gd->attached = attached;
return;
}
g_free(cbd);
@@ -141,6 +145,48 @@ static void at_gprs_registration_status(struct ofono_gprs *gprs,
CALLBACK_WITH_FAILURE(cb, -1, data);
}
static void at_cgdcont_read_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct ofono_gprs *gprs = user_data;
struct gprs_data *gd = ofono_gprs_get_data(gprs);
int activated_cid = gd->last_auto_context_id;
const char *apn = NULL;
GAtResultIter iter;
DBG("ok %d", ok);
if (!ok) {
ofono_warn("Can't read CGDCONT contexts.");
return;
}
g_at_result_iter_init(&iter, result);
while (g_at_result_iter_next(&iter, "+CGDCONT:")) {
int read_cid;
if (!g_at_result_iter_next_number(&iter, &read_cid))
break;
if (read_cid != activated_cid)
continue;
/* ignore protocol */
g_at_result_iter_skip_next(&iter);
g_at_result_iter_next_string(&iter, &apn);
break;
}
if (apn)
ofono_gprs_cid_activated(gprs, activated_cid, apn);
else
ofono_warn("cid %u: Received activated but no apn present",
activated_cid);
}
static void cgreg_notify(GAtResult *result, gpointer user_data)
{
struct ofono_gprs *gprs = user_data;
@@ -151,12 +197,35 @@ static void cgreg_notify(GAtResult *result, gpointer user_data)
NULL, NULL, NULL, gd->vendor) == FALSE)
return;
/*
* Telit AT modem firmware (tested with UE910-EUR) generates
* +CGREG: 0\r\n\r\n+CGEV: NW DETACH
* after a context is de-activated and ppp connection closed.
* Then, after a random amount of time (observed from a few seconds
* to a few hours), an unsolicited +CGREG: 1 arrives.
* Attempt to fix the problem, by sending AT+CGATT=1 once.
* This does not re-activate the context, but if a network connection
* is still correct, will generate an immediate +CGREG: 1.
*/
if (gd->vendor == OFONO_VENDOR_TELIT) {
if (gd->attached && !status && !gd->telit_try_reattach) {
DBG("Trying to re-attach gprs network");
gd->telit_try_reattach = TRUE;
g_at_chat_send(gd->chat, "AT+CGATT=1", none_prefix,
NULL, NULL, NULL);
return;
}
gd->telit_try_reattach = FALSE;
}
ofono_gprs_status_notify(gprs, status);
}
static void cgev_notify(GAtResult *result, gpointer user_data)
{
struct ofono_gprs *gprs = user_data;
struct gprs_data *gd = ofono_gprs_get_data(gprs);
GAtResultIter iter;
const char *event;
@@ -170,8 +239,18 @@ static void cgev_notify(GAtResult *result, gpointer user_data)
if (g_str_equal(event, "NW DETACH") ||
g_str_equal(event, "ME DETACH")) {
if (gd->vendor == OFONO_VENDOR_TELIT &&
gd->telit_try_reattach)
return;
gd->attached = FALSE;
ofono_gprs_detached_notify(gprs);
return;
} else if (g_str_has_prefix(event, "ME PDN ACT")) {
sscanf(event, "%*s %*s %*s %u", &gd->last_auto_context_id);
g_at_chat_send(gd->chat, "AT+CGDCONT?", cgdcont_prefix,
at_cgdcont_read_cb, gprs, NULL);
}
}
@@ -247,6 +326,26 @@ static void huawei_mode_notify(GAtResult *result, gpointer user_data)
ofono_gprs_bearer_notify(gprs, bearer);
}
static void huawei_hcsq_notify(GAtResult *result, gpointer user_data)
{
struct ofono_gprs *gprs = user_data;
GAtResultIter iter;
const char *mode;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "^HCSQ:"))
return;
if (!g_at_result_iter_next_string(&iter, &mode))
return;
if (!strcmp("LTE", mode))
ofono_gprs_bearer_notify(gprs, 7); /* LTE */
/* in other modes, notification ^MODE is used */
}
static void telit_mode_notify(GAtResult *result, gpointer user_data)
{
struct ofono_gprs *gprs = user_data;
@@ -274,6 +373,9 @@ static void telit_mode_notify(GAtResult *result, gpointer user_data)
case 3:
bearer = 5; /* HSDPA */
break;
case 4:
bearer = 7; /* LTE */
break;
default:
bearer = 0;
break;
@@ -282,6 +384,40 @@ static void telit_mode_notify(GAtResult *result, gpointer user_data)
ofono_gprs_bearer_notify(gprs, bearer);
}
static void ublox_ureg_notify(GAtResult *result, gpointer user_data)
{
struct ofono_gprs *gprs = user_data;
GAtResultIter iter;
gint state, bearer;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+UREG:"))
return;
if (!g_at_result_iter_next_number(&iter, &state))
return;
switch (state) {
case 4:
bearer = 5;
break;
case 5:
bearer = 4;
break;
case 8:
bearer = 1;
break;
case 9:
bearer = 2;
break;
default:
bearer = state;
}
ofono_gprs_bearer_notify(gprs, bearer);
}
static void cpsb_notify(GAtResult *result, gpointer user_data)
{
struct ofono_gprs *gprs = user_data;
@@ -315,12 +451,21 @@ static void gprs_initialized(gboolean ok, GAtResult *result, gpointer user_data)
case OFONO_VENDOR_HUAWEI:
g_at_chat_register(gd->chat, "^MODE:", huawei_mode_notify,
FALSE, gprs, NULL);
g_at_chat_register(gd->chat, "^HCSQ:", huawei_hcsq_notify,
FALSE, gprs, NULL);
break;
case OFONO_VENDOR_UBLOX:
g_at_chat_register(gd->chat, "+UREG:", ublox_ureg_notify,
FALSE, gprs, NULL);
g_at_chat_send(gd->chat, "AT+UREG=1", none_prefix,
NULL, NULL, NULL);
break;
case OFONO_VENDOR_TELIT:
g_at_chat_register(gd->chat, "#PSNT:", telit_mode_notify,
FALSE, gprs, NULL);
g_at_chat_send(gd->chat, "AT#PSNT=1", none_prefix,
NULL, NULL, NULL);
break;
default:
g_at_chat_register(gd->chat, "+CPSB:", cpsb_notify,
FALSE, gprs, NULL);
@@ -432,7 +577,7 @@ static void at_cgdcont_test_cb(gboolean ok, GAtResult *result,
if (g_at_result_iter_next_range(&iter, &min, &max) == FALSE)
continue;
if (!g_at_result_iter_close_list(&iter))
if (!g_at_result_iter_skip_next(&iter))
continue;
if (g_at_result_iter_open_list(&iter))
@@ -495,7 +640,7 @@ static void at_gprs_remove(struct ofono_gprs *gprs)
g_free(gd);
}
static struct ofono_gprs_driver driver = {
static const struct ofono_gprs_driver driver = {
.name = "atmodem",
.probe = at_gprs_probe,
.remove = at_gprs_remove,

185
ofono/drivers/atmodem/lte.c Normal file
View File

@@ -0,0 +1,185 @@
/*
*
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Intel Corporation. All rights reserved.
* Copyright (C) 2018 Gemalto M2M
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <glib.h>
#include <ofono/modem.h>
#include <ofono/gprs-context.h>
#include <ofono/log.h>
#include <ofono/lte.h>
#include "gatchat.h"
#include "gatresult.h"
#include "atmodem.h"
static const char *none_prefix[] = { NULL };
struct lte_driver_data {
GAtChat *chat;
struct ofono_lte_default_attach_info pending_info;
};
static void at_lte_set_auth_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_lte_cb_t cb = cbd->cb;
struct ofono_error error;
decode_at_error(&error, g_at_result_final_response(result));
cb(&error, cbd->data);
}
static void at_lte_set_default_attach_info_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_lte_cb_t cb = cbd->cb;
void *data = cbd->data;
struct lte_driver_data *ldd = cbd->user;
struct ofono_error error;
char buf[32 + OFONO_GPRS_MAX_USERNAME_LENGTH +
OFONO_GPRS_MAX_PASSWORD_LENGTH + 1];
size_t buflen = sizeof(buf);
size_t len;
enum ofono_gprs_auth_method auth_method;
if (!ok) {
decode_at_error(&error, g_at_result_final_response(result));
cb(&error, data);
return;
}
auth_method = ldd->pending_info.auth_method;
/* change the authentication method if the parameters are invalid */
if (!*ldd->pending_info.username || !*ldd->pending_info.password)
auth_method = OFONO_GPRS_AUTH_METHOD_NONE;
len = snprintf(buf, buflen, "AT+CGAUTH=0,%d",
at_util_gprs_auth_method_to_auth_prot(auth_method));
buflen -= len;
if (auth_method != OFONO_GPRS_AUTH_METHOD_NONE)
snprintf(buf + len, buflen, ",\"%s\",\"%s\"",
ldd->pending_info.username,
ldd->pending_info.password);
cbd = cb_data_ref(cbd);
if (g_at_chat_send(ldd->chat, buf, none_prefix,
at_lte_set_auth_cb, cbd, cb_data_unref) > 0)
return;
cb_data_unref(cbd);
CALLBACK_WITH_FAILURE(cb, data);
}
static void at_lte_set_default_attach_info(const struct ofono_lte *lte,
const struct ofono_lte_default_attach_info *info,
ofono_lte_cb_t cb, void *data)
{
struct lte_driver_data *ldd = ofono_lte_get_data(lte);
struct cb_data *cbd = cb_data_new(cb, data);
char *buf = at_util_get_cgdcont_command(0, info->proto, info->apn);
cbd->user = ldd;
memcpy(&ldd->pending_info, info, sizeof(ldd->pending_info));
if (g_at_chat_send(ldd->chat, buf, none_prefix,
at_lte_set_default_attach_info_cb,
cbd, cb_data_unref) > 0)
goto end;
cb_data_unref(cbd);
CALLBACK_WITH_FAILURE(cb, data);
end:
g_free(buf);
}
static gboolean lte_delayed_register(gpointer user_data)
{
struct ofono_lte *lte = user_data;
ofono_lte_register(lte);
return FALSE;
}
static int at_lte_probe(struct ofono_lte *lte, unsigned int vendor, void *data)
{
GAtChat *chat = data;
struct lte_driver_data *ldd;
DBG("at lte probe");
ldd = g_try_new0(struct lte_driver_data, 1);
if (!ldd)
return -ENOMEM;
ldd->chat = g_at_chat_clone(chat);
ofono_lte_set_data(lte, ldd);
g_idle_add(lte_delayed_register, lte);
return 0;
}
static void at_lte_remove(struct ofono_lte *lte)
{
struct lte_driver_data *ldd = ofono_lte_get_data(lte);
DBG("at lte remove");
g_at_chat_unref(ldd->chat);
ofono_lte_set_data(lte, NULL);
g_free(ldd);
}
static const struct ofono_lte_driver driver = {
.name = "atmodem",
.probe = at_lte_probe,
.remove = at_lte_remove,
.set_default_attach_info = at_lte_set_default_attach_info,
};
void at_lte_init(void)
{
ofono_lte_driver_register(&driver);
}
void at_lte_exit(void)
{
ofono_lte_driver_unregister(&driver);
}

View File

@@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -48,6 +47,7 @@ static const char *cops_prefix[] = { "+COPS:", NULL };
static const char *csq_prefix[] = { "+CSQ:", NULL };
static const char *cind_prefix[] = { "+CIND:", NULL };
static const char *cmer_prefix[] = { "+CMER:", NULL };
static const char *smoni_prefix[] = { "^SMONI:", NULL };
static const char *zpas_prefix[] = { "+ZPAS:", NULL };
static const char *option_tech_prefix[] = { "_OCTI:", "_OUWCTI:", NULL };
@@ -178,6 +178,31 @@ static int option_parse_tech(GAtResult *result)
return tech;
}
static int gemalto_parse_tech(GAtResult *result)
{
int tech = -1;
GAtResultIter iter;
const char *technology;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "^SMONI: "))
return tech;
if (!g_at_result_iter_next_unquoted_string(&iter, &technology))
return tech;
if (strcmp(technology, "2G") == 0) {
tech = ACCESS_TECHNOLOGY_GSM_EGPRS;
} else if (strcmp(technology, "3G") == 0) {
tech = ACCESS_TECHNOLOGY_UTRAN;
} else if (strcmp(technology, "4G") == 0) {
tech = ACCESS_TECHNOLOGY_EUTRAN;
}
return tech;
}
static void at_creg_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
@@ -202,9 +227,25 @@ static void at_creg_cb(gboolean ok, GAtResult *result, gpointer user_data)
if ((status == 1 || status == 5) && (tech == -1))
tech = nd->tech;
/* 6-10 is EUTRAN, with 8 being emergency bearer case */
if (status > 5 && tech == -1)
tech = ACCESS_TECHNOLOGY_EUTRAN;
cb(&error, status, lac, ci, tech, cbd->data);
}
static void gemalto_query_tech_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct tech_query *tq = user_data;
int tech;
tech = gemalto_parse_tech(result);
ofono_netreg_status_notify(tq->netreg,
tq->status, tq->lac, tq->ci, tech);
}
static void zte_tech_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
@@ -838,6 +879,39 @@ static void telit_ciev_notify(GAtResult *result, gpointer user_data)
ofono_netreg_strength_notify(netreg, strength);
}
static void gemalto_ciev_notify(GAtResult *result, gpointer user_data)
{
struct ofono_netreg *netreg = user_data;
struct netreg_data *nd = ofono_netreg_get_data(netreg);
const char *signal_identifier = "rssi";
const char *ind_str;
int strength;
GAtResultIter iter;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+CIEV:"))
return;
if (!g_at_result_iter_next_unquoted_string(&iter, &ind_str))
return;
if (!g_str_equal(signal_identifier, ind_str))
return;
if (!g_at_result_iter_next_number(&iter, &strength))
return;
DBG("rssi %d", strength);
if (strength == nd->signal_invalid)
strength = -1;
else
strength = (strength * 100) / (nd->signal_max - nd->signal_min);
ofono_netreg_strength_notify(netreg, strength);
}
static void ctzv_notify(GAtResult *result, gpointer user_data)
{
struct ofono_netreg *netreg = user_data;
@@ -1055,6 +1129,27 @@ static void huawei_mode_notify(GAtResult *result, gpointer user_data)
}
}
static void huawei_hcsq_notify(GAtResult *result, gpointer user_data)
{
struct ofono_netreg *netreg = user_data;
struct netreg_data *nd = ofono_netreg_get_data(netreg);
GAtResultIter iter;
const char *mode;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "^HCSQ:"))
return;
if (!g_at_result_iter_next_string(&iter, &mode))
return;
if (!strcmp("LTE", mode))
nd->tech = ACCESS_TECHNOLOGY_EUTRAN;
/* for other technologies, notification ^MODE is used */
}
static void huawei_nwtime_notify(GAtResult *result, gpointer user_data)
{
struct ofono_netreg *netreg = user_data;
@@ -1464,6 +1559,12 @@ static void creg_notify(GAtResult *result, gpointer user_data)
option_query_tech_cb, tq, g_free) > 0)
return;
break;
case OFONO_VENDOR_GEMALTO:
if (g_at_chat_send(nd->chat, "AT^SMONI",
smoni_prefix,
gemalto_query_tech_cb, tq, g_free) > 0)
return;
break;
}
g_free(tq);
@@ -1547,17 +1648,31 @@ static inline ofono_bool_t append_cmer_element(char *buf, int *len, int cap,
static ofono_bool_t build_cmer_string(char *buf, int *cmer_opts,
struct netreg_data *nd)
{
const char *mode;
const char *ind;
int len = sprintf(buf, "AT+CMER=");
const char *mode;
DBG("");
switch (nd->vendor) {
case OFONO_VENDOR_UBLOX:
/* For all u-blox models, mode 3 is equivalent to mode 1;
* since some models do not support setting modes 2 nor 3
* (see UBX-13002752), we prefer mode 1 for all models.
*/
mode = "1";
break;
default:
mode = "3";
break;
}
/*
* Forward unsolicited result codes directly to the TE;
* TATE link specific inband technique used to embed result codes and
* data when TA is in online data mode
*/
if (!append_cmer_element(buf, &len, cmer_opts[0], "3", FALSE))
if (!append_cmer_element(buf, &len, cmer_opts[0], mode, FALSE))
return FALSE;
/* No keypad event reporting */
@@ -1574,14 +1689,14 @@ static ofono_bool_t build_cmer_string(char *buf, int *cmer_opts,
* Telit does not support mode 1.
* All indicator events shall be directed from TA to TE.
*/
mode = "2";
ind = "2";
break;
default:
/*
* Only those indicator events, which are not caused by +CIND
* shall be indicated by the TA to the TE.
*/
mode = "1";
ind = "1";
break;
}
@@ -1590,7 +1705,7 @@ static ofono_bool_t build_cmer_string(char *buf, int *cmer_opts,
* <ind> indicates the indicator order number (as specified for +CIND)
* and <value> is the new value of indicator.
*/
if (!append_cmer_element(buf, &len, cmer_opts[3], mode, TRUE))
if (!append_cmer_element(buf, &len, cmer_opts[3], ind, TRUE))
return FALSE;
return TRUE;
@@ -1852,6 +1967,10 @@ static void at_creg_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
g_at_chat_register(nd->chat, "^MODE:", huawei_mode_notify,
FALSE, netreg, NULL);
/* Register for 4G system mode reports */
g_at_chat_register(nd->chat, "^HCSQ:", huawei_hcsq_notify,
FALSE, netreg, NULL);
/* Register for network time reports */
g_at_chat_register(nd->chat, "^NWTIME:", huawei_nwtime_notify,
FALSE, netreg, NULL);
@@ -1915,6 +2034,27 @@ static void at_creg_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
g_at_chat_send(nd->chat, "AT*TLTS=1", none_prefix,
NULL, NULL, NULL);
break;
case OFONO_VENDOR_GEMALTO:
/*
* We can't set rssi bounds from Gemalto responses
* so set them up to specified values here
*
* Gemalto rssi signal strength specified as:
* 0 <= -112dBm
* 1 - 4 signal strengh in 15 dB steps
* 5 >= -51 dBm
* 99 not known or undetectable
*/
nd->signal_min = 0;
nd->signal_max = 5;
nd->signal_invalid = 99;
/* Register for specific signal strength reports */
g_at_chat_send(nd->chat, "AT^SIND=\"rssi\",1", none_prefix,
NULL, NULL, NULL);
g_at_chat_register(nd->chat, "+CIEV:",
gemalto_ciev_notify, FALSE, netreg, NULL);
break;
case OFONO_VENDOR_NOKIA:
case OFONO_VENDOR_SAMSUNG:
/* Signal strength reporting via CIND is not supported */
@@ -2017,7 +2157,7 @@ static void at_netreg_remove(struct ofono_netreg *netreg)
g_free(nd);
}
static struct ofono_netreg_driver driver = {
static const struct ofono_netreg_driver driver = {
.name = "atmodem",
.probe = at_netreg_probe,
.remove = at_netreg_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -593,7 +592,7 @@ static void at_phonebook_remove(struct ofono_phonebook *pb)
g_free(pbd);
}
static struct ofono_phonebook_driver driver = {
static const struct ofono_phonebook_driver driver = {
.name = "atmodem",
.probe = at_phonebook_probe,
.remove = at_phonebook_remove,

View File

@@ -1,164 +0,0 @@
/*
*
* oFono - Open Source Telephony
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <glib.h>
#include <ofono/modem.h>
#include <ofono/sim-auth.h>
#include "gatchat.h"
#include "gatresult.h"
#include "simutil.h"
#include "vendor.h"
#include "atmodem.h"
struct sim_auth_data {
GAtChat *chat;
unsigned int vendor;
};
static const char *cuad_prefix[] = { "+CUAD:", NULL };
static void at_discover_apps_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
GAtResultIter iter;
ofono_sim_list_apps_cb_t cb = cbd->cb;
struct ofono_error error;
const unsigned char *dataobj;
gint linelen;
unsigned char *buffer;
int len;
decode_at_error(&error, g_at_result_final_response(result));
if (!ok) {
cb(&error, NULL, 0, cbd->data);
return;
}
g_at_result_iter_init(&iter, result);
len = 0;
while (g_at_result_iter_next(&iter, "+CUAD:")) {
if (!g_at_result_iter_next_hexstring(&iter, NULL, &linelen))
goto error;
len += linelen;
}
g_at_result_iter_init(&iter, result);
buffer = g_malloc(len);
len = 0;
while (g_at_result_iter_next(&iter, "+CUAD:")) {
g_at_result_iter_next_hexstring(&iter, &dataobj, &linelen);
memcpy(buffer + len, dataobj, linelen);
len += linelen;
}
cb(&error, buffer, len, cbd->data);
g_free(buffer);
return;
error:
CALLBACK_WITH_FAILURE(cb, NULL, 0, cbd->data);
}
static void at_discover_apps(struct ofono_sim_auth *sa,
ofono_sim_list_apps_cb_t cb,
void *data)
{
struct sim_auth_data *sad = ofono_sim_auth_get_data(sa);
struct cb_data *cbd = cb_data_new(cb, data);
if (g_at_chat_send(sad->chat, "AT+CUAD", cuad_prefix,
at_discover_apps_cb, cbd, g_free) > 0)
return;
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, NULL, 0, data);
}
static gboolean at_sim_auth_register(gpointer user)
{
struct ofono_sim_auth *sa = user;
ofono_sim_auth_register(sa);
return FALSE;
}
static int at_sim_auth_probe(struct ofono_sim_auth *sa, unsigned int vendor,
void *data)
{
GAtChat *chat = data;
struct sim_auth_data *sad;
sad = g_new0(struct sim_auth_data, 1);
sad->chat = g_at_chat_clone(chat);
sad->vendor = vendor;
ofono_sim_auth_set_data(sa, sad);
g_idle_add(at_sim_auth_register, sa);
return 0;
}
static void at_sim_auth_remove(struct ofono_sim_auth *sa)
{
struct sim_auth_data *sad = ofono_sim_auth_get_data(sa);
g_idle_remove_by_data(sa);
ofono_sim_auth_set_data(sa, NULL);
g_at_chat_unref(sad->chat);
g_free(sad);
}
static struct ofono_sim_auth_driver driver = {
.name = "atmodem",
.probe = at_sim_auth_probe,
.remove = at_sim_auth_remove,
.list_apps = at_discover_apps,
};
void at_sim_auth_init(void)
{
ofono_sim_auth_driver_register(&driver);
}
void at_sim_auth_exit(void)
{
ofono_sim_auth_driver_unregister(&driver);
}

File diff suppressed because it is too large Load Diff

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -104,7 +103,7 @@ static void at_csca_set(struct ofono_sms *sms,
{
struct sms_data *data = ofono_sms_get_data(sms);
struct cb_data *cbd = cb_data_new(cb, user_data);
char buf[64];
char buf[128];
snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type);
@@ -220,9 +219,16 @@ static void at_cmgs(struct ofono_sms *sms, const unsigned char *pdu,
int len;
if (mms) {
snprintf(buf, sizeof(buf), "AT+CMMS=%d", mms);
g_at_chat_send(data->chat, buf, none_prefix,
NULL, NULL, NULL);
switch (data->vendor) {
case OFONO_VENDOR_GEMALTO:
/* no mms support */
break;
default:
snprintf(buf, sizeof(buf), "AT+CMMS=%d", mms);
g_at_chat_send(data->chat, buf, none_prefix,
NULL, NULL, NULL);
break;
}
}
len = snprintf(buf, sizeof(buf), "AT+CMGS=%d\r", tpdu_len);
@@ -319,26 +325,6 @@ static void at_cnma_cb(gboolean ok, GAtResult *result, gpointer user_data)
"Further SMS reception is not guaranteed");
}
static gboolean at_parse_cmt(GAtResult *result, const char **pdu, int *pdulen)
{
GAtResultIter iter;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+CMT:"))
return FALSE;
if (!g_at_result_iter_skip_next(&iter))
return FALSE;
if (!g_at_result_iter_next_number(&iter, pdulen))
return FALSE;
*pdu = g_at_result_pdu(result);
return TRUE;
}
static inline void at_ack_delivery(struct ofono_sms *sms)
{
struct sms_data *data = ofono_sms_get_data(sms);
@@ -347,11 +333,21 @@ static inline void at_ack_delivery(struct ofono_sms *sms)
DBG("");
/* We must acknowledge the PDU using CNMA */
if (data->cnma_ack_pdu)
snprintf(buf, sizeof(buf), "AT+CNMA=1,%d\r%s",
data->cnma_ack_pdu_len, data->cnma_ack_pdu);
else /* Should be a safe fallback */
if (data->cnma_ack_pdu) {
switch (data->vendor) {
case OFONO_VENDOR_GEMALTO:
snprintf(buf, sizeof(buf), "AT+CNMA=1");
break;
default:
snprintf(buf, sizeof(buf), "AT+CNMA=1,%d\r%s",
data->cnma_ack_pdu_len,
data->cnma_ack_pdu);
break;
}
} else {
/* Should be a safe fallback */
snprintf(buf, sizeof(buf), "AT+CNMA=0");
}
g_at_chat_send(data->chat, buf, none_prefix, at_cnma_cb, NULL, NULL);
}
@@ -409,16 +405,50 @@ static void at_cmt_notify(GAtResult *result, gpointer user_data)
{
struct ofono_sms *sms = user_data;
struct sms_data *data = ofono_sms_get_data(sms);
GAtResultIter iter;
const char *hexpdu;
unsigned char pdu[176];
long pdu_len;
int tpdu_len;
unsigned char pdu[176];
if (!at_parse_cmt(result, &hexpdu, &tpdu_len)) {
ofono_error("Unable to parse CMT notification");
return;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+CMT:"))
goto err;
switch (data->vendor) {
case OFONO_VENDOR_GEMALTO:
if (!g_at_result_iter_next_number(&iter, &tpdu_len)) {
/*
* Some Gemalto modems (ALS3,PLS8...), act in
* accordance with 3GPP 27.005. So we need to skip
* the first (<alpha>) field
* \r\n+CMT: ,23\r\nCAFECAFECAFE... ...\r\n
* ^------- PDU length
*/
DBG("Retrying to find the PDU length");
if (!g_at_result_iter_skip_next(&iter))
goto err;
/* Next attempt at finding the PDU length. */
if (!g_at_result_iter_next_number(&iter, &tpdu_len))
goto err;
}
break;
default:
if (!g_at_result_iter_skip_next(&iter))
goto err;
if (!g_at_result_iter_next_number(&iter, &tpdu_len))
goto err;
break;
}
hexpdu = g_at_result_pdu(result);
if (strlen(hexpdu) > sizeof(pdu) * 2) {
ofono_error("Bad PDU length in CMT notification");
return;
@@ -431,6 +461,10 @@ static void at_cmt_notify(GAtResult *result, gpointer user_data)
if (data->vendor != OFONO_VENDOR_SIMCOM)
at_ack_delivery(sms);
return;
err:
ofono_error("Unable to parse CMT notification");
}
static void at_cmgr_notify(GAtResult *result, gpointer user_data)
@@ -742,7 +776,7 @@ static void at_sms_initialized(struct ofono_sms *sms)
static void at_sms_not_supported(struct ofono_sms *sms)
{
ofono_error("SMS not supported by this modem. If this is in error"
ofono_error("SMS not supported by this modem. If this is an error"
" please submit patches to support this hardware");
ofono_sms_remove(sms);
@@ -824,8 +858,18 @@ static gboolean build_cnmi_string(char *buf, int *cnmi_opts,
data->cnma_enabled ? "21" : "1", FALSE))
return FALSE;
switch (data->vendor) {
case OFONO_VENDOR_GEMALTO:
mode = "0";
break;
default:
/* Sounds like 2 is the sanest mode */
mode = "20";
break;
}
/* Always deliver CB via +CBM, otherwise don't deliver at all */
if (!append_cnmi_element(buf, &len, cnmi_opts[2], "20", FALSE))
if (!append_cnmi_element(buf, &len, cnmi_opts[2], mode, FALSE))
return FALSE;
/*
@@ -1285,7 +1329,7 @@ static void at_sms_remove(struct ofono_sms *sms)
ofono_sms_set_data(sms, NULL);
}
static struct ofono_sms_driver driver = {
static const struct ofono_sms_driver driver = {
.name = "atmodem",
.probe = at_sms_probe,
.remove = at_sms_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -223,7 +222,7 @@ static void at_stk_remove(struct ofono_stk *stk)
g_free(sd);
}
static struct ofono_stk_driver driver = {
static const struct ofono_stk_driver driver = {
.name = "atmodem",
.probe = at_stk_probe,
.remove = at_stk_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -92,7 +91,7 @@ static const unsigned char *ucs2_gsm_to_packed(const char *content,
return NULL;
}
packed = pack_7bit_own_buf(gsm, written, 0, TRUE, msg_len, 0, msg);
packed = pack_7bit_own_buf(gsm, written, 0, true, msg_len, 0, msg);
g_free(gsm);
return packed;
@@ -137,7 +136,7 @@ static void cusd_parse(GAtResult *result, struct ofono_ussd *ussd)
switch (data->charset) {
case AT_UTIL_CHARSET_GSM:
msg_ptr = pack_7bit_own_buf((const guint8 *) content,
-1, 0, TRUE, &msg_len,
-1, 0, true, &msg_len,
0, msg);
break;
@@ -201,7 +200,7 @@ static void at_ussd_request(struct ofono_ussd *ussd, int dcs,
unsigned char unpacked_buf[182];
long written;
unpack_7bit_own_buf(pdu, len, 0, TRUE, sizeof(unpacked_buf),
unpack_7bit_own_buf(pdu, len, 0, true, sizeof(unpacked_buf),
&written, 0, unpacked_buf);
if (written < 1)
@@ -327,7 +326,7 @@ static void at_ussd_remove(struct ofono_ussd *ussd)
g_free(data);
}
static struct ofono_ussd_driver driver = {
static const struct ofono_ussd_driver driver = {
.name = "atmodem",
.probe = at_ussd_probe,
.remove = at_ussd_remove,

View File

@@ -42,5 +42,10 @@ enum ofono_vendor {
OFONO_VENDOR_SIMCOM_SIM900,
OFONO_VENDOR_ICERA,
OFONO_VENDOR_WAVECOM_Q2XXX,
OFONO_VENDOR_ALCATEL
OFONO_VENDOR_ALCATEL,
OFONO_VENDOR_QUECTEL,
OFONO_VENDOR_QUECTEL_M95,
OFONO_VENDOR_UBLOX,
OFONO_VENDOR_XMM,
OFONO_VENDOR_GEMALTO,
};

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -253,8 +252,7 @@ static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data)
}
}
g_slist_foreach(vd->calls, (GFunc) g_free, NULL);
g_slist_free(vd->calls);
g_slist_free_full(vd->calls, g_free);
vd->calls = calls;
@@ -1121,6 +1119,7 @@ static int at_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
switch (vd->vendor) {
case OFONO_VENDOR_QUALCOMM_MSM:
case OFONO_VENDOR_SIMCOM:
g_at_chat_send(vd->chat, "AT+COLP=0", NULL, NULL, NULL, NULL);
break;
default:
@@ -1147,8 +1146,7 @@ static void at_voicecall_remove(struct ofono_voicecall *vc)
if (vd->vts_source)
g_source_remove(vd->vts_source);
g_slist_foreach(vd->calls, (GFunc) g_free, NULL);
g_slist_free(vd->calls);
g_slist_free_full(vd->calls, g_free);
ofono_voicecall_set_data(vc, NULL);
@@ -1156,7 +1154,7 @@ static void at_voicecall_remove(struct ofono_voicecall *vc)
g_free(vd);
}
static struct ofono_voicecall_driver driver = {
static const struct ofono_voicecall_driver driver = {
.name = "atmodem",
.probe = at_voicecall_probe,
.remove = at_voicecall_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -292,7 +291,7 @@ static void calypso_stk_remove(struct ofono_stk *stk)
g_free(sd);
}
static struct ofono_stk_driver driver = {
static const struct ofono_stk_driver driver = {
.name = "calypsomodem",
.probe = calypso_stk_probe,
.remove = calypso_stk_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -402,7 +401,7 @@ static void calypso_voicecall_remove(struct ofono_voicecall *vc)
g_free(vd);
}
static struct ofono_voicecall_driver driver = {
static const struct ofono_voicecall_driver driver = {
.name = "calypsomodem",
.probe = calypso_voicecall_probe,
.remove = calypso_voicecall_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -43,7 +42,7 @@
#include "cdmamodem.h"
#include "drivers/atmodem/vendor.h"
#define TUN_SYSFS_DIR "/sys/devices/virtual/misc/tun"
#define TUN_DEV "/dev/net/tun"
#define STATIC_IP_NETMASK "255.255.255.255"
@@ -285,7 +284,7 @@ static int cdma_connman_probe(struct ofono_cdma_connman *cm,
DBG("");
if (stat(TUN_SYSFS_DIR, &st) < 0) {
if (stat(TUN_DEV, &st) < 0) {
ofono_error("Missing support for TUN/TAP devices");
return -ENODEV;
}
@@ -323,7 +322,7 @@ static void cdma_connman_remove(struct ofono_cdma_connman *cm)
g_free(cd);
}
static struct ofono_cdma_connman_driver driver = {
static const struct ofono_cdma_connman_driver driver = {
.name = "cdmamodem",
.probe = cdma_connman_probe,
.remove = cdma_connman_remove,

View File

@@ -153,7 +153,7 @@ static void cdma_devinfo_remove(struct ofono_devinfo *info)
ofono_devinfo_set_data(info, NULL);
}
static struct ofono_devinfo_driver driver = {
static const struct ofono_devinfo_driver driver = {
.name = "cdmamodem",
.probe = cdma_devinfo_probe,
.remove = cdma_devinfo_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -143,7 +142,7 @@ static void cdma_voicecall_remove(struct ofono_cdma_voicecall *vc)
g_free(vd);
}
static struct ofono_cdma_voicecall_driver driver = {
static const struct ofono_cdma_voicecall_driver driver = {
.name = "cdmamodem",
.probe = cdma_voicecall_probe,
.remove = cdma_voicecall_remove,

View File

@@ -73,7 +73,7 @@ static void dun_gprs_attached_status(struct ofono_gprs *gprs,
CALLBACK_WITH_SUCCESS(cb, 1, data);
}
static struct ofono_gprs_driver driver = {
static const struct ofono_gprs_driver driver = {
.name = "dunmodem",
.probe = dun_gprs_probe,
.remove = dun_gprs_remove,

View File

@@ -107,7 +107,7 @@ static void dun_netreg_remove(struct ofono_netreg *netreg)
g_free(nd);
}
static struct ofono_netreg_driver driver = {
static const struct ofono_netreg_driver driver = {
.name = "dunmodem",
.probe = dun_netreg_probe,
.remove = dun_netreg_remove,

View File

@@ -1,9 +1,9 @@
/*
*
* RIL library with GLib integration
* oFono - Open Source Telephony
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
* Copyright (C) 2012-2013 Canonical Ltd.
* Copyright (C) 2017 Vincent Cesson. All rights reserved.
* Copyright (C) 2018 Gemalto M2M
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -20,38 +20,33 @@
*
*/
#ifndef __GRILREPLY_H
#define __GRILREPLY_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <glib.h>
#include <gatchat.h>
#define OFONO_API_SUBJECT_TO_CHANGE
#include <ofono/plugin.h>
#include <ofono/types.h>
#include "gril.h"
#include "gemaltomodem.h"
#ifdef __cplusplus
extern "C" {
#endif
static int gemaltomodem_init(void)
{
gemalto_location_reporting_init();
gemalto_voicecall_init();
struct reply_setup_data_call {
guint version;
guint status;
gint cid;
guint retry_time;
guint active;
guint protocol;
gchar *ifname;
gchar **dns_addresses;
gchar **gateways;
gchar **ip_addrs;
};
void g_ril_reply_free_setup_data_call(struct reply_setup_data_call *reply);
struct reply_setup_data_call *g_ril_reply_parse_data_call(GRil *gril,
struct ril_msg *message,
struct ofono_error *error);
#ifdef __cplusplus
return 0;
}
#endif
#endif /* __GRILREPLY_H */
static void gemaltomodem_exit(void)
{
gemalto_voicecall_exit();
gemalto_location_reporting_exit();
}
OFONO_PLUGIN_DEFINE(gemaltomodem, "Gemalto modem driver", VERSION,
OFONO_PLUGIN_PRIORITY_DEFAULT,
gemaltomodem_init, gemaltomodem_exit)

View File

@@ -0,0 +1,29 @@
/*
*
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Vincent Cesson. All rights reserved.
* Copyright (C) 2018 Gemalto M2M
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include <drivers/atmodem/atutil.h>
extern void gemalto_location_reporting_init();
extern void gemalto_location_reporting_exit();
extern void gemalto_voicecall_init();
extern void gemalto_voicecall_exit();

View File

@@ -0,0 +1,236 @@
/*
*
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Vincent Cesson. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <glib.h>
#include <ofono/log.h>
#include <ofono/modem.h>
#include <ofono/location-reporting.h>
#include "gatchat.h"
#include "gatresult.h"
#include "gattty.h"
#include "gemaltomodem.h"
static const char *sgpsc_prefix[] = { "^SGPSC:", NULL };
struct gps_data {
GAtChat *chat;
};
static void gemalto_gps_disable_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
struct ofono_location_reporting *lr = cbd->user;
ofono_location_reporting_disable_cb_t cb = cbd->cb;
DBG("lr=%p, ok=%d", lr, ok);
if (!ok) {
struct ofono_error error;
decode_at_error(&error, g_at_result_final_response(result));
cb(&error, cbd->data);
return;
}
CALLBACK_WITH_SUCCESS(cb, cbd->data);
}
static void gemalto_location_reporting_disable(
struct ofono_location_reporting *lr,
ofono_location_reporting_disable_cb_t cb,
void *data)
{
struct gps_data *gd = ofono_location_reporting_get_data(lr);
struct cb_data *cbd = cb_data_new(cb, data);
DBG("lr=%p", lr);
cbd->user = lr;
if (g_at_chat_send(gd->chat, "AT^SGPSC=\"Engine\",0", sgpsc_prefix,
gemalto_gps_disable_cb, cbd, g_free) > 0)
return;
CALLBACK_WITH_FAILURE(cb, data);
g_free(cbd);
}
static int enable_data_stream(struct ofono_location_reporting *lr)
{
struct ofono_modem *modem;
const char *gps_dev;
GHashTable *options;
GIOChannel *channel;
int fd;
modem = ofono_location_reporting_get_modem(lr);
gps_dev = ofono_modem_get_string(modem, "GPS");
options = g_hash_table_new(g_str_hash, g_str_equal);
if (options == NULL)
return -1;
g_hash_table_insert(options, "Baud", "115200");
channel = g_at_tty_open(gps_dev, options);
g_hash_table_destroy(options);
if (channel == NULL)
return -1;
fd = g_io_channel_unix_get_fd(channel);
g_io_channel_set_close_on_unref(channel, FALSE);
g_io_channel_unref(channel);
return fd;
}
static void gemalto_sgpsc_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_location_reporting_enable_cb_t cb = cbd->cb;
struct ofono_location_reporting *lr = cbd->user;
struct ofono_error error;
int fd;
DBG("lr=%p ok=%d", lr, ok);
decode_at_error(&error, g_at_result_final_response(result));
if (!ok) {
cb(&error, -1, cbd->data);
return;
}
fd = enable_data_stream(lr);
if (fd < 0) {
CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
return;
}
cb(&error, fd, cbd->data);
close(fd);
}
static void gemalto_location_reporting_enable(struct ofono_location_reporting *lr,
ofono_location_reporting_enable_cb_t cb,
void *data)
{
struct gps_data *gd = ofono_location_reporting_get_data(lr);
struct cb_data *cbd = cb_data_new(cb, data);
DBG("lr=%p", lr);
cbd->user = lr;
if (g_at_chat_send(gd->chat, "AT^SGPSC=\"Engine\",2", sgpsc_prefix,
gemalto_sgpsc_cb, cbd, NULL) > 0)
return;
CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
g_free(cbd);
}
static void gemalto_location_reporting_support_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct ofono_location_reporting *lr = user_data;
if (!ok) {
ofono_location_reporting_remove(lr);
return;
}
ofono_location_reporting_register(lr);
}
static int gemalto_location_reporting_probe(struct ofono_location_reporting *lr,
unsigned int vendor, void *data)
{
GAtChat *chat = data;
struct gps_data *gd;
gd = g_try_new0(struct gps_data, 1);
if (gd == NULL)
return -ENOMEM;
gd->chat = g_at_chat_clone(chat);
ofono_location_reporting_set_data(lr, gd);
g_at_chat_send(gd->chat, "AT^SGPSC=?", sgpsc_prefix,
gemalto_location_reporting_support_cb,
lr, NULL);
return 0;
}
static void gemalto_location_reporting_remove(struct ofono_location_reporting *lr)
{
struct gps_data *gd = ofono_location_reporting_get_data(lr);
ofono_location_reporting_set_data(lr, NULL);
g_at_chat_unref(gd->chat);
g_free(gd);
}
static const struct ofono_location_reporting_driver driver = {
.name = "gemaltomodem",
.type = OFONO_LOCATION_REPORTING_TYPE_NMEA,
.probe = gemalto_location_reporting_probe,
.remove = gemalto_location_reporting_remove,
.enable = gemalto_location_reporting_enable,
.disable = gemalto_location_reporting_disable,
};
void gemalto_location_reporting_init()
{
ofono_location_reporting_driver_register(&driver);
}
void gemalto_location_reporting_exit()
{
ofono_location_reporting_driver_unregister(&driver);
}

View File

@@ -0,0 +1,576 @@
/*
*
* oFono - Open Source Telephony
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
* Copyright (C) 2018 Gemalto M2M
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <glib.h>
#include <ofono/log.h>
#include <ofono/modem.h>
#include <ofono/voicecall.h>
#include "gatchat.h"
#include "gatresult.h"
#include "common.h"
#include "gemaltomodem.h"
static const char *clcc_prefix[] = { "+CLCC:", NULL };
static const char *none_prefix[] = { NULL };
struct voicecall_data {
GAtChat *chat;
GSList *calls;
unsigned int local_release;
GSList *new_calls;
};
struct release_id_req {
struct ofono_voicecall *vc;
ofono_voicecall_cb_t cb;
void *data;
int id;
};
struct change_state_req {
struct ofono_voicecall *vc;
ofono_voicecall_cb_t cb;
void *data;
int affected_types;
};
static void generic_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct change_state_req *req = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(req->vc);
struct ofono_error error;
decode_at_error(&error, g_at_result_final_response(result));
if (ok && req->affected_types) {
GSList *l;
struct ofono_call *call;
for (l = vd->calls; l; l = l->next) {
call = l->data;
if (req->affected_types & (1 << call->status))
vd->local_release |= (1 << call->id);
}
}
req->cb(&error, req->data);
}
static void gemalto_call_common(const char *cmd, struct ofono_voicecall *vc,
GAtResultFunc result_cb,
unsigned int affected_types,
ofono_voicecall_cb_t cb, void *data)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
struct change_state_req *req = g_new0(struct change_state_req, 1);
req->vc = vc;
req->cb = cb;
req->data = data;
req->affected_types = affected_types;
if (g_at_chat_send(vd->chat, cmd, none_prefix,
result_cb, req, g_free) > 0)
return;
g_free(req);
CALLBACK_WITH_FAILURE(cb, data);
}
static void gemalto_answer(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
gemalto_call_common("ATA", vc, generic_cb, 0, cb, data);
}
static void gemalto_hangup_all(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
unsigned int affected = (1 << CALL_STATUS_INCOMING) |
(1 << CALL_STATUS_DIALING) |
(1 << CALL_STATUS_ALERTING) |
(1 << CALL_STATUS_WAITING) |
(1 << CALL_STATUS_HELD) |
(1 << CALL_STATUS_ACTIVE);
/* Hangup all calls */
gemalto_call_common("AT+CHUP", vc, generic_cb, affected, cb, data);
}
static void gemalto_hangup(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
unsigned int affected = (1 << CALL_STATUS_ACTIVE);
/* Hangup current active call */
gemalto_call_common("AT+CHLD=1", vc, generic_cb, affected, cb, data);
}
static void gemalto_hold_all_active(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
unsigned int affected = (1 << CALL_STATUS_ACTIVE);
gemalto_call_common("AT+CHLD=2", vc, generic_cb, affected, cb, data);
}
static void gemalto_release_all_held(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
unsigned int affected = (1 << CALL_STATUS_INCOMING) |
(1 << CALL_STATUS_WAITING);
gemalto_call_common("AT+CHLD=0", vc, generic_cb, affected, cb, data);
}
static void gemalto_set_udub(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
unsigned int affected = (1 << CALL_STATUS_INCOMING) |
(1 << CALL_STATUS_WAITING);
gemalto_call_common("AT+CHLD=0", vc, generic_cb, affected, cb, data);
}
static void gemalto_release_all_active(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
unsigned int affected = (1 << CALL_STATUS_ACTIVE);
gemalto_call_common("AT+CHLD=1", vc, generic_cb, affected, cb, data);
}
static void release_id_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct release_id_req *req = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(req->vc);
struct ofono_error error;
decode_at_error(&error, g_at_result_final_response(result));
if (ok)
vd->local_release = 1 << req->id;
req->cb(&error, req->data);
}
static void gemalto_release_specific(struct ofono_voicecall *vc, int id,
ofono_voicecall_cb_t cb, void *data)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
struct release_id_req *req = g_new0(struct release_id_req, 1);
char buf[32];
req->vc = vc;
req->cb = cb;
req->data = data;
req->id = id;
snprintf(buf, sizeof(buf), "AT+CHLD=1%d", id);
if (g_at_chat_send(vd->chat, buf, none_prefix,
release_id_cb, req, g_free) > 0)
return;
g_free(req);
CALLBACK_WITH_FAILURE(cb, data);
}
static void gemalto_private_chat(struct ofono_voicecall *vc, int id,
ofono_voicecall_cb_t cb, void *data)
{
char buf[32];
snprintf(buf, sizeof(buf), "AT+CHLD=2%d", id);
gemalto_call_common(buf, vc, generic_cb, 0, cb, data);
}
static void gemalto_create_multiparty(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
gemalto_call_common("AT+CHLD=3", vc, generic_cb, 0, cb, data);
}
static void gemalto_transfer(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
/* Held & Active */
unsigned int affected = (1 << CALL_STATUS_ACTIVE) |
(1 << CALL_STATUS_HELD);
/* Transfer can puts held & active calls together and disconnects
* from both. However, some networks support transferring of
* dialing/ringing calls as well.
*/
affected |= (1 << CALL_STATUS_DIALING) |
(1 << CALL_STATUS_ALERTING);
gemalto_call_common("AT+CHLD=4", vc, generic_cb, affected, cb, data);
}
static void gemalto_send_dtmf(struct ofono_voicecall *vc, const char *dtmf,
ofono_voicecall_cb_t cb, void *data)
{
struct ofono_modem *modem = ofono_voicecall_get_modem(vc);
int use_quotes = ofono_modem_get_integer(modem, "GemaltoVtsQuotes");
int len = strlen(dtmf);
int s;
int i;
char *buf;
/* strlen("+VTS=\"T\";") = 9 + initial AT + null */
buf = (char *)alloca(len * 9 + 3);
if (use_quotes)
s = sprintf(buf, "AT+VTS=\"%c\"", dtmf[0]);
else
s = sprintf(buf, "AT+VTS=%c", dtmf[0]);
for (i = 1; i < len; i++) {
if (use_quotes)
s += sprintf(buf + s, ";+VTS=\"%c\"", dtmf[i]);
else
s += sprintf(buf + s, ";+VTS=%c", dtmf[i]);
}
gemalto_call_common(buf, vc, generic_cb, 0, cb, data);
}
static void gemalto_dial(struct ofono_voicecall *vc,
const struct ofono_phone_number *ph,
enum ofono_clir_option clir,
ofono_voicecall_cb_t cb, void *data)
{
struct cb_data *cbd = cb_data_new(cb, data);
char buf[256];
size_t len;
cbd->user = vc;
if (ph->type == 145)
len = snprintf(buf, sizeof(buf), "ATD+%s", ph->number);
else
len = snprintf(buf, sizeof(buf), "ATD%s", ph->number);
switch (clir) {
case OFONO_CLIR_OPTION_INVOCATION:
len += snprintf(buf+len, sizeof(buf)-len, "I");
break;
case OFONO_CLIR_OPTION_SUPPRESSION:
len += snprintf(buf+len, sizeof(buf)-len, "i");
break;
default:
break;
}
snprintf(buf + len, sizeof(buf) - len, ";");
gemalto_call_common(buf, vc, generic_cb, 0, cb, data);
}
static void gemalto_parse_slcc(GAtResult *result, GSList **l,
ofono_bool_t *ret_mpty, gboolean *last)
{
GAtResultIter iter;
int id, dir, status, type;
ofono_bool_t mpty;
struct ofono_call *call;
const char *str = "";
int number_type = 129;
if (last)
*last = TRUE;
g_at_result_iter_init(&iter, result);
g_at_result_iter_next(&iter, "^SLCC:");
if (!g_at_result_iter_next_number(&iter, &id))
return;
if (last)
*last = FALSE;
if (id == 0)
return;
if (!g_at_result_iter_next_number(&iter, &dir))
return;
if (!g_at_result_iter_next_number(&iter, &status))
return;
if (status > 5)
return;
if (!g_at_result_iter_next_number(&iter, &type))
return;
if (!g_at_result_iter_next_number(&iter, &mpty))
return;
/* skip 'Reserved=0' parameter, only difference from CLCC */
if (!g_at_result_iter_skip_next(&iter))
return;
if (g_at_result_iter_next_string(&iter, &str))
g_at_result_iter_next_number(&iter, &number_type);
call = g_new0(struct ofono_call, 1);
ofono_call_init(call);
call->id = id;
call->direction = dir;
call->status = status;
call->type = type;
strncpy(call->phone_number.number, str,
OFONO_MAX_PHONE_NUMBER_LENGTH);
call->phone_number.type = number_type;
if (strlen(str) > 0)
call->clip_validity = 2;
else
call->clip_validity = 0;
*l = g_slist_insert_sorted(*l, call, at_util_call_compare);
if (ret_mpty)
*ret_mpty = mpty;
}
static void clcc_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
GSList *l;
if (!ok)
return;
vd->calls = at_util_parse_clcc(result, NULL);
for (l = vd->calls; l; l = l->next)
ofono_voicecall_notify(vc, l->data);
}
/*
* ^SLCC, except for one RFU parameter (see above in the parsing), is identical
* to +CLCC, but as URC it is parsed line by line, and the last line is
* indicated by an empty "^SLCC:" (equivalent to the "OK" for CLCC).
*/
static void slcc_notify(GAtResult *result, gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
GSList *n, *o;
struct ofono_call *nc, *oc;
gboolean last;
gemalto_parse_slcc(result, &vd->new_calls, NULL, &last);
if (!last)
return;
n = vd->new_calls;
o = vd->calls;
while (n || o) {
nc = n ? n->data : NULL;
oc = o ? o->data : NULL;
if (oc && (nc == NULL || (nc->id > oc->id))) {
enum ofono_disconnect_reason reason;
if (vd->local_release & (1 << oc->id))
reason = OFONO_DISCONNECT_REASON_LOCAL_HANGUP;
else
reason = OFONO_DISCONNECT_REASON_REMOTE_HANGUP;
if (!oc->type)
ofono_voicecall_disconnected(vc, oc->id,
reason, NULL);
o = o->next;
} else if (nc && (oc == NULL || (nc->id < oc->id))) {
if (nc->type == 0) /* new call, signal it */
ofono_voicecall_notify(vc, nc);
n = n->next;
} else {
DBG("modify call part");
/* notify in case of changes */
if (memcmp(nc, oc, sizeof(*nc)))
ofono_voicecall_notify(vc, nc);
n = n->next;
o = o->next;
}
}
g_slist_free_full(vd->calls, g_free);
vd->calls = vd->new_calls;
vd->new_calls = NULL;
vd->local_release = 0;
}
static void cssi_notify(GAtResult *result, gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
GAtResultIter iter;
int code, index;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+CSSI:"))
return;
if (!g_at_result_iter_next_number(&iter, &code))
return;
if (!g_at_result_iter_next_number(&iter, &index))
index = 0;
ofono_voicecall_ssn_mo_notify(vc, 0, code, index);
}
static void cssu_notify(GAtResult *result, gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
GAtResultIter iter;
int code;
int index;
const char *num;
struct ofono_phone_number ph;
ph.number[0] = '\0';
ph.type = 129;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+CSSU:"))
return;
if (!g_at_result_iter_next_number(&iter, &code))
return;
if (!g_at_result_iter_next_number_default(&iter, -1, &index))
goto out;
if (!g_at_result_iter_next_string(&iter, &num))
goto out;
strncpy(ph.number, num, OFONO_MAX_PHONE_NUMBER_LENGTH);
if (!g_at_result_iter_next_number(&iter, &ph.type))
return;
out:
ofono_voicecall_ssn_mt_notify(vc, 0, code, index, &ph);
}
static void gemalto_voicecall_initialized(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
DBG("voicecall_init: registering to notifications");
/* NO CARRIER, NO ANSWER, BUSY, NO DIALTONE are handled through SLCC */
g_at_chat_register(vd->chat, "^SLCC:", slcc_notify, FALSE, vc, NULL);
g_at_chat_register(vd->chat, "+CSSI:", cssi_notify, FALSE, vc, NULL);
g_at_chat_register(vd->chat, "+CSSU:", cssu_notify, FALSE, vc, NULL);
ofono_voicecall_register(vc);
/* Populate the call list */
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix, clcc_cb, vc, NULL);
}
static int gemalto_voicecall_probe(struct ofono_voicecall *vc,
unsigned int vendor, void *data)
{
GAtChat *chat = data;
struct voicecall_data *vd;
vd = g_new0(struct voicecall_data, 1);
vd->chat = g_at_chat_clone(chat);
ofono_voicecall_set_data(vc, vd);
g_at_chat_send(vd->chat, "AT+CSSN=1,1", NULL, NULL, NULL, NULL);
g_at_chat_send(vd->chat, "AT^SLCC=1", NULL,
gemalto_voicecall_initialized, vc, NULL);
return 0;
}
static void gemalto_voicecall_remove(struct ofono_voicecall *vc)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
ofono_voicecall_set_data(vc, NULL);
g_at_chat_unref(vd->chat);
g_free(vd);
}
static const struct ofono_voicecall_driver driver = {
.name = "gemaltomodem",
.probe = gemalto_voicecall_probe,
.remove = gemalto_voicecall_remove,
.dial = gemalto_dial,
.answer = gemalto_answer,
.hangup_all = gemalto_hangup_all,
.hangup_active = gemalto_hangup,
.hold_all_active = gemalto_hold_all_active,
.release_all_held = gemalto_release_all_held,
.set_udub = gemalto_set_udub,
.release_all_active = gemalto_release_all_active,
.release_specific = gemalto_release_specific,
.private_chat = gemalto_private_chat,
.create_multiparty = gemalto_create_multiparty,
.transfer = gemalto_transfer,
.send_tones = gemalto_send_dtmf
};
void gemalto_voicecall_init(void)
{
ofono_voicecall_driver_register(&driver);
}
void gemalto_voicecall_exit(void)
{
ofono_voicecall_driver_unregister(&driver);
}

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -218,7 +217,7 @@ static void hfp_call_volume_remove(struct ofono_call_volume *cv)
g_free(vd);
}
static struct ofono_call_volume_driver driver = {
static const struct ofono_call_volume_driver driver = {
.name = "hfpmodem",
.probe = hfp_call_volume_probe,
.remove = hfp_call_volume_remove,

View File

@@ -91,7 +91,7 @@ static void hfp_devinfo_remove(struct ofono_devinfo *info)
g_free(dd);
}
static struct ofono_devinfo_driver driver = {
static const struct ofono_devinfo_driver driver = {
.name = "hfpmodem",
.probe = hfp_devinfo_probe,
.remove = hfp_devinfo_remove,

View File

@@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -45,10 +44,12 @@
static const char *binp_prefix[] = { "+BINP:", NULL };
static const char *bvra_prefix[] = { "+BVRA:", NULL };
static const char *none_prefix[] = { NULL };
struct hf_data {
GAtChat *chat;
unsigned int ag_features;
unsigned int ag_chld_features;
int battchg_index;
guint register_source;
};
@@ -124,6 +125,108 @@ static void ciev_notify(GAtResult *result, gpointer user_data)
ofono_handsfree_battchg_notify(hf, value);
}
static void cnum_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_handsfree_cnum_query_cb_t cb = cbd->cb;
GAtResultIter iter;
struct ofono_phone_number *list = NULL;
int num = 0;
struct ofono_error error;
decode_at_error(&error, g_at_result_final_response(result));
if (!ok)
goto out;
g_at_result_iter_init(&iter, result);
while (g_at_result_iter_next(&iter, "+CNUM:"))
num++;
if (num == 0)
goto out;
list = g_new0(struct ofono_phone_number, num);
g_at_result_iter_init(&iter, result);
for (num = 0; g_at_result_iter_next(&iter, "+CNUM:"); ) {
const char *number;
int service;
int type;
if (!g_at_result_iter_skip_next(&iter))
continue;
if (!g_at_result_iter_next_string(&iter, &number))
continue;
if (!g_at_result_iter_next_number(&iter, &type))
continue;
if (!g_at_result_iter_skip_next(&iter))
continue;
if (!g_at_result_iter_next_number(&iter, &service))
continue;
/* We are only interested in Voice services */
if (service != 4)
continue;
strncpy(list[num].number, number,
OFONO_MAX_PHONE_NUMBER_LENGTH);
list[num].number[OFONO_MAX_PHONE_NUMBER_LENGTH] = '\0';
list[num].type = type;
DBG("cnum_notify:%s", list[num].number);
num++;
}
out:
cb(&error, num, list, cbd->data);
g_free(list);
}
static void hfp_cnum_query(struct ofono_handsfree *hf,
ofono_handsfree_cnum_query_cb_t cb, void *data)
{
struct hf_data *hd = ofono_handsfree_get_data(hf);
struct cb_data *cbd = cb_data_new(cb, data);
if (g_at_chat_send(hd->chat, "AT+CNUM", none_prefix,
cnum_query_cb, cbd, g_free) > 0)
return;
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, -1, NULL, data);
}
static void bind_notify(GAtResult *result, gpointer user_data)
{
struct ofono_handsfree *hf = user_data;
int hf_indicator;
int active;
GAtResultIter iter;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+BIND:"))
return;
if (!g_at_result_iter_next_number(&iter, &hf_indicator))
return;
if (!g_at_result_iter_next_number(&iter, &active))
return;
ofono_handsfree_hf_indicator_active_notify(hf, hf_indicator, active);
}
static gboolean hfp_handsfree_register(gpointer user_data)
{
struct ofono_handsfree *hf = user_data;
@@ -134,11 +237,13 @@ static gboolean hfp_handsfree_register(gpointer user_data)
g_at_chat_register(hd->chat, "+BSIR:", bsir_notify, FALSE, hf, NULL);
g_at_chat_register(hd->chat, "+BVRA:", bvra_notify, FALSE, hf, NULL);
g_at_chat_register(hd->chat, "+CIEV:", ciev_notify, FALSE, hf, NULL);
g_at_chat_register(hd->chat, "+BIND:", bind_notify, FALSE, hf, NULL);
if (hd->ag_features & HFP_AG_FEATURE_IN_BAND_RING_TONE)
ofono_handsfree_set_inband_ringing(hf, TRUE);
ofono_handsfree_set_ag_features(hf, hd->ag_features);
ofono_handsfree_set_ag_chld_features(hf, hd->ag_chld_features);
ofono_handsfree_register(hf);
return FALSE;
@@ -149,11 +254,13 @@ static int hfp_handsfree_probe(struct ofono_handsfree *hf,
{
struct hfp_slc_info *info = data;
struct hf_data *hd;
unsigned int i;
DBG("");
hd = g_new0(struct hf_data, 1);
hd->chat = g_at_chat_clone(info->chat);
hd->ag_features = info->ag_features;
hd->ag_chld_features = info->ag_mpty_features;
ofono_handsfree_set_data(hf, hd);
@@ -161,6 +268,14 @@ static int hfp_handsfree_probe(struct ofono_handsfree *hf,
ofono_handsfree_battchg_notify(hf,
info->cind_val[HFP_INDICATOR_BATTCHG]);
ofono_handsfree_set_hf_indicators(hf, info->hf_indicators,
info->num_hf_indicators);
for (i = 0; i < info->num_hf_indicators; i++)
ofono_handsfree_hf_indicator_active_notify(hf,
info->hf_indicators[i],
info->hf_indicator_active_map & (1 << i));
hd->register_source = g_idle_add(hfp_handsfree_register, hf);
return 0;
@@ -267,8 +382,8 @@ static void hfp_disable_nrec(struct ofono_handsfree *hf,
struct cb_data *cbd = cb_data_new(cb, data);
const char *buf = "AT+NREC=0";
if (g_at_chat_send(hd->chat, buf, NULL, hf_generic_set_cb,
cbd, g_free) > 0)
if (g_at_chat_send(hd->chat, buf, none_prefix,
hf_generic_set_cb, cbd, g_free) > 0)
return;
g_free(cbd);
@@ -276,13 +391,34 @@ static void hfp_disable_nrec(struct ofono_handsfree *hf,
CALLBACK_WITH_FAILURE(cb, data);
}
static struct ofono_handsfree_driver driver = {
static void hfp_hf_indicator(struct ofono_handsfree *hf,
unsigned short indicator, unsigned int value,
ofono_handsfree_cb_t cb, void *data)
{
struct hf_data *hd = ofono_handsfree_get_data(hf);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[128];
snprintf(buf, sizeof(buf), "AT+BIEV=%u,%u", indicator, value);
if (g_at_chat_send(hd->chat, buf, none_prefix,
hf_generic_set_cb, cbd, g_free) > 0)
return;
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, data);
}
static const struct ofono_handsfree_driver driver = {
.name = "hfpmodem",
.probe = hfp_handsfree_probe,
.remove = hfp_handsfree_remove,
.cnum_query = hfp_cnum_query,
.request_phone_number = hfp_request_phone_number,
.voice_recognition = hfp_voice_recognition,
.disable_nrec = hfp_disable_nrec,
.hf_indicator = hfp_hf_indicator,
};
void hfp_handsfree_init(void)

View File

@@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -46,6 +45,7 @@
static const char *cops_prefix[] = { "+COPS:", NULL };
static const char *cind_prefix[] = { "+CIND:", NULL };
static const char *none_prefix[] = { NULL };
struct netreg_data {
GAtChat *chat;
@@ -263,7 +263,7 @@ static void hfp_current_operator(struct ofono_netreg *netreg,
cbd->user = netreg;
ok = g_at_chat_send(nd->chat, "AT+COPS=3,0", NULL,
ok = g_at_chat_send(nd->chat, "AT+COPS=3,0", none_prefix,
NULL, cbd, NULL);
if (ok)
@@ -342,7 +342,7 @@ static void hfp_netreg_remove(struct ofono_netreg *netreg)
g_free(nd);
}
static struct ofono_netreg_driver driver = {
static const struct ofono_netreg_driver driver = {
.name = "hfpmodem",
.probe = hfp_netreg_probe,
.remove = hfp_netreg_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -196,7 +195,7 @@ static void hfp_siri_set_eyes_free_mode(struct ofono_siri *siri,
CALLBACK_WITH_FAILURE(cb, NULL);
}
static struct ofono_siri_driver driver = {
static const struct ofono_siri_driver driver = {
.name = "hfpmodem",
.probe = hfp_siri_probe,
.remove = hfp_siri_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -41,10 +40,12 @@
#include "hfp.h"
#include "slc.h"
static const char *none_prefix[] = { NULL };
static const char *brsf_prefix[] = { "+BRSF:", NULL };
static const char *cind_prefix[] = { "+CIND:", NULL };
static const char *cmer_prefix[] = { "+CMER:", NULL };
static const char *chld_prefix[] = { "+CHLD:", NULL };
static const char *bind_prefix[] = { "+BIND:", NULL };
struct slc_establish_data {
gint ref_count;
@@ -76,6 +77,14 @@ void hfp_slc_info_init(struct hfp_slc_info *info, guint16 version)
info->hf_features |= HFP_HF_FEATURE_CODEC_NEGOTIATION;
if (version < HFP_VERSION_1_7)
goto done;
info->hf_features |= HFP_HF_FEATURE_HF_INDICATORS;
memset(info->hf_indicators, 0, sizeof(info->hf_indicators));
info->num_hf_indicators = 0;
info->hf_indicator_active_map = 0;
done:
memset(info->cind_val, 0, sizeof(info->cind_val));
memset(info->cind_pos, 0, sizeof(info->cind_pos));
@@ -103,10 +112,109 @@ static void slc_established(struct slc_establish_data *sed)
{
struct hfp_slc_info *info = sed->info;
g_at_chat_send(info->chat, "AT+CMEE=1", NULL, NULL, NULL, NULL);
g_at_chat_send(info->chat, "AT+CMEE=1", none_prefix,
NULL, NULL, NULL);
sed->connect_cb(sed->userdata);
}
static void bind_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct slc_establish_data *sed = user_data;
struct hfp_slc_info *info = sed->info;
GAtResultIter iter;
int hf_indicator;
int enabled;
unsigned int i;
if (!ok)
goto error;
g_at_result_iter_init(&iter, result);
while (g_at_result_iter_next(&iter, "+BIND:")) {
if (!g_at_result_iter_next_number(&iter, &hf_indicator))
goto error;
if (!g_at_result_iter_next_number(&iter, &enabled))
goto error;
ofono_info("AG wants indicator %d %s",
hf_indicator, enabled ? "enabled" : "disabled");
for (i = 0; i < info->num_hf_indicators; i++) {
if (info->hf_indicators[i] != hf_indicator)
continue;
info->hf_indicator_active_map |= enabled << i;
}
ofono_info("Active map: %02x", info->hf_indicator_active_map);
}
slc_established(sed);
return;
error:
slc_failed(sed);
}
static void bind_support_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct slc_establish_data *sed = user_data;
struct hfp_slc_info *info = sed->info;
GAtResultIter iter;
int hf_indicator;
if (!ok)
goto error;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+BIND:"))
goto error;
if (!g_at_result_iter_open_list(&iter))
goto error;
while (g_at_result_iter_next_number(&iter, &hf_indicator)) {
if (info->num_hf_indicators >= 20)
goto error;
ofono_info("AG supports the following HF indicator: %d",
hf_indicator);
info->hf_indicators[info->num_hf_indicators] = hf_indicator;
info->num_hf_indicators += 1;
}
if (!g_at_result_iter_close_list(&iter))
goto error;
slc_establish_data_ref(sed);
g_at_chat_send(info->chat, "AT+BIND?", bind_prefix,
bind_query_cb, sed, slc_establish_data_unref);
return;
error:
slc_failed(sed);
}
static void bind_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct slc_establish_data *sed = user_data;
struct hfp_slc_info *info = sed->info;
if (!ok) {
slc_failed(sed);
return;
}
slc_establish_data_ref(sed);
g_at_chat_send(info->chat, "AT+BIND=?", bind_prefix,
bind_support_cb, sed, slc_establish_data_unref);
}
static void chld_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct slc_establish_data *sed = user_data;
@@ -128,19 +236,19 @@ static void chld_cb(gboolean ok, GAtResult *result, gpointer user_data)
while (g_at_result_iter_next_unquoted_string(&iter, &str)) {
if (!strcmp(str, "0"))
ag_mpty_feature |= AG_CHLD_0;
ag_mpty_feature |= HFP_AG_CHLD_0;
else if (!strcmp(str, "1"))
ag_mpty_feature |= AG_CHLD_1;
ag_mpty_feature |= HFP_AG_CHLD_1;
else if (!strcmp(str, "1x"))
ag_mpty_feature |= AG_CHLD_1x;
ag_mpty_feature |= HFP_AG_CHLD_1x;
else if (!strcmp(str, "2"))
ag_mpty_feature |= AG_CHLD_2;
ag_mpty_feature |= HFP_AG_CHLD_2;
else if (!strcmp(str, "2x"))
ag_mpty_feature |= AG_CHLD_2x;
ag_mpty_feature |= HFP_AG_CHLD_2x;
else if (!strcmp(str, "3"))
ag_mpty_feature |= AG_CHLD_3;
ag_mpty_feature |= HFP_AG_CHLD_3;
else if (!strcmp(str, "4"))
ag_mpty_feature |= AG_CHLD_4;
ag_mpty_feature |= HFP_AG_CHLD_4;
}
if (!g_at_result_iter_close_list(&iter))
@@ -148,7 +256,14 @@ static void chld_cb(gboolean ok, GAtResult *result, gpointer user_data)
info->ag_mpty_features = ag_mpty_feature;
slc_established(sed);
if ((info->ag_features & HFP_AG_FEATURE_HF_INDICATORS) &&
(info->hf_features & HFP_HF_FEATURE_HF_INDICATORS)) {
slc_establish_data_ref(sed);
g_at_chat_send(info->chat, "AT+BIND=1", none_prefix,
bind_set_cb, sed, slc_establish_data_unref);
} else
slc_established(sed);
return;
error:
@@ -319,8 +434,8 @@ static void brsf_cb(gboolean ok, GAtResult *result, gpointer user_data)
sprintf(str, "AT+BAC=%d", HFP_CODEC_CVSD);
slc_establish_data_ref(sed);
g_at_chat_send(info->chat, str, NULL, bac_cb, sed,
slc_establish_data_unref);
g_at_chat_send(info->chat, str, none_prefix, bac_cb,
sed, slc_establish_data_unref);
return;
}

View File

@@ -19,14 +19,6 @@
*
*/
#define AG_CHLD_0 0x01
#define AG_CHLD_1 0x02
#define AG_CHLD_1x 0x04
#define AG_CHLD_2 0x08
#define AG_CHLD_2x 0x10
#define AG_CHLD_3 0x20
#define AG_CHLD_4 0x40
enum hfp_indicator {
HFP_INDICATOR_SERVICE = 0,
HFP_INDICATOR_CALL,
@@ -47,6 +39,9 @@ struct hfp_slc_info {
unsigned int hf_features;
unsigned char cind_pos[HFP_INDICATOR_LAST];
unsigned int cind_val[HFP_INDICATOR_LAST];
unsigned short hf_indicators[20];
unsigned char num_hf_indicators;
unsigned int hf_indicator_active_map;
};
void hfp_slc_info_init(struct hfp_slc_info *info, guint16 version);

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -37,6 +36,7 @@
#include <ofono/voicecall.h>
#include "common.h"
#include "hfp.h"
#include "hfpmodem.h"
#include "slc.h"
@@ -45,6 +45,7 @@
#define POLL_CLCC_DELAY 50
#define EXPECT_RELEASE_DELAY 50
#define CLIP_TIMEOUT 500
#define EXPECT_RING_DELAY 200
static const char *none_prefix[] = { NULL };
static const char *clcc_prefix[] = { "+CLCC:", NULL };
@@ -123,6 +124,7 @@ static struct ofono_call *create_call(struct ofono_voicecall *vc, int type,
if (clip != 2) {
strncpy(call->phone_number.number, num,
OFONO_MAX_PHONE_NUMBER_LENGTH);
call->phone_number.number[OFONO_MAX_PHONE_NUMBER_LENGTH] = '\0';
call->phone_number.type = num_type;
}
@@ -284,8 +286,7 @@ static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data)
ofono_voicecall_mpty_hint(vc, mpty_ids);
g_slist_foreach(vd->calls, (GFunc) g_free, NULL);
g_slist_free(vd->calls);
g_slist_free_full(vd->calls, g_free);
vd->calls = calls;
@@ -293,7 +294,7 @@ static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data)
* we won't get indicator update if any of them is released by CHLD=1x.
* So we have to poll it.
*/
if (num_active > 1 || num_held > 1)
if ((num_active > 1 || num_held > 1) && !vd->clcc_source)
vd->clcc_source = g_timeout_add(POLL_CLCC_INTERVAL, poll_clcc,
vc);
}
@@ -331,6 +332,10 @@ static void generic_cb(gboolean ok, GAtResult *result, gpointer user_data)
}
}
if (!ok && vd->calls)
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
clcc_poll_cb, req->vc, NULL);
req->cb(&error, req->data);
}
@@ -399,6 +404,45 @@ static void hfp_dial(struct ofono_voicecall *vc,
CALLBACK_WITH_FAILURE(cb, data);
}
static void hfp_dial_last(struct ofono_voicecall *vc, ofono_voicecall_cb_t cb,
void *data)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
struct cb_data *cbd = cb_data_new(cb, data);
cbd->user = vc;
if (g_at_chat_send(vd->chat, "AT+BLDN", none_prefix,
atd_cb, cbd, g_free) > 0)
return;
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, data);
}
static void hfp_dial_memory(struct ofono_voicecall *vc,
unsigned int memory_location,
ofono_voicecall_cb_t cb, void *data)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[256];
cbd->user = vc;
DBG("Calling memory location %d\n", memory_location);
snprintf(buf, sizeof(buf), "ATD>%d;", memory_location);
if (g_at_chat_send(vd->chat, buf, none_prefix,
atd_cb, cbd, g_free) > 0)
return;
g_free(cbd);
DBG("at_chat_failed");
CALLBACK_WITH_FAILURE(cb, data);
}
static void hfp_template(const char *cmd, struct ofono_voicecall *vc,
GAtResultFunc result_cb, unsigned int affected_types,
ofono_voicecall_cb_t cb, void *data)
@@ -447,7 +491,7 @@ static void hfp_hold_all_active(struct ofono_voicecall *vc,
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
if (vd->ag_mpty_features & AG_CHLD_2) {
if (vd->ag_mpty_features & HFP_AG_CHLD_2) {
hfp_template("AT+CHLD=2", vc, generic_cb, 0, cb, data);
return;
}
@@ -461,7 +505,7 @@ static void hfp_release_all_held(struct ofono_voicecall *vc,
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
unsigned int held_status = 1 << CALL_STATUS_HELD;
if (vd->ag_mpty_features & AG_CHLD_0) {
if (vd->ag_mpty_features & HFP_AG_CHLD_0) {
hfp_template("AT+CHLD=0", vc, generic_cb, held_status,
cb, data);
return;
@@ -476,7 +520,7 @@ static void hfp_set_udub(struct ofono_voicecall *vc,
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
unsigned int incoming_or_waiting = 1 << CALL_STATUS_WAITING;
if (vd->ag_mpty_features & AG_CHLD_0) {
if (vd->ag_mpty_features & HFP_AG_CHLD_0) {
hfp_template("AT+CHLD=0", vc, generic_cb, incoming_or_waiting,
cb, data);
return;
@@ -498,6 +542,19 @@ static gboolean expect_release(gpointer user_data)
return FALSE;
}
static gboolean expect_ring(gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
clcc_poll_cb, vc, NULL);
vd->clip_source = 0;
return FALSE;
}
static void release_all_active_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
@@ -528,7 +585,7 @@ static void hfp_release_all_active(struct ofono_voicecall *vc,
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
if (vd->ag_mpty_features & AG_CHLD_1) {
if (vd->ag_mpty_features & HFP_AG_CHLD_1) {
hfp_template("AT+CHLD=1", vc, release_all_active_cb, 0x1, cb,
data);
return;
@@ -559,7 +616,7 @@ static void hfp_release_specific(struct ofono_voicecall *vc, int id,
struct release_id_req *req = NULL;
char buf[32];
if (!(vd->ag_mpty_features & AG_CHLD_1x))
if (!(vd->ag_mpty_features & HFP_AG_CHLD_1x))
goto error;
req = g_try_new0(struct release_id_req, 1);
@@ -590,7 +647,7 @@ static void hfp_private_chat(struct ofono_voicecall *vc, int id,
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
char buf[32];
if (vd->ag_mpty_features & AG_CHLD_2x) {
if (vd->ag_mpty_features & HFP_AG_CHLD_2x) {
snprintf(buf, sizeof(buf), "AT+CHLD=2%d", id);
hfp_template(buf, vc, generic_cb, 0, cb, data);
@@ -606,7 +663,7 @@ static void hfp_create_multiparty(struct ofono_voicecall *vc,
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
if (vd->ag_mpty_features & AG_CHLD_3) {
if (vd->ag_mpty_features & HFP_AG_CHLD_3) {
hfp_template("AT+CHLD=3", vc, generic_cb, 0, cb, data);
return;
@@ -625,7 +682,7 @@ static void hfp_transfer(struct ofono_voicecall *vc,
*/
unsigned int transfer = 0x1 | 0x2 | 0x4 | 0x8;
if (vd->ag_mpty_features & AG_CHLD_4) {
if (vd->ag_mpty_features & HFP_AG_CHLD_4) {
hfp_template("AT+CHLD=4", vc, generic_cb, transfer, cb, data);
return;
@@ -639,8 +696,10 @@ static void hfp_send_dtmf(struct ofono_voicecall *vc, const char *dtmf,
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
struct change_state_req *req = g_try_new0(struct change_state_req, 1);
int len = strlen(dtmf);
char *buf;
int s;
int i;
if (req == NULL)
goto error;
@@ -650,12 +709,15 @@ static void hfp_send_dtmf(struct ofono_voicecall *vc, const char *dtmf,
req->data = data;
req->affected_types = 0;
/* strlen("AT+VTS=) = 7 + NULL */
buf = g_try_new(char, strlen(dtmf) + 8);
/* strlen("AT") + (n-1) * strlen("+VTS=T;") + strlen(+VTS=T) + null */
buf = g_try_new(char, len * 7 + 2);
if (buf == NULL)
goto error;
sprintf(buf, "AT+VTS=%s", dtmf);
s = sprintf(buf, "AT+VTS=%c", dtmf[0]);
for (i = 1; i < len; i++)
s += sprintf(buf + s, ";+VTS=%c", dtmf[i]);
s = g_at_chat_send(vd->chat, buf, none_prefix,
generic_cb, req, g_free);
@@ -685,12 +747,31 @@ static void ccwa_notify(GAtResult *result, gpointer user_data)
int num_type, validity;
struct ofono_call *call;
/* Waiting call notification makes no sense, when there are
* no calls at all. This can happen when a phone already has
* waiting and active calls and is being connected over HFP
* but it first sends +CCWA before we manage to synchronize
* calls with AT+CLCC.
*/
if (!vd->calls)
return;
/* CCWA can repeat, ignore if we already have an waiting call */
if (g_slist_find_custom(vd->calls,
GINT_TO_POINTER(CALL_STATUS_WAITING),
at_util_call_compare_by_status))
return;
/* some phones may send extra CCWA after active call is ended
* this would trigger creation of second call in state 'WAITING'
* as our previous WAITING call has been promoted to INCOMING
*/
if (g_slist_find_custom(vd->calls,
GINT_TO_POINTER(CALL_STATUS_INCOMING),
at_util_call_compare_by_status))
return;
g_at_result_iter_init(&iter, result);
if (!g_at_result_iter_next(&iter, "+CCWA:"))
@@ -751,6 +832,11 @@ static void ring_notify(GAtResult *result, gpointer user_data)
struct ofono_call *call;
GSList *waiting;
if (vd->clip_source) {
g_source_remove(vd->clip_source);
vd->clip_source = 0;
}
/* RING can repeat, ignore if we already have an incoming call */
if (g_slist_find_custom(vd->calls,
GINT_TO_POINTER(CALL_STATUS_INCOMING),
@@ -975,7 +1061,15 @@ static void ciev_callsetup_notify(struct ofono_voicecall *vc,
break;
case 1:
/* Handled in RING/CCWA */
/*
* Handled in RING/CCWA most of the time, however sometimes
* the call is answered before the RING unsolicited
* notification has a chance to be generated on the device.
* In this case, we use a failsafe CLCC poll in expect_ring
* callback.
* */
vd->clip_source = g_timeout_add(EXPECT_RING_DELAY,
expect_ring, vc);
break;
case 2:
@@ -1063,6 +1157,17 @@ static void ciev_callheld_notify(struct ofono_voicecall *vc,
*/
vd->clcc_source = g_timeout_add(POLL_CLCC_DELAY,
poll_clcc, vc);
} else {
if (vd->clcc_source)
g_source_remove(vd->clcc_source);
/*
* We got a notification that there is a held call
* and no active call but we already are in such state.
* Let's schedule a poll to see what happened.
*/
vd->clcc_source = g_timeout_add(POLL_CLCC_DELAY,
poll_clcc, vc);
}
}
@@ -1101,6 +1206,10 @@ static void hfp_clcc_cb(gboolean ok, GAtResult *result, gpointer user_data)
struct ofono_voicecall *vc = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
unsigned int mpty_ids;
GSList *n;
struct ofono_call *nc;
unsigned int num_active = 0;
unsigned int num_held = 0;
if (!ok)
return;
@@ -1109,6 +1218,22 @@ static void hfp_clcc_cb(gboolean ok, GAtResult *result, gpointer user_data)
g_slist_foreach(vd->calls, voicecall_notify, vc);
ofono_voicecall_mpty_hint(vc, mpty_ids);
n = vd->calls;
while (n) {
nc = n->data;
if (nc->status == CALL_STATUS_ACTIVE)
num_active++;
else if (nc->status == CALL_STATUS_HELD)
num_held++;
n = n->next;
}
if ((num_active > 1 || num_held > 1) && !vd->clcc_source)
vd->clcc_source = g_timeout_add(POLL_CLCC_INTERVAL, poll_clcc, vc);
}
static void hfp_voicecall_initialized(gboolean ok, GAtResult *result,
@@ -1150,8 +1275,8 @@ static int hfp_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
ofono_voicecall_set_data(vc, vd);
g_at_chat_send(vd->chat, "AT+CLIP=1", NULL, NULL, NULL, NULL);
g_at_chat_send(vd->chat, "AT+CCWA=1", NULL,
g_at_chat_send(vd->chat, "AT+CLIP=1", none_prefix, NULL, NULL, NULL);
g_at_chat_send(vd->chat, "AT+CCWA=1", none_prefix,
hfp_voicecall_initialized, vc, NULL);
return 0;
}
@@ -1169,8 +1294,7 @@ static void hfp_voicecall_remove(struct ofono_voicecall *vc)
if (vd->expect_release_source)
g_source_remove(vd->expect_release_source);
g_slist_foreach(vd->calls, (GFunc) g_free, NULL);
g_slist_free(vd->calls);
g_slist_free_full(vd->calls, g_free);
ofono_voicecall_set_data(vc, NULL);
@@ -1178,11 +1302,13 @@ static void hfp_voicecall_remove(struct ofono_voicecall *vc)
g_free(vd);
}
static struct ofono_voicecall_driver driver = {
static const struct ofono_voicecall_driver driver = {
.name = "hfpmodem",
.probe = hfp_voicecall_probe,
.remove = hfp_voicecall_remove,
.dial = hfp_dial,
.dial_last = hfp_dial_last,
.dial_memory = hfp_dial_memory,
.answer = hfp_answer,
.hangup_active = hfp_hangup,
.hold_all_active = hfp_hold_all_active,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -379,7 +378,7 @@ static void hso_gprs_context_remove(struct ofono_gprs_context *gc)
g_free(gcd);
}
static struct ofono_gprs_context_driver driver = {
static const struct ofono_gprs_context_driver driver = {
.name = "hsomodem",
.probe = hso_gprs_context_probe,
.remove = hso_gprs_context_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -199,7 +198,7 @@ static void hso_radio_settings_remove(struct ofono_radio_settings *rs)
g_free(rsd);
}
static struct ofono_radio_settings_driver driver = {
static const struct ofono_radio_settings_driver driver = {
.name = "hsomodem",
.probe = hso_radio_settings_probe,
.remove = hso_radio_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -113,7 +112,7 @@ static void huawei_audio_settings_remove(struct ofono_audio_settings *as)
g_free(asd);
}
static struct ofono_audio_settings_driver driver = {
static const struct ofono_audio_settings_driver driver = {
.name = "huaweimodem",
.probe = huawei_audio_settings_probe,
.remove = huawei_audio_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <glib.h>
#include <errno.h>
@@ -210,7 +209,7 @@ static void huawei_cdma_netreg_remove(struct ofono_cdma_netreg *netreg)
g_at_chat_unref(chat);
}
static struct ofono_cdma_netreg_driver driver = {
static const struct ofono_cdma_netreg_driver driver = {
.name = "huaweimodem",
.probe = huawei_cdma_netreg_probe,
.remove = huawei_cdma_netreg_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -80,7 +79,7 @@ static gboolean get_next_addr(GAtResultIter *iter, char **addr)
if (g_at_result_iter_next_unquoted_string(iter, &str) == FALSE)
return FALSE;
val = strtol(str, NULL, 16);
val = strtoul(str, NULL, 16);
if (addr)
*addr = g_strdup_printf("%u.%u.%u.%u",
@@ -339,7 +338,7 @@ static void huawei_gprs_context_remove(struct ofono_gprs_context *gc)
g_free(gcd);
}
static struct ofono_gprs_context_driver driver = {
static const struct ofono_gprs_context_driver driver = {
.name = "huaweimodem",
.probe = huawei_gprs_context_probe,
.remove = huawei_gprs_context_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -42,11 +41,13 @@
static const char *none_prefix[] = { NULL };
static const char *syscfg_prefix[] = { "^SYSCFG:", NULL };
static const char *syscfgex_prefix[] = { "^SYSCFGEX:", NULL };
#define HUAWEI_BAND_ANY 0x3FFFFFFF
struct radio_settings_data {
GAtChat *chat;
ofono_bool_t syscfgex_cap;
};
static const struct huawei_band_gsm_table {
@@ -176,20 +177,76 @@ error:
CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
}
static void syscfgex_query_mode_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_radio_settings_rat_mode_query_cb_t cb = cbd->cb;
enum ofono_radio_access_mode mode;
struct ofono_error error;
GAtResultIter iter;
const char *acqorder;
decode_at_error(&error, g_at_result_final_response(result));
if (!ok) {
cb(&error, -1, cbd->data);
return;
}
g_at_result_iter_init(&iter, result);
if (g_at_result_iter_next(&iter, "^SYSCFGEX:") == FALSE)
goto error;
if (g_at_result_iter_next_string(&iter, &acqorder) == FALSE)
goto error;
if ((strcmp(acqorder, "00") == 0) ||
(strstr(acqorder, "01") &&
strstr(acqorder, "02") &&
strstr(acqorder, "03")))
mode = OFONO_RADIO_ACCESS_MODE_ANY;
else if (strstr(acqorder, "03"))
mode = OFONO_RADIO_ACCESS_MODE_LTE;
else if (strstr(acqorder, "02"))
mode = OFONO_RADIO_ACCESS_MODE_UMTS;
else if (strstr(acqorder, "01"))
mode = OFONO_RADIO_ACCESS_MODE_GSM;
else
goto error;
cb(&error, mode, cbd->data);
return;
error:
CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
}
static void huawei_query_rat_mode(struct ofono_radio_settings *rs,
ofono_radio_settings_rat_mode_query_cb_t cb, void *data)
{
struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
struct cb_data *cbd = cb_data_new(cb, data);
if (g_at_chat_send(rsd->chat, "AT^SYSCFG?", syscfg_prefix,
syscfg_query_mode_cb, cbd, g_free) == 0) {
CALLBACK_WITH_FAILURE(cb, -1, data);
g_free(cbd);
}
if (rsd->syscfgex_cap && g_at_chat_send(rsd->chat, "AT^SYSCFGEX?",
syscfgex_prefix,
syscfgex_query_mode_cb,
cbd, g_free) > 0)
return;
if (!rsd->syscfgex_cap && g_at_chat_send(rsd->chat, "AT^SYSCFG?",
syscfg_prefix,
syscfg_query_mode_cb,
cbd, g_free) > 0)
return;
CALLBACK_WITH_FAILURE(cb, -1, data);
g_free(cbd);
}
static void syscfg_modify_mode_cb(gboolean ok, GAtResult *result,
static void syscfgxx_modify_mode_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
@@ -200,12 +257,11 @@ static void syscfg_modify_mode_cb(gboolean ok, GAtResult *result,
cb(&error, cbd->data);
}
static void huawei_set_rat_mode(struct ofono_radio_settings *rs,
static void syscfg_set_rat_mode(struct radio_settings_data *rsd,
enum ofono_radio_access_mode mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{
struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[40];
unsigned int value = 2, acq_order = 0;
@@ -231,7 +287,7 @@ static void huawei_set_rat_mode(struct ofono_radio_settings *rs,
value, acq_order);
if (g_at_chat_send(rsd->chat, buf, none_prefix,
syscfg_modify_mode_cb, cbd, g_free) > 0)
syscfgxx_modify_mode_cb, cbd, g_free) > 0)
return;
error:
@@ -239,7 +295,55 @@ error:
g_free(cbd);
}
static void syscfg_modify_band_cb(gboolean ok, GAtResult *result,
static void syscfgex_set_rat_mode(struct radio_settings_data *rsd,
enum ofono_radio_access_mode mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{
struct cb_data *cbd = cb_data_new(cb, data);
char buf[50];
char *atcmd = "AT^SYSCFGEX=\"%s\",40000000,2,4,40000000,,";
char *acqorder = "030201";
switch (mode) {
case OFONO_RADIO_ACCESS_MODE_ANY:
acqorder = "00";
break;
case OFONO_RADIO_ACCESS_MODE_GSM:
acqorder = "01";
break;
case OFONO_RADIO_ACCESS_MODE_UMTS:
acqorder = "02";
break;
case OFONO_RADIO_ACCESS_MODE_LTE:
acqorder = "03";
break;
}
snprintf(buf, sizeof(buf), atcmd, acqorder);
if (g_at_chat_send(rsd->chat, buf, none_prefix,
syscfgxx_modify_mode_cb, cbd, g_free) > 0)
return;
CALLBACK_WITH_FAILURE(cb, data);
g_free(cbd);
}
static void huawei_set_rat_mode(struct ofono_radio_settings *rs,
enum ofono_radio_access_mode mode,
ofono_radio_settings_rat_mode_set_cb_t cb,
void *data)
{
struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
if (rsd->syscfgex_cap)
syscfgex_set_rat_mode(rsd, mode, cb, data);
else
syscfg_set_rat_mode(rsd, mode, cb, data);
}
static void syscfgxx_modify_band_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
@@ -250,13 +354,54 @@ static void syscfg_modify_band_cb(gboolean ok, GAtResult *result,
cb(&error, cbd->data);
}
static void huawei_set_band(struct ofono_radio_settings *rs,
static void syscfgex_set_band(struct radio_settings_data *rsd,
enum ofono_radio_band_gsm band_gsm,
enum ofono_radio_band_umts band_umts,
ofono_radio_settings_band_set_cb_t cb,
void *data)
{
struct cb_data *cbd = cb_data_new(cb, data);
char buf[50];
char *atcmd = "AT^SYSCFGEX=\"99\",%x,2,4,40000000,,";
unsigned int huawei_band;
if (band_gsm == OFONO_RADIO_BAND_GSM_ANY
&& band_umts == OFONO_RADIO_BAND_UMTS_ANY) {
huawei_band = HUAWEI_BAND_ANY;
} else {
unsigned int huawei_band_gsm;
unsigned int huawei_band_umts;
huawei_band_gsm = band_gsm_to_huawei(band_gsm);
if (!huawei_band_gsm)
goto error;
huawei_band_umts = band_umts_to_huawei(band_umts);
if (!huawei_band_umts)
goto error;
huawei_band = huawei_band_gsm | huawei_band_umts;
}
snprintf(buf, sizeof(buf), atcmd, huawei_band);
if (g_at_chat_send(rsd->chat, buf, none_prefix,
syscfgxx_modify_band_cb, cbd, g_free) > 0)
return;
error:
CALLBACK_WITH_FAILURE(cb, data);
g_free(cbd);
}
static void syscfg_set_band(struct radio_settings_data *rsd,
enum ofono_radio_band_gsm band_gsm,
enum ofono_radio_band_umts band_umts,
ofono_radio_settings_band_set_cb_t cb,
void *data)
{
struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[40];
unsigned int huawei_band;
@@ -284,7 +429,7 @@ static void huawei_set_band(struct ofono_radio_settings *rs,
snprintf(buf, sizeof(buf), "AT^SYSCFG=16,3,%x,2,4", huawei_band);
if (g_at_chat_send(rsd->chat, buf, none_prefix,
syscfg_modify_band_cb, cbd, g_free) > 0)
syscfgxx_modify_band_cb, cbd, g_free) > 0)
return;
error:
@@ -292,6 +437,20 @@ error:
g_free(cbd);
}
static void huawei_set_band(struct ofono_radio_settings *rs,
enum ofono_radio_band_gsm band_gsm,
enum ofono_radio_band_umts band_umts,
ofono_radio_settings_band_set_cb_t cb,
void *data)
{
struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
if (rsd->syscfgex_cap)
syscfgex_set_band(rsd, band_gsm, band_umts, cb, data);
else
syscfg_set_band(rsd, band_gsm, band_umts, cb, data);
}
static void syscfg_query_band_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
@@ -364,6 +523,21 @@ static void syscfg_support_cb(gboolean ok, GAtResult *result,
ofono_radio_settings_register(rs);
}
static void syscfgex_support_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct ofono_radio_settings *rs = user_data;
struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
if (!ok) {
g_at_chat_send(rsd->chat, "AT^SYSCFG=?", syscfg_prefix,
syscfg_support_cb, rs, NULL);
}
rsd->syscfgex_cap = 1;
ofono_radio_settings_register(rs);
}
static int huawei_radio_settings_probe(struct ofono_radio_settings *rs,
unsigned int vendor, void *data)
{
@@ -378,8 +552,8 @@ static int huawei_radio_settings_probe(struct ofono_radio_settings *rs,
ofono_radio_settings_set_data(rs, rsd);
g_at_chat_send(rsd->chat, "AT^SYSCFG=?", syscfg_prefix,
syscfg_support_cb, rs, NULL);
g_at_chat_send(rsd->chat, "AT^SYSCFGEX=?", syscfgex_prefix,
syscfgex_support_cb, rs, NULL);
return 0;
}
@@ -394,14 +568,14 @@ static void huawei_radio_settings_remove(struct ofono_radio_settings *rs)
g_free(rsd);
}
static struct ofono_radio_settings_driver driver = {
static const struct ofono_radio_settings_driver driver = {
.name = "huaweimodem",
.probe = huawei_radio_settings_probe,
.remove = huawei_radio_settings_remove,
.query_rat_mode = huawei_query_rat_mode,
.set_rat_mode = huawei_set_rat_mode,
.query_band = huawei_query_band,
.set_band = huawei_set_band,
.query_band = huawei_query_band,
.set_band = huawei_set_band,
};
void huawei_radio_settings_init(void)

View File

@@ -204,7 +204,7 @@ static void huawei_ussd_remove(struct ofono_ussd *ussd)
g_free(data);
}
static struct ofono_ussd_driver driver = {
static const struct ofono_ussd_driver driver = {
.name = "huaweimodem",
.probe = huawei_ussd_probe,
.remove = huawei_ussd_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -497,7 +496,7 @@ static void huawei_voicecall_remove(struct ofono_voicecall *vc)
g_free(vd);
}
static struct ofono_voicecall_driver driver = {
static const struct ofono_voicecall_driver driver = {
.name = "huaweimodem",
.probe = huawei_voicecall_probe,
.remove = huawei_voicecall_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -403,7 +402,7 @@ static void icera_gprs_context_remove(struct ofono_gprs_context *gc)
g_free(gcd);
}
static struct ofono_gprs_context_driver driver = {
static const struct ofono_gprs_context_driver driver = {
.name = "iceramodem",
.probe = icera_gprs_context_probe,
.remove = icera_gprs_context_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -212,7 +211,7 @@ static void icera_radio_settings_remove(struct ofono_radio_settings *rs)
g_free(rsd);
}
static struct ofono_radio_settings_driver driver = {
static const struct ofono_radio_settings_driver driver = {
.name = "iceramodem",
.probe = icera_radio_settings_probe,
.remove = icera_radio_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -382,7 +381,7 @@ static void ifx_audio_settings_remove(struct ofono_audio_settings *as)
g_free(asd);
}
static struct ofono_audio_settings_driver driver = {
static const struct ofono_audio_settings_driver driver = {
.name = "ifxmodem",
.probe = ifx_audio_settings_probe,
.remove = ifx_audio_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -167,7 +166,7 @@ static void ifx_ctm_remove(struct ofono_ctm *ctm)
g_free(ctmd);
}
static struct ofono_ctm_driver driver = {
static const struct ofono_ctm_driver driver = {
.name = "ifxmodem",
.probe = ifx_ctm_probe,
.remove = ifx_ctm_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -42,13 +41,14 @@
#include "ifxmodem.h"
#define TUN_SYSFS_DIR "/sys/devices/virtual/misc/tun"
#define TUN_DEV "/dev/net/tun"
#define STATIC_IP_NETMASK "255.255.255.255"
static const char *none_prefix[] = { NULL };
static const char *xdns_prefix[] = { "+XDNS:", NULL };
static const char *cgpaddr_prefix[] = { "+CGPADDR:", NULL };
static const char *cgcontrdp_prefix[] = { "+CGCONTRDP:", NULL };
enum state {
STATE_IDLE,
@@ -59,17 +59,20 @@ enum state {
struct gprs_context_data {
GAtChat *chat;
unsigned int vendor;
unsigned int active_context;
char username[OFONO_GPRS_MAX_USERNAME_LENGTH + 1];
char password[OFONO_GPRS_MAX_PASSWORD_LENGTH + 1];
GAtRawIP *rawip;
enum state state;
enum ofono_gprs_proto proto;
char address[32];
char dns1[32];
char dns2[32];
char address[64];
char gateway[64];
char netmask[64];
char dns1[64];
char dns2[64];
ofono_gprs_context_cb_t cb;
void *cb_data; /* Callback data */
void *cb_data;
};
static void rawip_debug(const char *str, void *data)
@@ -257,12 +260,190 @@ error:
failed_setup(gc, NULL, TRUE);
}
static void activate_cb(gboolean ok, GAtResult *result, gpointer user_data)
static void cgdata_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_gprs_context *gc = user_data;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
DBG("ok %d", ok);
if (!ok) {
ofono_error("Failed to establish session");
failed_setup(gc, result, TRUE);
return;
}
CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
}
static const char *get_datapath(struct ofono_modem *modem,
const char *interface)
{
static char datapath[256];
char n;
if (!strcmp(interface,
ofono_modem_get_string(modem, "NetworkInterface")))
n = '0';
else if (!strcmp(interface,
ofono_modem_get_string(modem, "NetworkInterface2")))
n = '1';
else if (!strcmp(interface,
ofono_modem_get_string(modem, "NetworkInterface3")))
n = '2';
else
return NULL;
snprintf(datapath, sizeof(datapath), "%s%c",
ofono_modem_get_string(modem, "DataPath"), n);
return datapath;
}
static void cgcontrdp_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_gprs_context *gc = user_data;
struct ofono_modem *modem = ofono_gprs_context_get_modem(gc);
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
GAtResultIter iter;
const char *laddrnetmask = NULL;
const char *gw = NULL;
const char *dns[3];
const char *ctrlpath;
const char *datapath;
char buf[512];
const char *interface;
DBG("ok %d", ok);
if (!ok) {
struct ofono_error error;
decode_at_error(&error, g_at_result_final_response(result));
gcd->cb(&error, gcd->cb_data);
return;
}
g_at_result_iter_init(&iter, result);
while (g_at_result_iter_next(&iter, "+CGCONTRDP:")) {
/* skip cid, bearer_id, apn */
g_at_result_iter_skip_next(&iter);
g_at_result_iter_skip_next(&iter);
g_at_result_iter_skip_next(&iter);
if (!g_at_result_iter_next_string(&iter, &laddrnetmask))
break;
if (!g_at_result_iter_next_string(&iter, &gw))
break;
if (!g_at_result_iter_next_string(&iter, &dns[0]))
break;
if (!g_at_result_iter_next_string(&iter, &dns[1]))
break;
}
strncpy(gcd->dns1, dns[0], sizeof(gcd->dns1));
strncpy(gcd->dns2, dns[1], sizeof(gcd->dns2));
dns[2] = 0;
DBG("DNS: %s, %s\n", gcd->dns1, gcd->dns2);
if (!laddrnetmask || at_util_get_ipv4_address_and_netmask(laddrnetmask,
gcd->address, gcd->netmask) < 0) {
failed_setup(gc, NULL, TRUE);
return;
}
if (gw)
strncpy(gcd->gateway, gw, sizeof(gcd->gateway));
gcd->state = STATE_ACTIVE;
DBG("address: %s\n", gcd->address);
DBG("netmask: %s\n", gcd->netmask);
DBG("DNS1: %s\n", gcd->dns1);
DBG("DNS2: %s\n", gcd->dns2);
DBG("Gateway: %s\n", gcd->gateway);
ctrlpath = ofono_modem_get_string(modem, "CtrlPath");
interface = ofono_gprs_context_get_interface(gc);
datapath = get_datapath(modem, interface);
ofono_gprs_context_set_ipv4_address(gc, gcd->address, TRUE);
if (gcd->netmask[0])
ofono_gprs_context_set_ipv4_netmask(gc, gcd->netmask);
if (gcd->gateway[0])
ofono_gprs_context_set_ipv4_gateway(gc, gcd->gateway);
ofono_gprs_context_set_ipv4_dns_servers(gc, dns);
snprintf(buf, sizeof(buf), "AT+XDATACHANNEL=1,1,\"%s\",\"%s\",2,%u",
ctrlpath, datapath, gcd->active_context);
g_at_chat_send(gcd->chat, buf, none_prefix, NULL, NULL, NULL);
snprintf(buf, sizeof(buf), "AT+CGDATA=\"M-RAW_IP\",%u",
gcd->active_context);
if (g_at_chat_send(gcd->chat, buf, none_prefix, cgdata_cb,
gc, NULL) > 0)
return;
CALLBACK_WITH_FAILURE(gcd->cb, gcd->cb_data);
}
static void ifx_read_settings(struct ofono_gprs_context *gc)
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
char buf[64];
gcd->address[0] = '\0';
gcd->gateway[0] = '\0';
gcd->netmask[0] = '\0';
gcd->dns1[0] = '\0';
gcd->dns2[0] = '\0';
/* read IP configuration info */
if(gcd->vendor == OFONO_VENDOR_XMM) {
snprintf(buf, sizeof(buf), "AT+CGCONTRDP=%u",
gcd->active_context);
if (g_at_chat_send(gcd->chat, buf, cgcontrdp_prefix,
cgcontrdp_cb, gc, NULL) > 0)
return;
} else {
sprintf(buf, "AT+CGPADDR=%u", gcd->active_context);
if (g_at_chat_send(gcd->chat, buf, cgpaddr_prefix,
address_cb, gc, NULL) > 0)
return;
}
failed_setup(gc, NULL, TRUE);
}
static void ifx_gprs_read_settings(struct ofono_gprs_context *gc,
unsigned int cid,
ofono_gprs_context_cb_t cb, void *data)
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
DBG("cid %u", cid);
gcd->active_context = cid;
gcd->cb = cb;
gcd->cb_data = data;
ifx_read_settings(gc);
}
static void activate_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_gprs_context *gc = user_data;
DBG("ok %d", ok);
if (!ok) {
@@ -271,19 +452,14 @@ static void activate_cb(gboolean ok, GAtResult *result, gpointer user_data)
return;
}
sprintf(buf, "AT+CGPADDR=%u", gcd->active_context);
if (g_at_chat_send(gcd->chat, buf, cgpaddr_prefix,
address_cb, gc, NULL) > 0)
return;
failed_setup(gc, NULL, TRUE);
ifx_read_settings(gc);
}
static void setup_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_gprs_context *gc = user_data;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
char buf[128];
char buf[384];
DBG("ok %d", ok);
@@ -387,7 +563,11 @@ static void deactivate_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->active_context = 0;
gcd->state = STATE_IDLE;
g_at_chat_resume(gcd->chat);
if (gcd->vendor != OFONO_VENDOR_XMM)
g_at_chat_resume(gcd->chat);
if (!gcd->cb)
return;
CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
}
@@ -409,11 +589,25 @@ static void ifx_gprs_deactivate_primary(struct ofono_gprs_context *gc,
g_at_rawip_shutdown(gcd->rawip);
sprintf(buf, "AT+CGACT=0,%u", gcd->active_context);
if (g_at_chat_send(chat, buf, none_prefix,
deactivate_cb, gc, NULL) > 0)
return;
CALLBACK_WITH_SUCCESS(cb, data);
if (gcd->vendor == OFONO_VENDOR_XMM) {
if (g_at_chat_send(gcd->chat, buf, none_prefix,
deactivate_cb, gc, NULL) > 0)
return;
} else {
if (g_at_chat_send(chat, buf, none_prefix,
deactivate_cb, gc, NULL) > 0)
return;
}
CALLBACK_WITH_FAILURE(cb, data);
}
static void ifx_gprs_detach_shutdown(struct ofono_gprs_context *gc,
unsigned int cid)
{
DBG("");
ifx_gprs_deactivate_primary(gc, cid, NULL, NULL);
}
static void cgev_notify(GAtResult *result, gpointer user_data)
@@ -451,14 +645,13 @@ static void cgev_notify(GAtResult *result, gpointer user_data)
g_at_rawip_unref(gcd->rawip);
gcd->rawip = NULL;
g_at_chat_resume(gcd->chat);
}
ofono_gprs_context_deactivated(gc, gcd->active_context);
gcd->active_context = 0;
gcd->state = STATE_IDLE;
g_at_chat_resume(gcd->chat);
}
static int ifx_gprs_context_probe(struct ofono_gprs_context *gc,
@@ -470,23 +663,29 @@ static int ifx_gprs_context_probe(struct ofono_gprs_context *gc,
DBG("");
if (stat(TUN_SYSFS_DIR, &st) < 0) {
ofono_error("Missing support for TUN/TAP devices");
return -ENODEV;
if (vendor != OFONO_VENDOR_XMM) {
if (stat(TUN_DEV, &st) < 0) {
ofono_error("Missing support for TUN/TAP devices");
return -ENODEV;
}
}
if (g_at_chat_get_slave(chat) == NULL)
return -EINVAL;
if (vendor != OFONO_VENDOR_XMM) {
if (g_at_chat_get_slave(chat) == NULL)
return -EINVAL;
}
gcd = g_try_new0(struct gprs_context_data, 1);
if (gcd == NULL)
return -ENOMEM;
gcd->vendor = vendor;
gcd->chat = g_at_chat_clone(chat);
ofono_gprs_context_set_data(gc, gcd);
chat = g_at_chat_get_slave(gcd->chat);
if (vendor != OFONO_VENDOR_XMM)
chat = g_at_chat_get_slave(gcd->chat);
g_at_chat_register(chat, "+CGEV:", cgev_notify, FALSE, gc, NULL);
@@ -510,12 +709,14 @@ static void ifx_gprs_context_remove(struct ofono_gprs_context *gc)
g_free(gcd);
}
static struct ofono_gprs_context_driver driver = {
static const struct ofono_gprs_context_driver driver = {
.name = "ifxmodem",
.probe = ifx_gprs_context_probe,
.remove = ifx_gprs_context_remove,
.activate_primary = ifx_gprs_activate_primary,
.deactivate_primary = ifx_gprs_deactivate_primary,
.read_settings = ifx_gprs_read_settings,
.detach_shutdown = ifx_gprs_detach_shutdown
};
void ifx_gprs_context_init(void)

View File

@@ -20,6 +20,7 @@
*/
#include <drivers/atmodem/atutil.h>
#include <drivers/atmodem/vendor.h>
extern void ifx_voicecall_init(void);
extern void ifx_voicecall_exit(void);

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -201,7 +200,7 @@ static void ifx_radio_settings_remove(struct ofono_radio_settings *rs)
g_free(rsd);
}
static struct ofono_radio_settings_driver driver = {
static const struct ofono_radio_settings_driver driver = {
.name = "ifxmodem",
.probe = ifx_radio_settings_probe,
.remove = ifx_radio_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -307,7 +306,7 @@ static void ifx_stk_remove(struct ofono_stk *stk)
g_free(sd);
}
static struct ofono_stk_driver driver = {
static const struct ofono_stk_driver driver = {
.name = "ifxmodem",
.probe = ifx_stk_probe,
.remove = ifx_stk_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -1009,8 +1008,7 @@ static void ifx_voicecall_remove(struct ofono_voicecall *vc)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
g_slist_foreach(vd->calls, (GFunc) g_free, NULL);
g_slist_free(vd->calls);
g_slist_free_full(vd->calls, g_free);
g_strfreev(vd->en_list);
@@ -1020,7 +1018,7 @@ static void ifx_voicecall_remove(struct ofono_voicecall *vc)
g_free(vd);
}
static struct ofono_voicecall_driver driver = {
static const struct ofono_voicecall_driver driver = {
.name = "ifxmodem",
.probe = ifx_voicecall_probe,
.remove = ifx_voicecall_remove,

View File

@@ -0,0 +1,77 @@
/*
*
* RIL constants for infineon modem
*
* Copyright (C) 2014 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef INFINEON_CONSTANTS_H
#define INFINEON_CONSTANTS_H
/* Messages encapsulated in RIL_REQUEST_OEM_HOOK_RAW requests */
#define INF_RIL_REQUEST_OEM_QUERY_SELECT_BAND 1
#define INF_RIL_REQUEST_OEM_SET_SELECT_BAND 2
#define INF_RIL_REQUEST_OEM_SET_CIRCUIT_SWITCHING_PAGING 3
#define INF_RIL_REQUEST_OEM_GET_LAST_FAILURE_REPORT_FOR_CS_REGISTRATION 4
#define INF_RIL_REQUEST_OEM_GET_SELECT_BEARER_SERVICE_TYPE 5
#define INF_RIL_REQUEST_OEM_GET_XPROGRESS_STATUS 6
#define INF_RIL_REQUEST_OEM_SET_SS_NOTIFY 7
#define INF_RIL_REQUEST_OEM_GET_SS_NOTIFY 8
#define INF_RIL_REQUEST_OEM_SET_AUTHENTICATION_TYPE 9
#define INF_RIL_REQUEST_OEM_SWITCH_OFF_MS 10
#define INF_RIL_REQUEST_OEM_SET_AUTO_TIMEZONE_UPDATE 11
#define INF_RIL_REQUEST_OEM_SET_TIMEZONE_RESPORTING 12
#define INF_RIL_REQUEST_OEM_SET_DISPLAY_SIM_AND_PB_STATUS 13
#define INF_RIL_REQUEST_OEM_GET_REMAIN_SIM_PIN_ATTEMPTS 14
#define INF_RIL_REQUEST_OEM_SET_AUTO_REDIAL 15
#define INF_RIL_REQUEST_OEM_QUERY_CALL_STATUS_REPORTING 16
#define INF_RIL_REQUEST_OEM_SET_AUTO_ANSWER 17
#define INF_RIL_REQUEST_OEM_SET_LINE 18
#define INF_RIL_REQUEST_OEM_PDP_ACTIVATE_OR_DEACTIVATE 19
#define INF_RIL_REQUEST_OEM_QUERY_GPRS_MS_CLASS 20
#define INF_RIL_REQUEST_OEM_SET_TRACE_AND_AT_INTERFACES 21
#define INF_RIL_REQUEST_OEM_QUERY_TRACE_AND_AT_INTERFACES_CONFIGURE 22
#define INF_RIL_REQUEST_OEM_SWITCH_TRACE_ON_OR_OFF 23
#define INF_RIL_REQUEST_OEM_READ_EXCEPTION_LOG 24
#define INF_RIL_REQUEST_OEM_GET_PHONE_ACTIVITY_STATUS 25
#define INF_RIL_REQUEST_OEM_INITIATE_RESEND_SMS_IF_GPRS_FAILS 26
#define INF_RIL_REQUEST_OEM_GET_DEVICE_NUMBER 27
#define INF_RIL_REQUEST_OEM_ENABLE_STK 28
#define INF_RIL_REQUEST_OEM_GET_SUBSCRIBER_NUMBER 29
#define INF_RIL_REQUEST_OEM_SELECT_PHONE_BOOK 30
#define INF_RIL_REQUEST_OEM_READ_PHONE_BOOK 31
#define INF_RIL_REQUEST_OEM_INSERT_RECORD_TO_PHONE_BOOK 32
#define INF_RIL_REQUEST_OEM_DELECT_RECORD_IN_PHONE_BOOK 33
#define INF_RIL_REQUEST_OEM_GET_RECORD_FIELDS_MAX_LEN 34
#define INF_RIL_REQUEST_OEM_SET_SERIAL_PORT 35
#define INF_RIL_REQUEST_OEM_SET_DATA_PREFERED 36
#define INF_RIL_REQUEST_OEM_SET_MODEM_ROUTING 37
#define INF_RIL_REQUEST_OEM_CLEAR_MISS_NUMBER 38
#define INF_RIL_REQUEST_OEM_ATH 39
#define INF_RIL_REQUEST_OEM_NOSIG_MODE_TEST 40
#define INF_RIL_REQUEST_OEM_SELECT_3G_BAND 41
#define INF_RIL_REQUEST_OEM_QUERY_3G_BAND 42
#define INF_RIL_REQUEST_OEM_HW_RESET_MODEM 43
#define INF_RIL_REQUEST_OEM_QUERY_DIRECT 44
#define INF_RIL_REQUEST_OEM_USER_PLMN_QUERY 45
#define INF_RIL_REQUEST_OEM_USER_PLMN_SET 46
#define INF_RIL_REQUEST_OEM_USER_PLMN_DELTE 47
#define INF_RIL_REQUEST_OEM_SET_USB_LOG 48
#define INF_RIL_REQUEST_OEM_UPDATE_CSQ 49
#define INF_RIL_REQUEST_OEM_DUMP_CELL_ENV 50
#endif /* INFINEON_CONSTANTS_H */

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -117,7 +116,7 @@ static void isi_audio_settings_remove(struct ofono_audio_settings *as)
g_free(asd);
}
static struct ofono_audio_settings_driver driver = {
static const struct ofono_audio_settings_driver driver = {
.name = "isimodem",
.probe = isi_audio_settings_probe,
.remove = isi_audio_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -429,7 +428,7 @@ static void isi_call_barring_remove(struct ofono_call_barring *barr)
g_free(data);
}
static struct ofono_call_barring_driver driver = {
static const struct ofono_call_barring_driver driver = {
.name = "isimodem",
.probe = isi_call_barring_probe,
.remove = isi_call_barring_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -457,7 +456,7 @@ static void isi_call_forwarding_remove(struct ofono_call_forwarding *cf)
g_free(data);
}
static struct ofono_call_forwarding_driver driver = {
static const struct ofono_call_forwarding_driver driver = {
.name = "isimodem",
.probe = isi_call_forwarding_probe,
.remove = isi_call_forwarding_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -118,7 +117,7 @@ static void isi_call_meter_remove(struct ofono_call_meter *cm)
g_free(data);
}
static struct ofono_call_meter_driver driver = {
static const struct ofono_call_meter_driver driver = {
.name = "isimodem",
.probe = isi_call_meter_probe,
.remove = isi_call_meter_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -405,7 +404,7 @@ static void isi_call_settings_remove(struct ofono_call_settings *cs)
g_free(data);
}
static struct ofono_call_settings_driver driver = {
static const struct ofono_call_settings_driver driver = {
.name = "isimodem",
.probe = isi_call_settings_probe,
.remove = isi_call_settings_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -134,7 +133,9 @@ static void routing_resp_cb(const GIsiMessage *msg, void *data)
struct cbs_data *cd = ofono_cbs_get_data(cbs);
if (!check_resp(msg, SMS_GSM_CB_ROUTING_RESP)) {
ofono_cbs_remove(cbs);
/* on shutdown, cbs is already being removed */
if (g_isi_msg_error(msg) != -ESHUTDOWN)
ofono_cbs_remove(cbs);
return;
}
@@ -227,7 +228,7 @@ static void isi_cbs_remove(struct ofono_cbs *cbs)
g_free(cd);
}
static struct ofono_cbs_driver driver = {
static const struct ofono_cbs_driver driver = {
.name = "isimodem",
.probe = isi_cbs_probe,
.remove = isi_cbs_remove,

View File

@@ -23,7 +23,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

Some files were not shown because too many files have changed in this diff Show More