Commit Graph

86 Commits

Author SHA1 Message Date
Denis Kenzior 5e72405120 Evolve SIM driver 2009-08-19 18:35:06 -05:00
Denis Kenzior 19858da361 Fix compile warning 2009-08-08 22:39:50 -05:00
Denis Kenzior b951aa9a32 Refactor SIM file cache 2009-08-07 19:51:30 -05:00
Denis Kenzior 2cfd8a9894 Make the sim op queue have a removable gsource 2009-08-07 19:51:29 -05:00
Denis Kenzior 32e4232b7c Don't use g_timeout_add to retrieve imsi 2009-08-07 19:51:29 -05:00
Denis Kenzior f93962078c Refactor setting MSISDN
- Empty lists should be supported, as clearing the MSISDN is OK
- Initialization of empty MSISDN record should also be possible
- Overwriting of unused records should be possible
- Simplify resource cleanup
2009-08-07 15:49:30 -05:00
Denis Kenzior 6f9e386424 Keep new numbers in the main sim data structure
No sense to allocate / free memory for a single pointer
2009-08-07 15:49:30 -05:00
Denis Kenzior 7eb440e864 Move error label to a more logical place 2009-08-07 15:49:30 -05:00
Denis Kenzior e5082b4b78 Move variable declarations to a move logical place 2009-08-07 15:49:30 -05:00
Andrzej Zaborowski 988f0ffbed Make SubscriberNumbers writable.
This implements writing SubscriberNumbers if the SIM allows this
(optional to the SIM provider).  Because the property is an array
of phone numbers, setting the property needs to write multiple
records on the SIM so it's not atomic and potentially can fail
partially.  In this case we have to report a write error to DBus
client but at the same time file may be changed and we send a
PropertyChanged.
2009-08-07 15:49:30 -05:00
Andrzej Zaborowski d6aae60983 Make SIM op queue more robust.
This allows ofono_sim_read and ofono_sim_write callbacks to queue new
read or write operations.  The callback must not be called between
removing the operation from queue and checking queue length.
2009-08-07 15:49:30 -05:00
Denis Kenzior 2d12b296e0 Don't hardcode info len to 6 2009-08-05 12:35:08 -05:00
Denis Kenzior 28817cc671 Don't emit SubscriberNumbers multiple times
We would emit the signal even if the record could not be parsed
2009-08-04 15:10:49 -05:00
Denis Kenzior 2ce16d2b0c Put defines near the top 2009-08-04 15:08:06 -05:00
Denis Kenzior d145a47108 Port Andrew's TFR patch 2009-08-04 15:01:52 -05:00
Denis Kenzior 090b771762 Make sim_op_info_cb caching a bit more readable 2009-08-04 15:01:49 -05:00
Denis Kenzior 320defb9c6 Make cache a gboolean 2009-08-04 15:01:46 -05:00
Denis Kenzior 6182c92ef7 Make sim_op_retrieve_cb a bit more readable 2009-08-04 15:01:42 -05:00
Andrzej Zaborowski 749a83d033 Check write() return values in sim.c for errors. 2009-08-04 15:01:39 -05:00
Andrzej Zaborowski 3cb6e1c90b Fix invalid queue use in sim_write_cb
Since we pop the queue's head, we can't use sim_op_error
2009-08-04 15:01:36 -05:00
Marcel Holtmann bbc2a56986 Fix over-complicated code flow that results in uninitialized variables 2009-08-03 11:20:46 -07:00
Andrzej Zaborowski fbec2de660 Make sure SIM read callbacks die cleanly. 2009-08-03 12:43:32 -05:00
Denis Kenzior a11bce5467 Make is_read a gboolean 2009-08-03 12:41:44 -05:00
Andrzej Zaborowski 4cdf56cabe Implement ofono_sim_write
Writes use sim->simop_q queue together with reads.
2009-08-03 12:40:39 -05:00
Andrzej Zaborowski 0809e33659 Fix possible memory leak on SIM reading error.
This would also stall the SIM op queue if there's a read error for a record
other than the first.  The other solution would be "goto next;" (keep
reading further records).
2009-07-31 09:56:44 -05:00
Andrzej Zaborowski ebf6fca07a Clean up in sim.c.
Remove unused variables and fields.
Move EFadn format parsing to a common function because various files use
this same format.
2009-07-31 09:55:46 -05:00
Andrzej Zaborowski 049e573691 Use STORAGEDIR autoconf voodoo from Bluez. 2009-07-29 17:22:12 -05:00
Denis Kenzior 3e6d4237cb Remove all uses of modem.h 2009-07-29 16:53:19 -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 54816de04d Get rid of dbus-gsm.h 2009-07-29 12:26:06 -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 1426d84ad7 Get rid of dbus_gsm_free_string_array
Use g_strfreev instead.
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 555e2e689d Refactor SIM file access code
SIM File Access conditions would be reported similarly between various
stacks, so it seems like the core logic of figuring out the access
conditions belongs up in the daemon.

This also fixes various problems, including:
  - access conditions read from bytes 10-12, instead of 9-11.
  - read/update, invalidate/rehabilitate and increase conditions
    read from the wrong bits (0-3 instead of 4-7 and vice versa)
2009-07-27 17:09:56 -05:00
Denis Kenzior 5fcbc68f3e Kill unused variable warn 2009-07-27 17:09:54 -05:00
Denis Kenzior 30c1b5e05f Kill implicit declaration warn 2009-07-27 17:09:53 -05:00
Denis Kenzior e8fbf4b699 Kill 'Suggest parantheses around truth value' warn 2009-07-27 17:09:49 -05:00
Andrzej Zaborowski aa71d09516 Cache EF-PNN, EF-OPL sim files on disk.
This uses plain files in /var/lib/ofono for storing contents of the
operator lists to avoid possibly numerous queries to the SIM on every
startup.  Files are indexed with IMSI.  I'm not 100% sure about the
autoconf magic.

Users need to rerun bootstrap-configure after applying this.

Depends on [PATCH] Return SIM file access conditions from read_file_info.
2009-07-27 17:09:48 -05:00
Andrzej Zaborowski 5c981d421e Return SIM file access conditions from read_file_info. 2009-07-27 17:09:46 -05:00
Andrzej Zaborowski da0bdb1cbf Clean-up in sim.c. 2009-07-17 23:48:29 -05:00
Denis Kenzior 70d1a6bac7 Fix uninitialized variable 2009-07-14 15:46:56 -05:00
Denis Kenzior 000a983b2b Make sure record length is not zero
Record length can be reported as 0 by the driver if it is for a
a binary (non-record based) file.  Set it to the file length in
this case
2009-07-14 15:45:06 -05:00
Denis Kenzior 864e09481c Get rid of some div by zero errors 2009-07-14 15:45:06 -05:00
Denis Kenzior 7dd147117f Use ofono_set_sim_ready 2009-07-14 15:45:06 -05:00
Denis Kenzior 0fa6897213 Refactor OPL code 2009-07-14 15:45:05 -05:00
Denis Kenzior 5ea1326b00 Move SPDI to network.c 2009-07-14 15:45:05 -05:00
Denis Kenzior 382e39ec53 Move SPN reading to network.c 2009-07-14 15:45:05 -05:00