Commit Graph

386 Commits

Author SHA1 Message Date
Denis Kenzior 88c0f77a58 Refactor: First round of renaming 2009-10-23 17:05:53 -05:00
Denis Kenzior b2fd75014a Refactor: rename data-connection to gprs
Keep the name specific to GSM, other implementations will probably
require their own interfaces
2009-10-23 17:05:53 -05:00
Andrzej Zaborowski f43efa8a5f Add GPRS support
This commit implements the GPRS context setup and teardown according to
doc/dataconnectionmanager-api.txt

One issue with the AT implementation of the api is that "Powered" (a
read-write property) can be set independently of "Attached" (read-only
property) and remain set when "Attached" is clear.  The semantics would
be that the network doesn't have resources to let the modem attach,
but the modem waits for the resources to become available and then
attaches.  On AT the modem is in this state only when executing +CGATT,
so currently the code will rerun +CGATT as soon as the previous one
returns with error, probably starving other commands.  A possible
workaround would be for "Powered" to flip back to False after the modem
fails to attach once, or give up on having separate properties.
Alternatively we could re-try to attach periodically but on one modem
I've tried +CGATT fails after about 1 minute (that's the Calypso) and
on another only about 0.5s (Nokia phones with AT emulation).

When "Powered"  is set and "RoamingAllowed" is clear and we manage to
attach and find that we're roaming, ofono resets "Powered".

We may want to catch the user trying to dial *99***1# which is the
backwards compatibility quirk for old modems (same way ofono parses
USSD strings).
2009-10-23 17:05:53 -05:00
Denis Kenzior be55ba4ab3 Refactor: Move elementary file type checking
Every single EF read callback checks the file type reported out of the
SIM is what it expects.  Instead this should be done in one place and
the errors reported accordingly
2009-10-02 18:25:56 -05:00
Denis Kenzior 853bd2d6da Add Muted property to CallVolume atom 2009-09-29 14:56:22 -05:00
Denis Kenzior 6a271dd258 Refactor: Break up call volume notify 2009-09-29 14:56:22 -05:00
Denis Kenzior d76f674794 Cleanup: Do not expose DBus details to drivers 2009-09-29 14:56:21 -05:00
Zhenhua Zhang f5e24369ca Add call volume interface to adjust speaker and mic volume 2009-09-29 14:56:21 -05:00
Andrzej Zaborowski 2a02f45c79 Add plugin interface for getting PIN lock state.
It may be useful to have the information of whether card is currently
locked and emit events when this changes but if we want to have it as a
property, we would need properties for all types of locks and it wouldn't
be all that useful.
2009-09-23 14:27:52 -05:00
Denis Kenzior 5fd083f6f4 Refactor: Do not use int instead of enum
27.007 does not define an enumeration for SIM PIN/PUK values.  This
should be handled by ofono enum instead
2009-09-22 00:07:07 -05:00
Denis Kenzior 63416e2851 Rearrange sim password enum 2009-09-22 00:07:06 -05:00
Denis Kenzior 9f27be58bc Move some stuff around 2009-09-22 00:07:06 -05:00
Andrzej Zaborowski ee02b14836 Do PIN authentication
This adds checking whether PIN is required during SIM initialisation and
delaying the sim ready notifications until after correct PIN is given.
2009-09-22 00:07:06 -05:00
Denis Kenzior 0698fc2788 Split populate modem driver method
Introduce two new methods
	- pre_sim - SIM is not inserted or locked.  This should populate
	  the modem with atoms that can be used without the SIM.
	  Generally this is the devinfo atom, the sim atom and the voice
	  call atom (emergency calls only)
	- post_sim - SIM is ready.  This method should populate the
	  modem with the remaining atoms
