一点点

This commit is contained in:
2023-12-27 13:33:50 +08:00
parent 2a28d69f31
commit f43fb7ddff
20 changed files with 848 additions and 87 deletions

148
Makefile
View File

@@ -0,0 +1,148 @@
# -*- Mode: makefile-gmake -*-
.PHONY: clean all debug release
#
# Required packages
#
# ofono.pc adds -export-symbols-regex linker option which doesn't work
# on all platforms.
#
LDPKGS = libofonobinderpluginext libgbinder-radio libgbinder libglibutil gobject-2.0 glib-2.0
PKGS = ofono $(LDPKGS)
#
# Default target
#
all: debug release
#
# Library name
#
NAME = vendorqtiradioplugin
LIB_NAME = $(NAME)
LIB_SONAME = $(LIB_NAME).so
LIB = $(LIB_SONAME)
STATIC_LIB = $(NAME).a
#
# Sources
#
SRC = \
sample_ext.c \
sample_ims.c \
vendor_qti_plugin.c \
sample_slot.c
#
# Directories
#
SRC_DIR = src
INCLUDE_DIR = include
BUILD_DIR = build
DEBUG_BUILD_DIR = $(BUILD_DIR)/debug
RELEASE_BUILD_DIR = $(BUILD_DIR)/release
#
# Tools and flags
#
CC = $(CROSS_COMPILE)gcc
LD = $(CC)
WARNINGS = -Wall
INCLUDES = -I$(INCLUDE_DIR)
BASE_FLAGS = -fPIC -fvisibility=hidden
FULL_CFLAGS = $(BASE_FLAGS) $(CFLAGS) $(DEFINES) $(WARNINGS) $(INCLUDES) \
-MMD -MP $(shell pkg-config --cflags $(PKGS))
FULL_LDFLAGS = $(BASE_FLAGS) $(LDFLAGS) -shared \
$(shell pkg-config --libs $(LDPKGS))
DEBUG_FLAGS = -g
RELEASE_FLAGS =
KEEP_SYMBOLS ?= 0
ifneq ($(KEEP_SYMBOLS),0)
RELEASE_FLAGS += -g
endif
DEBUG_LDFLAGS = $(FULL_LDFLAGS) $(DEBUG_FLAGS)
RELEASE_LDFLAGS = $(FULL_LDFLAGS) $(RELEASE_FLAGS)
DEBUG_CFLAGS = $(FULL_CFLAGS) $(DEBUG_FLAGS) -DDEBUG
RELEASE_CFLAGS = $(FULL_CFLAGS) $(RELEASE_FLAGS) -O2
#
# Files
#
DEBUG_OBJS = $(SRC:%.c=$(DEBUG_BUILD_DIR)/%.o)
RELEASE_OBJS = $(SRC:%.c=$(RELEASE_BUILD_DIR)/%.o)
DEBUG_SO = $(DEBUG_BUILD_DIR)/$(LIB)
RELEASE_SO = $(RELEASE_BUILD_DIR)/$(LIB)
#
# Dependencies
#
DEPS = $(DEBUG_OBJS:%.o=%.d) $(RELEASE_OBJS:%.o=%.d)
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(DEPS)),)
-include $(DEPS)
endif
endif
$(DEBUG_OBJS) $(DEBUG_SO): | $(DEBUG_BUILD_DIR)
$(RELEASE_OBJS) $(RELEASE_SO): | $(RELEASE_BUILD_DIR)
#
# Rules
#
debug: $(DEBUG_SO)
release: $(RELEASE_SO)
clean:
rm -f $(SRC_DIR)/*~ rpm/*~ *~
rm -fr $(BUILD_DIR)
$(DEBUG_BUILD_DIR):
mkdir -p $@
$(RELEASE_BUILD_DIR):
mkdir -p $@
$(DEBUG_BUILD_DIR)/%.o : $(SRC_DIR)/%.c
$(CC) -c $(DEBUG_CFLAGS) -MT"$@" -MF"$(@:%.o=%.d)" $< -o $@
$(RELEASE_BUILD_DIR)/%.o : $(SRC_DIR)/%.c
$(CC) -c $(RELEASE_CFLAGS) -MT"$@" -MF"$(@:%.o=%.d)" $< -o $@
$(DEBUG_SO): $(DEBUG_OBJS)
$(LD) $(DEBUG_OBJS) $(DEBUG_LDFLAGS) $(DEBUG_LIBS) -o $@
$(RELEASE_SO): $(RELEASE_OBJS)
$(LD) $(RELEASE_OBJS) $(RELEASE_LDFLAGS) $(RELEASE_LIBS) -o $@
ifeq ($(KEEP_SYMBOLS),0)
$(STRIP) $@
endif
#
# Install
#
PLUGINDIR ?= $$(pkg-config ofono --variable=plugindir)
ABS_PLUGINDIR := $(shell echo /$(PLUGINDIR) | sed -r 's|/+|/|g')
INSTALL = install
INSTALL_PLUGIN_DIR = $(DESTDIR)$(ABS_PLUGINDIR)
install: $(INSTALL_PLUGIN_DIR)
$(INSTALL) -m 755 $(RELEASE_SO) $(INSTALL_PLUGIN_DIR)
$(INSTALL_PLUGIN_DIR):
$(INSTALL) -d $@

5
debian/changelog vendored Normal file
View File

@@ -0,0 +1,5 @@
ofono-vendor-qti-radio-plugin (0.0.1) xenial; urgency=medium
* Add initial packaging for Ubuntu Touch.
-- kuailexs <952415538@qq.com> Sat, 18 Nov 2023 17:24:53 +0800

1
debian/compat vendored Normal file
View File

@@ -0,0 +1 @@
9

20
debian/control vendored Normal file
View File

@@ -0,0 +1,20 @@
Source: ofono-vendor-qti-radio-plugin
Section: libs
Priority: optional
Maintainer: kuailexs <952415538@qq.com>
Build-Depends: debhelper,
libglib2.0-dev (>= 2.0),
libgbinder-radio-dev,
libgbinder-dev,
libglibutil-dev (>= 1.0.61),
libofonobinderpluginext-dev,
ofono-dev (>= 1.29),
Standards-Version: 3.8.4
Package: ofono-vendor-qti-radio-plugin
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends},
${misc:Depends}
Description: qti extension for ofono binder plugin

10
debian/copyright vendored Normal file
View File

@@ -0,0 +1,10 @@
Copyright (C) 2021-2022 Jolla Ltd.
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
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

View File

@@ -0,0 +1 @@
/usr/lib/*/ofono/plugins/vendorqtiradioplugin.so

18
debian/rules vendored Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/make -f
# -*- makefile -*-
PLUGINDIR=$(shell pkg-config ofono --variable=plugindir)
override_dh_auto_build:
make PLUGINDIR=$(PLUGINDIR) KEEP_SYMBOLS=1 release
override_dh_auto_install:
make DESTDIR=$(CURDIR)/debian/tmp PLUGINDIR=$(PLUGINDIR) install
find $(CURDIR)/debian
override_dh_install:
dh_install --remaining-packages
%:
dh $@

1
debian/source/format vendored Normal file
View File

@@ -0,0 +1 @@
3.0 (native)

10
include/vendor_qti_ext.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef VENDOR_QTI_EXT_H
#define VENDOR_QTI_EXT_H
#include <binder_ext_types.h>
extern const char qti_plugin_name[];
BinderExtPlugin* vendor_qti_ext_new(void);
#endif

8
include/vendor_qti_ims.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef VENDOR_QTI_IMS_H
#define VENDOR_QTI_IMS_H
#include <binder_ext_ims.h>
BinderExtIms* vendor_qti_ims_new(const char* slot);
#endif

View File

@@ -0,0 +1,10 @@
#ifndef VENDOR_QTI_SLOT_H
#define VENDOR_QTI_SLOT_H
#include <binder_ext_slot.h>
#include <radio_types.h>
VendorQtiImsRadio* vendor_qti_ims_radio_new(RadioInstance* radio, GHashTable* params);
#endif

10
include/vendor_qti_slot.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef VENDOR_QTI_SLOT_H
#define VENDOR_QTI_SLOT_H
#include <binder_ext_slot.h>
#include <radio_types.h>
BinderExtSlot* vendor_qti_slot_new(RadioInstance* radio, GHashTable* params);
#endif

107
src/sample_ext.c Normal file
View File

@@ -0,0 +1,107 @@
/*
* Copyright (C) 2022 Jolla Ltd.
* Copyright (C) 2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
* any official policies, either expressed or implied.
*/
#include "sample_ext.h"
#include "sample_slot.h"
#include <binder_ext_plugin_impl.h>
typedef struct sample_ext {
BinderExtPlugin parent;
} SampleExt;
typedef BinderExtPluginClass SampleExtClass;
GType sample_ext_get_type() G_GNUC_INTERNAL;
G_DEFINE_TYPE(SampleExt, sample_ext, BINDER_EXT_TYPE_PLUGIN)
#define THIS_TYPE sample_ext_get_type()
#define THIS(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, THIS_TYPE, SampleExt)
const char sample_plugin_name[] = "sample";
/*==========================================================================*
* BinderExtPluginClass
*==========================================================================*/
static
BinderExtSlot*
sample_ext_new_slot(
BinderExtPlugin* plugin,
RadioInstance* radio,
GHashTable* params)
{
return sample_slot_new(radio, params);
}
/*==========================================================================*
* API
*==========================================================================*/
BinderExtPlugin*
sample_ext_new()
{
return g_object_new(THIS_TYPE, NULL);
}
/*==========================================================================*
* Internals
*==========================================================================*/
static
void
sample_ext_init(
SampleExt* self)
{
}
static
void
sample_ext_class_init(
SampleExtClass* klass)
{
klass->plugin_name = sample_plugin_name;
klass->new_slot = sample_ext_new_slot;
}
/*
* Local Variables:
* mode: C
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

208
src/sample_ims.c Normal file
View File

@@ -0,0 +1,208 @@
/*
* Copyright (C) 2022 Jolla Ltd.
* Copyright (C) 2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
* any official policies, either expressed or implied.
*/
#include "sample_ims.h"
#include "sample_slot.h"
#include <binder_ext_ims_impl.h>
#include <ofono/log.h>
typedef GObjectClass SampleImsClass;
typedef struct sample_ims {
GObject parent;
char* slot;
} SampleIms;
static
void
sample_ims_iface_init(
BinderExtImsInterface* iface);
GType sample_ims_get_type() G_GNUC_INTERNAL;
G_DEFINE_TYPE_WITH_CODE(SampleIms, sample_ims, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE(BINDER_EXT_TYPE_IMS, sample_ims_iface_init))
#define THIS_TYPE sample_ims_get_type()
#define THIS(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, THIS_TYPE, SampleIms)
#define PARENT_CLASS sample_ims_parent_class
enum sample_ims_signal {
SIGNAL_STATE_CHANGED,
SIGNAL_COUNT
};
#define SIGNAL_STATE_CHANGED_NAME "sample-ims-state-changed"
static guint sample_ims_signals[SIGNAL_COUNT] = { 0 };
/*==========================================================================*
* BinderExtImsInterface
*==========================================================================*/
static
BINDER_EXT_IMS_STATE
sample_ims_get_state(
BinderExtIms* ext)
{
SampleIms* self = THIS(ext);
DBG("%s", self->slot);
#pragma message("TODO: return the actual state")
return BINDER_EXT_IMS_STATE_UNKNOWN;
}
static
guint
sample_ims_set_registration(
BinderExtIms* ext,
BINDER_EXT_IMS_REGISTRATION registration,
BinderExtImsResultFunc complete,
GDestroyNotify destroy,
void* user_data)
{
SampleIms* self = THIS(ext);
const gboolean on = (registration != BINDER_EXT_IMS_REGISTRATION_OFF);
DBG("%s %s", self->slot, on ? "on" : "off");
if (on) {
#pragma message("TODO: turn IMS registration on")
} else {
#pragma message("TODO: turn IMS registration off")
}
return 0;
}
static
void
sample_ims_cancel(
BinderExtIms* ext,
guint id)
{
SampleIms* self = THIS(ext);
/*
* Cancel a pending operation identified by the id returned by the
* above sample_ims_set_registration() call.
*/
DBG("%s %u", self->slot, id);
}
static
gulong
sample_ims_add_state_handler(
BinderExtIms* ext,
BinderExtImsFunc handler,
void* user_data)
{
SampleIms* self = THIS(ext);
DBG("%s", self->slot);
return G_LIKELY(handler) ? g_signal_connect(self,
SIGNAL_STATE_CHANGED_NAME, G_CALLBACK(handler), user_data) : 0;
}
static
void
sample_ims_iface_init(
BinderExtImsInterface* iface)
{
iface->version = BINDER_EXT_IMS_INTERFACE_VERSION;
iface->get_state = sample_ims_get_state;
iface->set_registration = sample_ims_set_registration;
iface->cancel = sample_ims_cancel;
iface->add_state_handler = sample_ims_add_state_handler;
}
/*==========================================================================*
* API
*==========================================================================*/
BinderExtIms*
sample_ims_new(
const char* slot)
{
SampleIms* self = g_object_new(THIS_TYPE, NULL);
/*
* This could be the place to register a listener that gets invoked
* on registration state change and emits SIGNAL_STATE_CHANGED.
*/
self->slot = g_strdup(slot);
return BINDER_EXT_IMS(self);
}
/*==========================================================================*
* Internals
*==========================================================================*/
static
void
sample_ims_finalize(
GObject* object)
{
SampleIms* self = THIS(object);
g_free(self->slot);
G_OBJECT_CLASS(PARENT_CLASS)->finalize(object);
}
static
void
sample_ims_init(
SampleIms* self)
{
}
static
void
sample_ims_class_init(
SampleImsClass* klass)
{
G_OBJECT_CLASS(klass)->finalize = sample_ims_finalize;
sample_ims_signals[SIGNAL_STATE_CHANGED] =
g_signal_new(SIGNAL_STATE_CHANGED_NAME, G_OBJECT_CLASS_TYPE(klass),
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0);
}
/*
* Local Variables:
* mode: C
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

149
src/sample_slot.c Normal file
View File

@@ -0,0 +1,149 @@
/*
* Copyright (C) 2022 Jolla Ltd.
* Copyright (C) 2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
* any official policies, either expressed or implied.
*/
#include "sample_slot.h"
#include "sample_ims.h"
#include <binder_ext_slot_impl.h>
#include <radio_instance.h>
typedef BinderExtSlotClass SampleSlotClass;
typedef struct sample_slot {
BinderExtSlot parent;
BinderExtIms* ims;
} SampleSlot;
GType sample_slot_get_type() G_GNUC_INTERNAL;
G_DEFINE_TYPE(SampleSlot, sample_slot, BINDER_EXT_TYPE_SLOT)
#define THIS_TYPE sample_slot_get_type()
#define THIS(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, THIS_TYPE, SampleSlot)
#define PARENT_CLASS sample_slot_parent_class
static
void
sample_slot_terminate(
SampleSlot* self)
{
if (self->ims) {
binder_ext_ims_unref(self->ims);
self->ims = NULL;
}
}
/*==========================================================================*
* BinderExtSlot
*==========================================================================*/
static
gpointer
sample_slot_get_interface(
BinderExtSlot* slot,
GType iface)
{
SampleSlot* self = THIS(slot);
if (iface == BINDER_EXT_TYPE_IMS) {
return self->ims;
} else {
return BINDER_EXT_SLOT_CLASS(PARENT_CLASS)->get_interface(slot, iface);
}
}
static
void
sample_slot_shutdown(
BinderExtSlot* slot)
{
sample_slot_terminate(THIS(slot));
BINDER_EXT_SLOT_CLASS(PARENT_CLASS)->shutdown(slot);
}
/*==========================================================================*
* API
*==========================================================================*/
BinderExtSlot*
sample_slot_new(
RadioInstance* radio,
GHashTable* params)
{
SampleSlot* self = g_object_new(THIS_TYPE, NULL);
BinderExtSlot* slot = &self->parent;
self->ims = sample_ims_new(radio->slot);
return slot;
}
/*==========================================================================*
* Internals
*==========================================================================*/
static
void
sample_slot_finalize(
GObject* object)
{
sample_slot_terminate(THIS(object));
G_OBJECT_CLASS(PARENT_CLASS)->finalize(object);
}
static
void
sample_slot_init(
SampleSlot* self)
{
}
static
void
sample_slot_class_init(
SampleSlotClass* klass)
{
klass->get_interface = sample_slot_get_interface;
klass->shutdown = sample_slot_shutdown;
G_OBJECT_CLASS(klass)->finalize = sample_slot_finalize;
}
/*
* Local Variables:
* mode: C
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/

80
src/vendor_qti_ext.c Normal file
View File

@@ -0,0 +1,80 @@
#include "vendor_qti_ext.h"
#include "vendor_qti_slot.h"
#include "binder_ext_plugin_impl.h"
#include "binder_ext_ims.h"
#include "binder_ext_slot_impl.h"
/*==========================================================================*
* QTI ext
*==========================================================================*/
typedef BinderExtPluginClass VendorQtiExtClass;
typedef struct qti_plugin {
BinderExtPlugin parent;
void* b_40;
int num;
} VendorQtiExt;
GType qti_plugin_get_type();
G_DEFINE_TYPE(VendorQtiExt, qti_plugin, BINDER_EXT_TYPE_PLUGIN)
#define THIS_TYPE qti_plugin_get_type()
#define THIS(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, THIS_TYPE, VendorQtiExt)
static const char qti_plugin_name[] = "qti";
/*==========================================================================*
* BinderExtPluginClass
*==========================================================================*/
static
BinderExtSlot*
qti_plugin_new_slot(
BinderExtPlugin* plugin,
RadioInstance* radio,
GHashTable* params)
{
return vendor_qti_slot_new(radio, params);
}
/*==========================================================================*
* API
*==========================================================================*/
BinderExtPlugin* vendor_qti_ext_new()
{
return g_object_new(THIS_TYPE, NULL);
}
/*==========================================================================*
* Internals
*==========================================================================*/
static
void
qti_plugin_init(
VendorQtiExt* self)
{
}
static
void
qti_plugin_class_init(
VendorQtiExtClass* klass)
{
klass->plugin_name = qti_plugin_name;
klass->new_slot = qti_plugin_new_slot;
}
/**
* VendorQtiExt
* VendorQtiIms
* VendorQtiImsCall
* VendorQtiImsConfObject
* VendorQtiImsRadio
* VendorQtiImsSms
* VendorQtiImsStateObject
* VendorQtiSlot
*
*
* */

