mirror of git://git.sysmocom.de/ofono
examples: Update gprs-provision to the new API
This commit is contained in:
parent
712d978021
commit
5e5eed9f83
|
@ -26,6 +26,8 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#define OFONO_API_SUBJECT_TO_CHANGE
|
#define OFONO_API_SUBJECT_TO_CHANGE
|
||||||
|
|
||||||
#include <ofono/modem.h>
|
#include <ofono/modem.h>
|
||||||
|
@ -34,7 +36,7 @@
|
||||||
#include <ofono/plugin.h>
|
#include <ofono/plugin.h>
|
||||||
#include <ofono/log.h>
|
#include <ofono/log.h>
|
||||||
|
|
||||||
static void example_provision_get_settings(const char *mcc, const char *mnc,
|
static int example_provision_get_settings(const char *mcc, const char *mnc,
|
||||||
struct ofono_gprs_provision_data **settings,
|
struct ofono_gprs_provision_data **settings,
|
||||||
int *count)
|
int *count)
|
||||||
{
|
{
|
||||||
|
@ -46,13 +48,13 @@ static void example_provision_get_settings(const char *mcc, const char *mnc,
|
||||||
mcc, mnc);
|
mcc, mnc);
|
||||||
|
|
||||||
if (strcmp(mcc, "246") != 0 || strcmp(mnc, "81") != 0)
|
if (strcmp(mcc, "246") != 0 || strcmp(mnc, "81") != 0)
|
||||||
return;
|
return -ENOENT;
|
||||||
|
|
||||||
ofono_debug("Creating example settings for phonesim");
|
ofono_debug("Creating example settings for phonesim");
|
||||||
|
|
||||||
*settings = g_try_new0(struct ofono_gprs_provision_data, 2);
|
*settings = g_try_new0(struct ofono_gprs_provision_data, 2);
|
||||||
if (*settings == NULL)
|
if (*settings == NULL)
|
||||||
return;
|
return -ENOMEM;
|
||||||
|
|
||||||
*count = 2;
|
*count = 2;
|
||||||
|
|
||||||
|
@ -71,6 +73,8 @@ static void example_provision_get_settings(const char *mcc, const char *mnc,
|
||||||
(*settings)[1].password = g_strdup("mmspass");
|
(*settings)[1].password = g_strdup("mmspass");
|
||||||
(*settings)[1].message_proxy = g_strdup("10.11.12.13:8080");
|
(*settings)[1].message_proxy = g_strdup("10.11.12.13:8080");
|
||||||
(*settings)[1].message_center = g_strdup("http://mms.example.com:8000");
|
(*settings)[1].message_center = g_strdup("http://mms.example.com:8000");
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ofono_gprs_provision_driver example_driver = {
|
static struct ofono_gprs_provision_driver example_driver = {
|
||||||
|
|
Loading…
Reference in New Issue