2009-09-17 10:14:02 -05:00
Denis Kenzior 27cfc00eba Add netreg getter functions
- Get Location, CellID
- Current Operator
- Registration Status
- Technology
2009-09-10 18:19:48 -05:00
Denis Kenzior 40bc569024 Fix cut-paste error 2009-09-10 18:13:11 -05:00
Denis Kenzior 78b853a97d Add initial Cell Broadcast atom implementation 2009-09-10 16:13:16 -05:00
Marcel Holtmann 154102e873 Add modem properties for booleans 2009-09-08 09:12:19 +02:00
Denis Kenzior 7a95c41fab Get rid of node argument in ofono_modem_create 2009-09-02 17:39:23 -05:00
Denis Kenzior 8e62522575 Add modem property capability
Add ofono_modem_set_string & ofono_modem_get_string
Add ofono_modem_set_integer & ofono_modem_get_integer
2009-09-02 17:39:23 -05:00
Denis Kenzior 7ff85d9737 populate should return void 2009-09-01 22:29:02 -05:00
Denis Kenzior 9caa606bcc Make remove functions not return anything 2009-09-01 22:27:08 -05:00
Denis Kenzior 422df0edfb change int vendor to unsigned int vendor 2009-09-01 21:39:02 -05:00
Denis Kenzior 4064f4ba73 Add vendor flag capability to voicecalls 2009-09-01 18:14:59 -05:00
Denis Kenzior e5577046f0 Add vendor flag capability to ussd 2009-09-01 18:14:58 -05:00
Denis Kenzior afb0e2b854 Add vendor flag capability to ssn 2009-09-01 18:14:58 -05:00
Denis Kenzior 8d380f8fa0 Add vendor flag capability for sms 2009-09-01 18:14:58 -05:00
Denis Kenzior aecf42646e Add vendor flag capability to sim 2009-09-01 18:14:58 -05:00
Denis Kenzior 1fb9ecca46 Add vendor flag capability to phonebook 2009-09-01 18:14:58 -05:00
Denis Kenzior 271b042488 Add vendor flag capability to netreg 2009-09-01 18:14:58 -05:00
Denis Kenzior c7d35dd039 Add vendor flag capability to devinfo 2009-09-01 18:14:58 -05:00
Denis Kenzior 933f803967 Add vendor flag to call-settings 2009-09-01 18:14:58 -05:00
Denis Kenzior 390bd82109 Add vendor parameter to call-meter 2009-09-01 18:14:57 -05:00
Denis Kenzior 7ee954b28a Add vendor flag to call-forwarding 2009-09-01 18:14:57 -05:00
Denis Kenzior 15b1a733b0 Introduce vendor parameter to call-barring 2009-09-01 18:14:57 -05:00
Andrzej Zaborowski 7ecebc9a31 Expose service dialling numbers stored on SIM through SimManager. 2009-08-31 15:12:37 -05:00
Denis Kenzior 9967c407fa Reformat comments a little 2009-08-30 15:32:08 -05:00
Andres Salomon 34b73ace78 driver callback naming
On Sun, 30 Aug 2009 13:45:45 -0500
Denis Kenzior <denkenz@gmail.com> wrote:

> Hi Andres,
>
> > static struct ofono_modem_driver g1_driver = {
> >         .name = "HTC G1",
> >         .probe = g1_probe,
> >         .enable = g1_enable,
> >         .disable = g1_disable,
> >         .remove = g1_remove,
> >         .populate = g1_populate,
> > };
> >
>
> So the current intention:
> .probe - Detect whether device is really supported by the plugin,
> initialize any data structures specific to the device
> .remove - Destroy data structures
> .enable - Perform power up
> .disable - Perform power down
> .populate - Populate the atoms supported by this device (e.g. netreg,
> voicecall, etc)  This is called by the core after every power cycle,
> when the device is brought up.
>

Thanks!  See patch below.

> >
> > Of course, I'm also wondering why there needs to be two separate
> > layers of calls in the first place.  Why not have drivers register
> > everything from within probe, call ofono_set_powered(modem, TRUE)
> > once the device is ready, and be done with it?
>
> The reason for this is e.g. airplane mode, where you physically want
> to turn off the device.  Another case is for battery / power reasons,
> e.g. a netbook with a USB modem that is not being used.
>

Fair enough.  In the kernel, we have callbacks named suspend/resume
to handle that.