View File

@@ -1,5 +1,5 @@
#include "vendor_qti_ims_radio.h"
typedef VendorQtiImsRadioClass VendorQtiExtClass;
typedef struct qti_ims_radio {
@@ -13,10 +13,17 @@ vendor_qti_ims_radio_registration_info
vendor_qti_ims_radio_get_reg_state_response
vendor_qti_ims_radio_send_ims_sms_response
vendor_qti_ims_radio_sip_result_response
vendor_qti_ims_radio_new
vendor_qti_ims_radio_response
vendor_qti_ims_radio_indication
vendor_qti_ims_radio_handle_supp_service_notification
vendor_qti_ims_radio_handle_call_state_changed
vendor_qti_ims_radio_handle_sms_status_report
vendor_qti_ims_radio_handle_incoming_ims_sms
vendor_qti_ims_radio_handle_incoming_ims_sms
/*==========================================================================*
* API
*==========================================================================*/
vendor_qti_ims_radio_new(){
}

View File

@@ -1,75 +1,17 @@
#include "vendor_qti_ext.h"
#include "plugin.h"
#include "binder_ext_ims.h"
#include "binder_ext_plugin_impl.h"
#include "binder_ext_slot_impl.h"
#include <ofono/log.h>
#include <ofono/plugin.h>
#include <binder_ext_plugin.h>
/*==========================================================================*
* QTI plugin
*==========================================================================*/
typedef BinderExtPluginClass VendorQtiExtClass;
typedef struct qti_plugin {
BinderExtPlugin parent;
void* b_40;
int num;
} VendorQtiExt;
G_DEFINE_TYPE(VendorQtiExt, qti_plugin, BINDER_EXT_TYPE_PLUGIN)
#define QTI_TYPE_PLUGIN qti_plugin_get_type()
#define QTI_PLUGIN(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, \
QTI_TYPE_PLUGIN, VendorQtiExt)
static const char qti_plugin_name[] = "qti";
static
BinderExtSlot*
qti_plugin_new_slot(
BinderExtPlugin* plugin,
RadioInstance* radio,
GHashTable* params)
{
VendorQtiSlot* slot = g_object_new(QTI_TYPE_SLOT, NULL);
VendorQtiExt* self = QTI_PLUGIN(plugin);
char* ims_radio_num = g_strdup_printf("imsradio%d", self->num);
//
VendorQtiImsRadio* ims_radio = vendor_qti_ims_radio_new(self->b_40,ims_radio_num,2);
slot->ims_radio = ims_radio;
if(ims_radio != NULL){
VendorQtiImsStateObject* ims_state = vendor_qti_ims_state_new(ims_radio);
slot->ims_state = ims_state;
slot->ims = vendor_qti_ims_new(ims_radio,ims_state);
slot->ims_call = vendor_qti_ims_call_new(slot->ims_radio,slot->ims_state);
slot->ims_sms = vendor_qti_ims_sms_new(slot->ims_radio,slot->ims_state);
}
g_free(ims_radio_num);
return slot;
}
static
void
qti_plugin_init(
VendorQtiExt* self)
{
}
static
void
qti_plugin_class_init(
VendorQtiExtClass* klass)
{
klass->plugin_name = qti_plugin_name;
klass->new_slot = qti_plugin_new_slot;
}
// sub_B940
static int vendor_qti_plugin_init(void){
BinderExtPlugin* plugin = g_object_new(QTI_TYPE_PLUGIN, NULL);
BinderExtPlugin* plugin = vendor_qti_ext_new();
binder_ext_plugin_register(plugin);
binder_ext_plugin_unref(plugin);
@@ -77,21 +19,9 @@ static int vendor_qti_plugin_init(void){
}
// sub_B8F8
static void vendor_qti_plugin_exit(void){
binder_ext_plugin_unregister(qti_plugin_name);
}
OFONO_PLUGIN_DEFINE(vendor_qti, "Vendor QTI plugin", "1.28",
OFONO_PLUGIN_DEFINE(vendor_qti, "Vendor QTI plugin", OFONO_VERSION,
OFONO_PLUGIN_PRIORITY_DEFAULT, vendor_qti_plugin_init, vendor_qti_plugin_exit)
/**
* VendorQtiExt
* VendorQtiIms
* VendorQtiImsCall
* VendorQtiImsConfObject
* VendorQtiImsRadio
* VendorQtiImsSms
* VendorQtiImsStateObject
* VendorQtiSlot
*
*
* */

View File

@@ -1,5 +1,5 @@
#include "plugin.h"
#include "vendor_qti_slot.h"
#include "binder_ext_ims.h"
#include "binder_ext_slot_impl.h"
@@ -21,17 +21,23 @@ typedef struct qti_slot {
G_DEFINE_TYPE(VendorQtiSlot, qti_slot, BINDER_EXT_TYPE_SLOT)
#define QTI_TYPE_SLOT qti_slot_get_type()
#define QTI_SLOT(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, QTI_TYPE_SLOT, VendorQtiSlot)
#define QTI_IS_SLOT(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, QTI_TYPE_SLOT)
#define THIS_TYPE qti_slot_get_type()
#define THIS(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, THIS_TYPE, VendorQtiSlot)
#define IS_THIS(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, THIS_TYPE)
#define PARENT_CLASS qti_slot_parent_class
/*==========================================================================*
* BinderExtSlotClass
*==========================================================================*/
static
gpointer
qti_slot_get_interface(
BinderExtSlot* slot,
GType iface)
{
return BINDER_EXT_SLOT_CLASS(qti_slot_parent_class)->
return BINDER_EXT_SLOT_CLASS(PARENT_CLASS)->
get_interface(slot, iface);
}
@@ -45,8 +51,35 @@ qti_slot_shutdown(
if (self->shutdown) {
(*self->shutdown)++;
}
BINDER_EXT_SLOT_CLASS(qti_slot_parent_class)->shutdown(slot);
BINDER_EXT_SLOT_CLASS(PARENT_CLASS)->shutdown(slot);
}
/*==========================================================================*
* API
*==========================================================================*/
BinderExtSlot* vendor_qti_slot_new(RadioInstance* radio, GHashTable* params)
{
VendorQtiSlot* slot = g_object_new(QTI_TYPE_SLOT, NULL);
char* ims_radio_num = g_strdup_printf("imsradio%d", radio->slot_index);
//
VendorQtiImsRadio* ims_radio = vendor_qti_ims_radio_new(radio->enabled,ims_radio_num,2);
slot->ims_radio = ims_radio;
if(ims_radio != NULL){
VendorQtiImsStateObject* ims_state = vendor_qti_ims_state_new(ims_radio);
slot->ims_state = ims_state;
slot->ims = vendor_qti_ims_new(ims_radio,ims_state);
slot->ims_call = vendor_qti_ims_call_new(slot->ims_radio,slot->ims_state);
slot->ims_sms = vendor_qti_ims_sms_new(slot->ims_radio,slot->ims_state);
}
g_free(ims_radio_num);
return slot;
}
/*==========================================================================*
* Internals
*==========================================================================*/
static
void
qti_slot_init(
@@ -61,4 +94,7 @@ qti_slot_class_init(
{
klass->get_interface = qti_slot_get_interface;
klass->shutdown = qti_slot_shutdown;
}
}

2
vendor-qti.conf Normal file
View File

@@ -0,0 +1,2 @@
[Settings]
extPlugin = qti