Hi Mario,
<snip>
+static void dun_gprs_set_attached(struct ofono_gprs *gprs, int
attached,
+ ofono_gprs_cb_t cb, void *data)
+{
+ DBG("");
+
+ CALLBACK_WITH_SUCCESS(cb, data);
+}
+
+static gboolean dun_gprs_finish_registration(gpointer user_data)
+{
+ struct ofono_gprs *gprs = user_data;
+
+ ofono_gprs_register(gprs);
+
+ return FALSE;
+}
+
+static int dun_gprs_probe(struct ofono_gprs *gprs,
+ unsigned int vendor, void *data)
+{
+ DBG("");
+
+ g_timeout_add(500, dun_gprs_finish_registration, gprs);
+
+ return 0;
+}
Why 500 milliseconds? Why not just g_timeout_add_seconds(0, ...) or
g_idle_add().
+static void dun_gprs_remove(struct ofono_gprs *gprs)
+{
+ DBG("");
+}
+
+static void dun_gprs_attached_status(struct ofono_gprs *gprs,
+ ofono_gprs_status_cb_t cb,
+ void *data)
+{
+ DBG("");
+
+ CALLBACK_WITH_SUCCESS(cb, 1, data);
+}
+
+static struct ofono_gprs_driver driver = {
+ .name = "dunmodem",
+ .probe = dun_gprs_probe,
+ .remove = dun_gprs_remove,
+ .set_attached = dun_gprs_set_attached,
+ .attached_status = dun_gprs_attached_status,
+};
+
+void dun_gprs_init(void)
+{
+ ofono_gprs_driver_register(&driver);
+}
+
+void dun_gprs_exit(void)
+{
+ ofono_gprs_driver_unregister(&driver);
+}
Regards
Marcel