> > The only reason why this doesn't blow up in the generic_at plugin is
> > because the driver_data is leaked.  If one were to free it from
> > generic_at_exit in the wrong place (since it's allocated from
> > generic_at_init, it would make sense to free it in generic_at_exit),
> > one would see the same SEGV/SIGBUS/SIGILL errors upon ctrl-c.
>
> So the leak has now been fixed.
>
> I think you're being unnecessarily harsh here.  To be fair, the
> generic_at driver does something like this at init:

My criticism is simply w/ the naming.  'enable'/'disable' doesn't imply
anything about power.  powerup/powerdown, poweron/poweroff,
suspend/resume would all imply power state changes (at least the latter
would be familiar to those who do kernel stuff).  Having comments that
describe what the callbacks do would also work, though.

>From 80a7b54d52201dfd7d8b590457450ae0a4f72888 Mon Sep 17 00:00:00 2001
From: Andres Salomon <dilinger@collabora.co.uk>
Date: Sun, 30 Aug 2009 15:56:16 -0400
Subject: [PATCH] Add comments to ofono_modem_driver struct

Document what all the callbacks do.
2009-08-30 15:29:59 -05:00
Marcel Holtmann 70aab2a826 Convert to fully non-recursive build system 2009-08-24 23:49:40 -07:00
Rémi Denis-Courmont 484af7eec2 Fix broken dependency on include/ofono/*.h files
The fact that the directory exists does not prove that (all of) the
header file symbolic links have been created. This is particularly
annoying when a new header file gets added.
2009-08-24 13:35:54 +03:00
Denis Kenzior 038251eac5 Introduce the Modem driver API 2009-08-21 19:25:51 -05:00
Denis Kenzior e0ff90e6da Rename ofono_modem_*_userdata
Rename ofono_modem_get_userdata to ofono_modem_get_data
Rename ofono_modem_set_userdata to ofono_modem_set_data

For consistency with other drivers
2009-08-20 18:19:21 -05:00
Denis Kenzior e711b0e62a Break out device info into a separate driver
The modem info ops (Serial, Manufacturer, etc) are broken into a
separate oFono atom.  This is mainly to support a proper modem device
driver infrastructure.  As a result the data structures have been
tweaked a little.

driver.h is now empty and has been removed.
2009-08-20 12:48:29 -05:00
Denis Kenzior 04c12038ba Evolve the voicecall driver 2009-08-19 18:35:08 -05:00
Denis Kenzior 5b1f5ba084 Evolve the netreg driver 2009-08-19 18:35:07 -05:00
Denis Kenzior a5617250a1 Move mcc & mnc defines to types.h 2009-08-19 18:35:07 -05:00
Denis Kenzior 5999b418e8 Evolve message waiting low level API 2009-08-19 18:35:07 -05:00
Denis Kenzior 5e72405120 Evolve SIM driver 2009-08-19 18:35:06 -05:00
Denis Kenzior 3b043e9b1a Move ofono_destroy_fun to types.h 2009-08-19 18:35:06 -05:00
Denis Kenzior c4a349fdf9 Evolve SMS driver API 2009-08-19 18:35:06 -05:00
Denis Kenzior 229bb3a4ed Evolve the USSD API 2009-08-17 13:45:55 -05:00
Denis Kenzior 314c0facc3 Refactor cssn into ofono_ssn
Make this into a fully fledged entity, with a driver instead of the
current kludge.  This means modem drivers can actually choose whether
to instantiate a CSSN atom or not

Move the notification functions from voicecall.c into ssn.c.

Move the cssn.h header into include/ssn.h and refactor

Update call barring to utilize ofono_ssn and use the new atom_watch
functionality to detect when ssn has been added or removed
2009-08-14 18:49:01 -05:00
Denis Kenzior 99e3fe8285 Move CALL_SETTINGS_INTERFACE define to dbus.h 2009-08-14 16:33:48 -05:00
Denis Kenzior ed1720ea36 Move PHONEBOOK_INTERFACE define to dbus.h 2009-08-14 16:33:48 -05:00
Denis Kenzior b82042c5e9 Move CALL_METER_INTERFACE define to dbus.h 2009-08-14 16:33:48 -05:00
Denis Kenzior f82b9a32fd Move CALL_FORWARDING_INTERFACE define to dbus.h 2009-08-14 16:33:48 -05:00
Denis Kenzior ae4ea4cd5e Move CALL_BARRING_INTERFACE definition to dbus.h 2009-08-14 16:33:48 -05:00
Denis Kenzior ecdfbebc51 Evolve the phonebook driver 2009-08-14 11:19:10 -05:00
Denis Kenzior 04926379e5 Evolve call settings driver 2009-08-14 11:19:10 -05:00
Denis Kenzior 6342e1b2dc Move clir and cug option enums to types.h 2009-08-14 11:19:10 -05:00
Denis Kenzior 521039596a Evolve the call meter driver API 2009-08-14 11:19:09 -05:00
Denis Kenzior 872a24690d Evolve the call-forwarding driver 2009-08-14 11:19:09 -05:00
Denis Kenzior 67e19dc14c Evolve the call-barring driver
- Move call barring related functionality out of driver.h into a
  dedicated file, call-barring.h
- Update to use the new atom framework
- Remove over-reliance on the modem structure, call-barring structure
  should now be used instead whenever possible
2009-08-14 11:19:09 -05:00
Denis Kenzior 01b4c49447 Move certain parts of driver.h to types.h 2009-08-13 10:08:32 -05:00
Marcel Holtmann 08f6629d60 Add function for printing warnings 2009-08-12 17:33:44 -07:00
Denis Kenzior ea4886816f Move MODEM_INTERFACE to dbus.h 2009-07-29 16:44:17 -05:00
Denis Kenzior b50291466d Move MANAGER_PATH to dbus.h 2009-07-29 16:44:17 -05:00
Denis Kenzior 1e9580a044 Move MANAGER_INTERFACE to dbus.h 2009-07-29 16:44:16 -05:00
Denis Kenzior cb75833fc8 Rename ofono_modem_userdata 2009-07-29 16:44:16 -05:00
Denis Kenzior 4fbca244ea Make plugins use ofono_modem_get_path 2009-07-29 16:44:16 -05:00
Denis Kenzior 19eeb7f1ba Rename modem_add_interface / modem_remove_interface
Move to ofono_modem_add_interface, ofono_modem_remove_interface
and put in ofono/modem.h
2009-07-29 16:44:16 -05:00
Denis Kenzior 9cd9338ba1 Rename dbus_gsm_dict_append_array 2009-07-29 12:26:05 -05:00
Denis Kenzior 6728542a01 Rename dbus_gsm_dict_append 2009-07-29 12:26:05 -05:00
Denis Kenzior d9025e13e1 Move & Rename PROPERTIES_ARRAY_SIGNATURE 2009-07-29 12:26:05 -05:00
Denis Kenzior 55787fe876 Rename dbus_gsm_signal_array_property_changed 2009-07-29 12:26:05 -05:00
Denis Kenzior 684b5be1fc Rename dbus_gsm_signal_property_changed 2009-07-29 12:26:05 -05:00
Denis Kenzior c31350294f Refactor dbus initialization & reconnect 2009-07-29 12:26:04 -05:00
Denis Kenzior 99c1c92708 Move & Rename dbus_gsm_connection
Move to ofono/dbus.h ofono_dbus_get_connection
2009-07-29 12:26:04 -05:00
Denis Kenzior 2dc831a35c Add new ofono/dbus.h header 2009-07-29 12:26:04 -05:00
Denis Kenzior 1dbfc02d6c Add call-history driver type 2009-06-17 18:20:20 -05:00
Marcel Holtmann edfe9c7adb Fix broken OFONO_PLUGIN_DEFINE for builtin plugins 2009-05-10 22:52:24 -07:00
Marcel Holtmann f2e2cd7787 Add support for builtin plugins 2009-05-10 22:35:29 -07:00
Marcel Holtmann 488463da5a Update log and plugin functions 2009-05-05 18:56:46 -07:00
Marcel Holtmann ed08e2adee Add plugin support infrastructure 2009-04-26 21:28:48 +02:00
Marcel Holtmann e059f43fae Add skeleton for telephony daemon 2009-04-26 21:12:32 +02:00
Marcel Holtmann a20f3ce8d2 Add directories for source code, header files and plugins 2009-04-26 20:54:47 +02:00