diff options
author | Alok Barsode <alok.barsode@linux.intel.com> | 2011-08-24 16:44:13 +0300 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-08-25 11:14:21 +0200 |
commit | eca384a6167bd4b90d229c3fe9ba7d23d020e68b (patch) | |
tree | c6fffa1faf7c6369b49ab49840dfd092aa8e90b7 /src/storage.c | |
parent | 2020a2813b0a9f8dee53ea9632296db7d914a619 (diff) | |
download | connman-eca384a6167bd4b90d229c3fe9ba7d23d020e68b.tar.gz connman-eca384a6167bd4b90d229c3fe9ba7d23d020e68b.tar.bz2 connman-eca384a6167bd4b90d229c3fe9ba7d23d020e68b.zip |
technology: Save state persistently
Save the technology state persistently. This will help in resuming
the technology state after offlinemode or during startup. This patch
just saves the states.
Diffstat (limited to 'src/storage.c')
-rw-r--r-- | src/storage.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/storage.c b/src/storage.c index 81f9ecdb..274997b5 100644 --- a/src/storage.c +++ b/src/storage.c @@ -307,6 +307,42 @@ int __connman_storage_save_device(struct connman_device *device) return -ENOENT; } +int __connman_storage_load_technology(struct connman_technology *technology) +{ + GSList *list; + + DBG("technology %p", technology); + + for (list = storage_list; list; list = list->next) { + struct connman_storage *storage = list->data; + + if (storage->tech_load) { + if (storage->tech_load(technology) == 0) + return 0; + } + } + + return -ENOENT; +} + +int __connman_storage_save_technology(struct connman_technology *technology) +{ + GSList *list; + + DBG("technology %p", technology); + + for (list = storage_list; list; list = list->next) { + struct connman_storage *storage = list->data; + + if (storage->tech_save) { + if (storage->tech_save(technology) == 0) + return 0; + } + } + + return -ENOENT; +} + int __connman_storage_init(void) { DBG(""); |