Commit 67740c96 authored by Chris T's avatar Chris T

Add support for Modem Manager Suspending

This commit adds the ability for a higher level programto handle
the modem suspending for mmsd. mmsd does not track this, but a
higher level program/the OS can track this and can manually command
mmsd to process messages not sent or recieved after the modem is not
suspended anymore.
parent f1402545
......@@ -11,7 +11,7 @@ NOTE: This is an independent bus from the rest of mmsd. In order to talk to
Send mmsd the contents of an SMS WAP for it to process
See purple-mm-sms for how this is used
......@@ -19,7 +19,7 @@ Methods
Gvariant input Format String (ay)
This is the data contents of the SMS WAP
IMPORTANT NOTE: Settings changed here will work right away, but any
messages sent to the mmsd queue need to be processed
again. The easiest way to do this is to reset mmsd.
......@@ -64,24 +64,28 @@ Methods
TestServer.ChangeSettings(("http://mms.invalid", "NULL", "apn.invalid"))
#TestServer.ChangeSettings(("http://mms.invalid", "proxy.invalid:80", "apn.invalid"))
This checks if the bearer handler can correctly set the context.
This manually activates the Modem Manager Bearer to process any messages
not sent or recieved yet. The primary idea behind is two fold:
Gvariant Output Format String (h)
enum {
MMSD_MM_MODEM_MMSC_MISCONFIGURED, //the MMSC is the default value
MMSD_MM_MODEM_NO_BEARERS_ACTIVE, //The Modem has no bearers
MMSD_MM_MODEM_INTERFACE_DISCONNECTED, //mmsd found the right bearer, but it is disconnected
MMSD_MM_MODEM_INCORRECT_APN_CONNECTED, //no APN is connected that matches the settings
MMSD_MM_MODEM_CONTEXT_ACTIVE //No error, context activated properly
} mm_context_connection;
a) If the Bearer Handler is misconfigured, the OS/higher level program
can change the settings via the dbus and test the bearer handler
to confirm it works.
b) If modem data is disconnected (manually or due to modem suspend),
the OS/higher level program can also track this and can command
mmsd to now process any messages it needs to send/recieve once
modem data is active.
Since BearerHandlerError() emits a signal for any errors activating the
modem contect, ProcessMessageQueue() does not return any value.
If the bearer handler has an issue activating the context, it will emit
a signal of the error. The errors are shown above. Note that
MMSD_MM_MODEM_CONTEXT_ACTIVE will never be emitted as a signal.
a signal of the error. The errors are shown above.
NOTE: MMSD_MM_MODEM_CONTEXT_ACTIVE will never be emitted as a signal.
Gvariant Output Format String (h)
enum {
......@@ -108,9 +108,8 @@ static const gchar introspection_xml[] =
" <annotation name='org.ofono.mms.ModemManager' value='OnMethod'/>"
" <arg type='(sss)' name='greeting' direction='in'/>"
" </method>"
" <method name='SetContext'>"
" <method name='ProcessMessageQueue'>"
" <annotation name='org.ofono.mms.ModemManager' value='OnMethod'/>"
" <arg type='h' name='outcome' direction='out'/>"
" </method>"
" <signal name='BearerHandlerError'>"
" <annotation name='org.ofono.mms.ModemManager' value='Onsignal'/>"
......@@ -211,20 +210,9 @@ handle_method_call (GDBusConnection *connection,
g_dbus_method_invocation_return_value (invocation, NULL);
else if (g_strcmp0 (method_name, "SetContext") == 0) {
gint32 response;
response = set_context();
g_dbus_method_invocation_return_value (invocation,
g_variant_new ("(h)", response));
* TODO: I think this needs to be modified from "Set Context" to
* "activate bearer and process request queue". This allows
* MM mmsd to stay stateless, and it can be told then when it
* can check for new MMS messages.
else if (g_strcmp0 (method_name, "ProcessMessageQueue") == 0) {
g_dbus_method_invocation_return_value (invocation, NULL);
......@@ -917,4 +905,4 @@ static void modemmanager_exit(void)
MMS_PLUGIN_DEFINE(modemmanager, modemmanager_init, modemmanager_exit)
\ No newline at end of file
MMS_PLUGIN_DEFINE(modemmanager, modemmanager_init, modemmanager_exit)
......@@ -617,7 +617,7 @@ static void process_request_queue(struct mms_service *service);
static void emit_message_added(const struct mms_service *service,
struct mms_message *msg);
static void activate_bearer(struct mms_service *service)
void activate_bearer(struct mms_service *service)
DBG("service %p setup %d active %d", service, service->bearer_setup, service->bearer_active);
......@@ -2060,7 +2060,7 @@ static inline gboolean bearer_is_active(struct mms_service *service)
return service->bearer_active;
static void deactivate_bearer(struct mms_service *service)
void deactivate_bearer(struct mms_service *service)
DBG("service %p", service);
......@@ -52,3 +52,7 @@ int mms_message_register(struct mms_service *service,
struct mms_message *msg);
int mms_message_unregister(const struct mms_service *service,
const char *msg_path);
void deactivate_bearer(struct mms_service *service);
void activate_bearer(struct mms_service *service);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment