Skip to content
Permalink
Browse files
[mms-engine] Move some functionality to libglibutil and libgofono
  • Loading branch information
monich committed Oct 27, 2015
1 parent 01f165a commit 265f911e951624436baa0fbb74d25600bafff020
Showing with 798 additions and 2,746 deletions.
  1. +3 −2 mms-engine/Makefile
  2. +1 −0 mms-engine/main.c
  3. +2 −1 mms-engine/mms-engine.pro
  4. +1 −1 mms-handler-dbus/Makefile
  5. +1 −1 mms-handler-dbus/mms-handler-dbus.pro
  6. +2 −2 mms-lib/Makefile
  7. +29 −15 mms-lib/include/mms_connection.h
  8. +3 −2 mms-lib/include/mms_lib_log.h
  9. +5 −4 mms-lib/include/mms_lib_types.h
  10. +64 −265 mms-lib/include/mms_log.h
  11. +1 −2 mms-lib/mms-lib.pro
  12. +67 −32 mms-lib/src/mms_connection.c
  13. +48 −46 mms-lib/src/mms_dispatcher.c
  14. +0 −408 mms-lib/src/mms_log.c
  15. +3 −2 mms-lib/src/mms_task.c
  16. +3 −1 mms-lib/src/mms_task.h
  17. +1 −1 mms-lib/src/mms_task_decode.c
  18. +1 −1 mms-lib/src/mms_task_encode.c
  19. +2 −2 mms-lib/src/mms_task_http.c
  20. +1 −0 mms-lib/src/mms_task_http.h
  21. +1 −1 mms-lib/src/mms_task_notification.c
  22. +3 −2 mms-lib/src/mms_task_publish.c
  23. +3 −2 mms-lib/src/mms_task_retrieve.c
  24. +1 −1 mms-lib/src/mms_task_send.c
  25. +0 −1 mms-lib/test/Makefile
  26. +1 −1 mms-lib/test/common/Makefile
  27. +3 −5 mms-lib/test/common/test_connection.c
  28. +1 −1 mms-lib/test/coverage/run
  29. +0 −6 mms-lib/test/test_mms_log/Makefile
  30. +0 −223 mms-lib/test/test_mms_log/test_mms_log.c
  31. +4 −33 mms-ofono/Makefile
  32. +2 −1 mms-ofono/include/mms_ofono_connman.h
  33. +4 −5 mms-ofono/include/mms_ofono_log.h
  34. +3 −105 mms-ofono/mms-ofono.pro
  35. +0 −17 mms-ofono/spec/org.ofono.ConnectionContext.xml
  36. +0 −37 mms-ofono/spec/org.ofono.ConnectionManager.xml
  37. +0 −18 mms-ofono/spec/org.ofono.Manager.xml
  38. +0 −42 mms-ofono/spec/org.ofono.MessageManager.xml
  39. +0 −19 mms-ofono/spec/org.ofono.Modem.xml
  40. +0 −22 mms-ofono/spec/org.ofono.NetworkRegistration.xml
  41. +0 −45 mms-ofono/spec/org.ofono.SimManager.xml
  42. +235 −165 mms-ofono/src/mms_ofono_connection.c
  43. +6 −27 mms-ofono/src/mms_ofono_connection.h
  44. +289 −76 mms-ofono/src/mms_ofono_connman.c
  45. +0 −243 mms-ofono/src/mms_ofono_context.c
  46. +0 −58 mms-ofono/src/mms_ofono_context.h
  47. +0 −206 mms-ofono/src/mms_ofono_manager.c
  48. +0 −45 mms-ofono/src/mms_ofono_manager.h
  49. +0 −410 mms-ofono/src/mms_ofono_modem.c
  50. +0 −57 mms-ofono/src/mms_ofono_modem.h
  51. +0 −48 mms-ofono/src/mms_ofono_names.h
  52. +0 −34 mms-ofono/src/mms_ofono_types.h
  53. +1 −1 mms-settings-dconf/Makefile
  54. +1 −1 mms-settings-dconf/mms-settings-dconf.pro
  55. +2 −0 rpm/mms-engine.spec
@@ -16,8 +16,9 @@ include ../mms-lib/Config.mak
# Required packages
#

PKGS = gio-unix-2.0 gio-2.0
LIB_PKGS = libwspcodec gmime-2.6 libsoup-2.4 dconf $(RESIZE_PKG) $(PKGS)
PKGS = gio-unix-2.0 gio-2.0 libglibutil
LIB_PKGS = libwspcodec gmime-2.6 libgofono libsoup-2.4 dconf
LIB_PKGS += $(RESIZE_PKG) $(PKGS)

#
# Default target
@@ -286,6 +286,7 @@ int main(int argc, char* argv[])
int result = RET_ERR;
MMSAppOptions opt = {0};
mms_lib_init(argv[0]);
gofono_log.name = "mms-ofono";
mms_log_default.name = MMS_APP_LOG_PREFIX;
mms_lib_default_config(&opt.config);
mms_settings_sim_data_default(&opt.settings);
@@ -1,6 +1,7 @@
TEMPLATE = app
CONFIG += link_pkgconfig
PKGCONFIG += gmime-2.6 gio-unix-2.0 gio-2.0 glib-2.0 libsoup-2.4 dconf libwspcodec ImageMagick
PKGCONFIG += gmime-2.6 gio-unix-2.0 gio-2.0 glib-2.0 libsoup-2.4 dconf
PKGCONFIG += libwspcodec libgofono libglibutil
DBUS_INTERFACE_DIR = $$_PRO_FILE_PWD_
MMS_LIB_DIR = $$_PRO_FILE_PWD_/../mms-lib
MMS_OFONO_DIR = $$_PRO_FILE_PWD_/../mms-ofono
@@ -3,7 +3,7 @@
.PHONY: clean all debug release

# Required packages
PKGS = glib-2.0 gio-2.0 gio-unix-2.0
PKGS = libglibutil glib-2.0 gio-2.0 gio-unix-2.0

#
# Default target
@@ -2,7 +2,7 @@ TEMPLATE = lib
CONFIG += staticlib
CONFIG -= qt
CONFIG += link_pkgconfig
PKGCONFIG += glib-2.0 gio-2.0 gio-unix-2.0
PKGCONFIG += libglibutil glib-2.0 gio-2.0 gio-unix-2.0
DBUS_SPEC_DIR = $$_PRO_FILE_PWD_/spec
INCLUDEPATH += include
INCLUDEPATH += ../mms-lib/include
@@ -12,7 +12,7 @@ include Config.mak
# Required packages
#

PKGS = gmime-2.6 glib-2.0 libsoup-2.4 libwspcodec
PKGS = libglibutil libwspcodec gmime-2.6 libsoup-2.4 glib-2.0

#
# Default target
@@ -36,7 +36,7 @@ SRC = \
mms_handler.c \
mms_lib_util.c \
mms_file_util.c \
mms_log.c mms_message.c \
mms_message.c \
mms_settings.c \
mms_task.c \
mms_task_ack.c \
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013-2014 Jolla Ltd.
* Copyright (C) 2013-2015 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -30,25 +31,21 @@ typedef enum _MMS_CONNECTION_STATE {
MMS_CONNECTION_STATE_CLOSED /* Connection has been closed */
} MMS_CONNECTION_STATE;

/* Delegate (one per connection) */
typedef struct mms_connection_delegate MMSConnectionDelegate;
struct mms_connection_delegate {
void (*fn_connection_state_changed)(
MMSConnectionDelegate* delegate,
MMSConnection* connection);
};
typedef
void
(*MMSConnectionStateChangeFunc)(
MMSConnection* connection,
void* data);

/* Connection data. The delegate field may be changed by the client at
* any time. */
/* Connection object */
struct mms_connection {
GObject parent;
char* imsi;
char* mmsc;
char* mmsproxy;
char* netif;
const char* imsi;
const char* mmsc;
const char* mmsproxy;
const char* netif;
gboolean user_connection;
MMS_CONNECTION_STATE state;
MMSConnectionDelegate* delegate;
};

/* Connection class for implementation */
@@ -59,6 +56,8 @@ typedef struct mms_connection_class {

GType mms_connection_get_type(void);
#define MMS_TYPE_CONNECTION (mms_connection_get_type())
#define MMS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
MMS_TYPE_CONNECTION, MMSConnection))

MMSConnection*
mms_connection_ref(
@@ -76,6 +75,21 @@ MMS_CONNECTION_STATE
mms_connection_state(
MMSConnection* connection);

gulong
mms_connection_add_state_change_handler(
MMSConnection* connection,
MMSConnectionStateChangeFunc fn,
void* data);

void
mms_connection_signal_state_change(
MMSConnection* connection);

void
mms_connection_remove_handler(
MMSConnection* connection,
gulong id);

void
mms_connection_close(
MMSConnection* connection);
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013-2014 Jolla Ltd.
* Copyright (C) 2013-2015 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -35,7 +36,7 @@
log(mms_connman_log)\
log(mms_connection_log)

MMS_LIB_LOG_MODULES(MMS_LOG_MODULE_DECL)
MMS_LIB_LOG_MODULES(GLOG_MODULE_DECL)

#endif /* JOLLA_MMS_LIB_LOG_H */

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013-2014 Jolla Ltd.
* Copyright (C) 2013-2015 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -31,8 +32,9 @@

#include <fcntl.h>

#include <glib.h>
#include <glib-object.h>
#include <gutil_types.h>

typedef GLogModule MMSLogModule;

#ifndef O_BINARY
# define O_BINARY (0)
@@ -56,7 +58,6 @@ typedef struct mms_settings MMSSettings;
typedef struct mms_settings_sim_data MMSSettingsSimData;
typedef struct mms_handler MMSHandler;
typedef struct mms_connman MMSConnMan;
typedef struct mms_log_module MMSLogModule;
typedef struct mms_dispatcher MMSDispatcher;
typedef struct mms_connection MMSConnection;
typedef struct mms_message MMSPdu;

0 comments on commit 265f911

Please sign in to comment.