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
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.
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.
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.
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.
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, ...).
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.
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.
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
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.
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.
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
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.
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.
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);
^
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.
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.
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.
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.
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.
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>
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.
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.
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.
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.
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)
^
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)
^
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)
^
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.
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
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.
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.
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).
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
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.
For devices which are not 'real' phone modems, the voicecall
initialization can happen outside of the pre-sim state. In this case
the voicecall atom detection logic fails. Try to detect the voicecall
atom separately, and register the profile if the SIM atom is already
present and in state 'READY'.
For all other cases, the previous logic still applies.
When setting the SDP features, only enable wideband speech support if
the kernel has defer setup for SCO.
It is possible that even if defer setup is supported the kernel is
not able to use Transparent Mode for SCO.
It was a cause of confusion for little gain to have separate
functions for registering profiles with extra information, for
example "role" and "features". We remove those helper functions
in favor of a single one with more parameters, "role" and
"feature" when NULL, will be ignored.
A watch to G_IO_HUP is added to remove the file descriptor when the
emulator is automatically disconnected when its GAtServer closes.
We use a dupped file descriptor because the events aren't delivered to
the file descriptor who originated them.
This patch parses and reads the profile "Version" that comes in the fd
dictionary of the NewConnection method. "Version" is input for Audio Card
registration.
make --no-print-directory all-am
CC plugins/sim900.o
cc1: warnings being treated as errors
plugins/sim900.c: In function ‘shutdown_device’:
plugins/sim900.c:180:9: error: unused variable ‘fd’
make[1]: *** [plugins/sim900.o] Error 1
make: *** [all] Error 2
This patch adds initial implementation of the D-Bus Profile1
interface and methods responsible for handling Bluetooth connections.
The DUN GW profile interface is registered as soon as a GPRS capable
modem is registered in oFono.
As BlueZ 5 introduced backwards incompatible API changes, and we want to
keep support for BlueZ 4 based DUN GW plugin for some time, we need to
separate DUN GW plugin which is based on BlueZ 4 from the one based on
BlueZ 5.
The dun_gw.c plugin is renamed to dun_gw_bluez4. This will make it easy
to add a DUN GW plugin for BlueZ 5.
This patch moves the SCO socket handling from hfp_hf_bluez5 plugin. It
will be instead handled by the handsfree-audio functionality. This is
the initial step to be able to support sending the file descriptor
through the Agent NewConnection method.
RequestAuthorization method call may trigger pairing and/or pop up a
dialog in the remote device to which the user needs to react. Thus
increase D-Bus timeouts to 60 seconds for the Bluez 4 plugin.
This patch adds sending of the Version argument to RegisterProfile
method. The version is required to create the service record
containing the correct profile version.
The number of paired devices is quite small, so the use of the hash
table for lookup seems unnecessary. The typical user will have no more
than 1-2 devices paired, maybe half a dozen in a less common case.
Now that we have the support for sending the correct messages
to BlueZ, we are able to dynamically power up/down the HFP modem.
We add another property to the modem to be able to get the D-Bus
object path that represents the remote device.
This patch implements RequestDisconnection method of the Profile1
interface. This method gets called when the profile gets disconnected.
The profile implementation needs to cleanup the resources related to
the informed device.
This patch renames external profile registration functions replacing the
prefix from 'bluetooth_' to 'bt_' in order to follow the name convention
adopted for bluez5 functions.
This patch adds initial implementation of the D-Bus Profile1
interface and methods responsible for handling Bluetooth connections.
The HFP AG profile interface is registered as soon as a voice capable
modem is registered in oFono.
HFP modem will be registered when Proxy Added callback gets called
or when Pair is True. This patch removes the support for dynamic modem
registration when a new connection is notified and there isn't a modem
associated with the Bluetooth remote device.
BlueZ behaviour has been changed and a NewConnection is not notified
before the service discovery finishes.
As BlueZ 5 introduced backwards incompatible API changes, and we want to
keep support for BlueZ 4 based HFP AG plugin for some time, we need to
separate HFP AG plugin which is based on BlueZ 4 from the one based on
BlueZ 5.
The hfp_ag.c plugin is renamed to hfp_ag_bluez4. This will make it easy
to add an HFP AG plugin for BlueZ 5.
This patch removes unnecessary GDBusProxy object access when property
changed is triggered. The property name and the argument iterator is
informed in the function callback.
This patch adds the initial SCO server socket handling. BtIO and BlueZ
functions should not be used, with the new Profile API the objetive is
to get rid of these dependencies.
When receiving a NewConnection call from BlueZ, initiates the Service
Level Connection using the received file descriptor. The HFP modem
sub-components (devinfo, voicecall, netreg, handsfree and callvolume)
are created at this point.
Parse the essential arguments in the message, in this case only the
file descriptor, and register the modem if it is not already
registered. This is necessary because in some cases, we may receive a
NewConnection call, and the SDP process is still taking place.
Now that we are able to keep track of devices appearing and
disappearing from BlueZ, we are able to register the modem when a
device that supports the HFP AG UUID appears.
This patch adds the initial callbacks to track when BlueZ connects so
we can register our HFP external profile handler. And tracks the
interfaces added or removed.
This patch declares the external HFP Profile handler. It contains the
initial implementation of the D-Bus Profile1 interface and methods
responsible for handling Bluetooth connections.
This patch adds the initial file to support external HFP profile and
BlueZ 5. "hfp_hf_bluez5" plugin will implement an external Bluetooth
profile compatible with BlueZ 5, and "hfp_hf_bluez4" plugin will keep
the compatibility with BlueZ 4.
As BlueZ 5 introduced backwards incompatible API changes, and we want to
keep support for BlueZ 4 based plugins for some time, we need to separate
the plugins that are based on BlueZ 4 from the ones based on BlueZ 5.
The bluetooth.c plugin has now been renamed to bluez4.c and the hfp_hf.c
plugin is renamed to hfp_hf_bluez4. This will make it easy to add a
HFP HF plugin for BlueZ 5.