初始化提交
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
*.S
|
||||
*.rpm
|
||||
*.so
|
||||
*.o
|
||||
20
README.md
Normal file
20
README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
## 尝试 ofono-vendor-qti-radio-plugin
|
||||
|
||||
## 依赖项目
|
||||
1. git clone https://github.com/mer-hybris/ofono-binder-plugin -b upgrade-4.4.0
|
||||
2. git clone https://github.com/sailfishos/ofono -b upgrade-4.4.0
|
||||
3. git clone https://github.com/mer-hybris/libgbinder-radio -b upgrade-4.4.0
|
||||
|
||||
## 资料
|
||||
1. glib 继承实现
|
||||
2. G_DEFINE_TYPE用法 https://www.codenong.com/cs106693497/
|
||||
3. G_DEFINE_TYPE用法 https://blog.csdn.net/evsqiezi/article/details/83049655
|
||||
4. g_type_register_static_simple(type, "A", sizeof(A_class), A_class_init, sizeof(A), A_init, 0LL);
|
||||
|
||||
|
||||
## https://docs.sailfishos.org/Reference/Architecture/
|
||||
| Area | Call chain | Notes |
|
||||
| --- | --- | --- |
|
||||
| Modem | [oFono](https://github.com/sailfishos/ofono)([ril driver](https://github.com/sailfishos/ofono/tree/master/ofono/drivers/ril)) <> [libgrilio](https://github.com/sailfishos/libgrilio) <> [ofono-ril-binder-plugin](https://github.com/mer-hybris/ofono-ril-binder-plugin) <> [libgbinder-radio](https://github.com/mer-hybris/libgbinder-radio) <> [libgbinder](https://github.com/mer-hybris/libgbinder) <> Android BSP HAL: android.hardware.radio | Android BSP >= 8 |
|
||||
| | [oFono](https://github.com/sailfishos/ofono)([ril driver](https://github.com/sailfishos/ofono/tree/master/ofono/drivers/ril)) <> [libgrilio](https://github.com/sailfishos/libgrilio) <> socket <> Android BSP: rild | Android BSP <= 7 |
|
||||
| | [oFono](https://github.com/sailfishos/ofono)<> [ofono-binder-plugin](https://github.com/mer-hybris/ofono-binder-plugin) <> ofono-vendor-qti-radio-plugin(未开源) <> [libgbinder-radio](https://github.com/mer-hybris/libgbinder-radio) <> [libgbinder](https://github.com/mer-hybris/libgbinder) <> Android BSP HAL: android.hardware.radio | for VoLTE |
|
||||
32
func.txt
Normal file
32
func.txt
Normal file
@@ -0,0 +1,32 @@
|
||||
vendor_qti_ims_call_conference_info_start_element
|
||||
vendor_qti_ims_call_reg_state_update
|
||||
vendor_qti_ims_call_hangup
|
||||
vendor_qti_ims_call_send_dtmf
|
||||
vendor_qti_ims_call_conference
|
||||
vendor_qti_ims_call_conference_request_complete
|
||||
vendor_qti_ims_call_swap
|
||||
vendor_qti_ims_call_result_request_continue
|
||||
vendor_qti_ims_call_result_request_continue_resume
|
||||
vendor_qti_ims_call_result_request_continue_answer
|
||||
vendor_qti_ims_call_answer
|
||||
vendor_qti_ims_call_dial
|
||||
vendor_qti_ims_call_handle_conference_info
|
||||
vendor_qti_ims_call_handle_conf_user_deleted
|
||||
vendor_qti_ims_call_handle_conf_user_info_changed
|
||||
vendor_qti_ims_call_handle_state_change
|
||||
|
||||
vendor_qti_ims_conf_info_state
|
||||
vendor_qti_ims_conf_info_apply
|
||||
vendor_qti_ims_conf_info_endpoint_status
|
||||
|
||||
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_sms_send
|
||||
|
||||
vendor_qti_plugin_exit
|
||||
vendor_qti_plugin_init
|
||||
|
||||
vendor_qti_util_markup_parse
|
||||
0
include/.empty
Normal file
0
include/.empty
Normal file
0
src/vendor_qti_ims.c
Normal file
0
src/vendor_qti_ims.c
Normal file
18
src/vendor_qti_ims_call.c
Normal file
18
src/vendor_qti_ims_call.c
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
vendor_qti_ims_call_conference_info_start_element
|
||||
vendor_qti_ims_call_reg_state_update
|
||||
vendor_qti_ims_call_hangup
|
||||
vendor_qti_ims_call_send_dtmf
|
||||
vendor_qti_ims_call_conference
|
||||
vendor_qti_ims_call_conference_request_complete
|
||||
vendor_qti_ims_call_swap
|
||||
vendor_qti_ims_call_result_request_continue
|
||||
vendor_qti_ims_call_result_request_continue_resume
|
||||
vendor_qti_ims_call_result_request_continue_answer
|
||||
vendor_qti_ims_call_answer
|
||||
vendor_qti_ims_call_dial
|
||||
vendor_qti_ims_call_handle_conference_info
|
||||
vendor_qti_ims_call_handle_conf_user_deleted
|
||||
vendor_qti_ims_call_handle_conf_user_info_changed
|
||||
vendor_qti_ims_call_handle_state_change
|
||||
5
src/vendor_qti_ims_conf.c
Normal file
5
src/vendor_qti_ims_conf.c
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
vendor_qti_ims_conf_info_state
|
||||
vendor_qti_ims_conf_info_apply
|
||||
vendor_qti_ims_conf_info_endpoint_status
|
||||
16
src/vendor_qti_ims_radio.c
Normal file
16
src/vendor_qti_ims_radio.c
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
|
||||
typedef VendorQtiImsRadioClass VendorQtiExtClass;
|
||||
typedef struct qti_ims_radio {
|
||||
BinderExtPlugin parent;
|
||||
int num;
|
||||
|
||||
} VendorQtiImsRadio;
|
||||
|
||||
|
||||
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
|
||||
80
src/vendor_qti_ims_sms.c
Normal file
80
src/vendor_qti_ims_sms.c
Normal file
@@ -0,0 +1,80 @@
|
||||
|
||||
|
||||
#include "binder_ext_sms_impl.h"
|
||||
|
||||
|
||||
typedef GObjectClass VendorQtiImsSmsClass;
|
||||
typedef struct qti_ims_sms {
|
||||
GObject parent;
|
||||
int cancelled;
|
||||
VendorQtiImsRadio* ims_radio;
|
||||
VendorQtiImsStateObject* ims_state;
|
||||
} VendorQtiImsSms;
|
||||
|
||||
static void qti_ims_sms_iface_init(BinderExtSmsInterface* iface);
|
||||
G_DEFINE_TYPE_WITH_CODE(VendorQtiImsSms, qti_ims_sms, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE(BINDER_EXT_TYPE_SMS, qti_ims_sms_iface_init))
|
||||
|
||||
#define QTI_TYPE_SMS qti_ims_sms_get_type()
|
||||
#define QTI_IMS_SMS(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, QTI_TYPE_SMS, VendorQtiImsSms)
|
||||
|
||||
static
|
||||
void
|
||||
qti_ims_sms_init(
|
||||
VendorQtiImsSms* self)
|
||||
{
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
qti_ims_sms_class_init(
|
||||
VendorQtiImsSmsClass* klass)
|
||||
{
|
||||
sms_incoming_signal = g_signal_new("qti-ims-sms-incoming",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
1LL, 0LL, 0LL, 0LL, 0LL, 4LL, 2, 68LL);
|
||||
sms_status_report_signal = g_signal_new("qti-ims-sms-status-report",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
1LL, 0LL, 0LL, 0LL, 0LL, 4LL, 3, 68LL);
|
||||
}
|
||||
|
||||
|
||||
/*****************************
|
||||
* Interface
|
||||
* ***************************/
|
||||
guint vendor_qti_ims_sms_send(BinderExtSms* ext, const char* smsc, const void* pdu,
|
||||
gsize pdu_len, guint msg_ref, BINDER_EXT_SMS_SEND_FLAGS flags,
|
||||
BinderExtSmsSendFunc complete, GDestroyNotify destroy,
|
||||
void* user_data);
|
||||
void vendor_qti_ims_sms_cancel(BinderExtSms* ext, guint id);
|
||||
void vendor_qti_ims_sms_ack_report(BinderExtSms* ext, guint msg_ref, gboolean ok);
|
||||
void vendor_qti_ims_sms_ack_incoming(BinderExtSms* ext, gboolean ok);
|
||||
gulong vendor_qti_ims_sms_add_report_handler(BinderExtSms* ext,
|
||||
BinderExtSmsReportFunc handler, void* user_data);
|
||||
gulong vendor_qti_ims_sms_add_incoming_handler(BinderExtSms* ext,
|
||||
BinderExtSmsIncomingFunc handler, void* user_data);
|
||||
void vendor_qti_ims_sms_remove_handler(BinderExtSms* ext, gulong id);
|
||||
|
||||
|
||||
static void qti_ims_sms_iface_init(BinderExtSmsInterface* iface){
|
||||
iface->flags |= BINDER_EXT_SMS_INTERFACE_FLAG_IMS_SUPPORT | BINDER_EXT_SMS_INTERFACE_FLAG_IMS_REQUIRED;
|
||||
iface->version = 1;
|
||||
iface->send = vendor_qti_ims_sms_send;
|
||||
iface->cancel = vendor_qti_ims_sms_cancel;
|
||||
iface->ack_report = vendor_qti_ims_sms_ack_report;
|
||||
iface->ack_incoming = vendor_qti_ims_sms_ack_incoming;
|
||||
iface->add_report_handler = vendor_qti_ims_sms_add_report_handler;
|
||||
iface->add_incoming_handler = vendor_qti_ims_sms_add_incoming_handler;
|
||||
iface->remove_handler = vendor_qti_ims_sms_remove_handler;
|
||||
}
|
||||
|
||||
|
||||
BinderExtSms* vendor_qti_ims_sms_new(VendorQtiImsRadio* ims_radio,VendorQtiImsStateObject* ims_state){
|
||||
VendorQtiImsSms* sms= g_object_new(QTI_TYPE_SMS, NULL);
|
||||
|
||||
sms->ims_state = ims_state; // 不是直接赋值
|
||||
sms->ims_radio = ims_radio; // 不是直接赋值
|
||||
// TODO绑定信号 qti-ims-radio-incoming-sms qti-ims-radio-sms-status-report
|
||||
|
||||
return BINDER_EXT_IMS(sms);
|
||||
}
|
||||
97
src/vendor_qti_plugin.c
Normal file
97
src/vendor_qti_plugin.c
Normal file
@@ -0,0 +1,97 @@
|
||||
|
||||
#include "plugin.h"
|
||||
#include "binder_ext_ims.h"
|
||||
#include "binder_ext_plugin_impl.h"
|
||||
#include "binder_ext_slot_impl.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);
|
||||
|
||||
binder_ext_plugin_register(plugin);
|
||||
binder_ext_plugin_unref(plugin);
|
||||
return 0;
|
||||
}
|
||||
// sub_B8F8
|
||||
static void vendor_qti_plugin_exit(void){
|
||||
|
||||
}
|
||||
|
||||
OFONO_PLUGIN_DEFINE(vendor_qti, "Vendor QTI plugin", "1.28",
|
||||
OFONO_PLUGIN_PRIORITY_DEFAULT, vendor_qti_plugin_init, vendor_qti_plugin_exit)
|
||||
|
||||
/**
|
||||
* VendorQtiExt
|
||||
* VendorQtiIms
|
||||
* VendorQtiImsCall
|
||||
* VendorQtiImsConfObject
|
||||
* VendorQtiImsRadio
|
||||
* VendorQtiImsSms
|
||||
* VendorQtiImsStateObject
|
||||
* VendorQtiSlot
|
||||
*
|
||||
*
|
||||
* */
|
||||
64
src/vendor_qti_slot.c
Normal file
64
src/vendor_qti_slot.c
Normal file
@@ -0,0 +1,64 @@
|
||||
|
||||
#include "plugin.h"
|
||||
#include "binder_ext_ims.h"
|
||||
#include "binder_ext_slot_impl.h"
|
||||
|
||||
|
||||
/*==========================================================================*
|
||||
* QTI slot
|
||||
*==========================================================================*/
|
||||
|
||||
typedef BinderExtSlotClass VendorQtiSlotClass;
|
||||
typedef struct qti_slot {
|
||||
BinderExtSlot parent;
|
||||
int* shutdown;
|
||||
VendorQtiIms* ims;// 4
|
||||
VendorQtiImsSms* ims_sms;// 5
|
||||
VendorQtiImsCall* ims_call;// 6
|
||||
VendorQtiImsRadio* ims_radio;// 7
|
||||
VendorQtiImsStateObject* ims_state; // 8
|
||||
} VendorQtiSlot;
|
||||
|
||||
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)
|
||||
|
||||
static
|
||||
gpointer
|
||||
qti_slot_get_interface(
|
||||
BinderExtSlot* slot,
|
||||
GType iface)
|
||||
{
|
||||
return BINDER_EXT_SLOT_CLASS(qti_slot_parent_class)->
|
||||
get_interface(slot, iface);
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
qti_slot_shutdown(
|
||||
BinderExtSlot* slot)
|
||||
{
|
||||
VendorQtiSlot* self = QTI_SLOT(slot);
|
||||
|
||||
if (self->shutdown) {
|
||||
(*self->shutdown)++;
|
||||
}
|
||||
BINDER_EXT_SLOT_CLASS(qti_slot_parent_class)->shutdown(slot);
|
||||
}
|
||||
static
|
||||
void
|
||||
qti_slot_init(
|
||||
VendorQtiSlot* self)
|
||||
{
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
qti_slot_class_init(
|
||||
VendorQtiSlotClass* klass)
|
||||
{
|
||||
klass->get_interface = qti_slot_get_interface;
|
||||
klass->shutdown = qti_slot_shutdown;
|
||||
}
|
||||
2
src/vendor_qti_util.c
Normal file
2
src/vendor_qti_util.c
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
vendor_qti_util_markup_parse
|
||||
Reference in New Issue
Block a user