radio_ext: Add more types and add 1.1 and 1.2 of qtiradio

This commit is contained in:
Marius Gripsgard
2024-10-13 16:03:25 +02:00
parent 3d692e3989
commit 133778edde
2 changed files with 102 additions and 24 deletions

View File

@@ -467,7 +467,18 @@ qti_radio_ext_indication(
g_signal_emit(self, qti_radio_ext_signals[SIGNAL_EXT_ON_RING], 0);
return NULL;
}
}
} else if (g_str_equal(iface, QTI_RADIO_INDICATION_1_1)) {
switch(code) {
case QTI_RADIO_IND_CALL_STATE_INDICATION_1_1:
qti_radio_ext_handle_call_state_indication(self, &args);
return NULL;
}
} else if (g_str_equal(iface, QTI_RADIO_INDICATION_1_2)) {
switch(code) {
case QTI_RADIO_IND_CALL_STATE_INDICATION_1_2:
qti_radio_ext_handle_call_state_indication(self, &args);
return NULL;
}
return NULL;
}
@@ -724,6 +735,13 @@ qti_radio_ext_result_request_submit(
}
static const GBinderClientIfaceInfo radio_iface_info[] = {
{QTI_RADIO_1_2, QTI_RADIO_REQ_LAST_1_2 },
{QTI_RADIO_1_1, QTI_RADIO_REQ_LAST_1_1 },
{QTI_RADIO_1_0, QTI_RADIO_REQ_LAST_1_0 }
};
static
QtiRadioExt*
qti_radio_ext_create(
@@ -738,24 +756,27 @@ qti_radio_ext_create(
int status;
self->slot = g_strdup(slot);
self->client = gbinder_client_new(remote, QTI_RADIO_1_0);
self->response = gbinder_servicemanager_new_local_object(sm,
QTI_RADIO_RESPONSE_1_0, qti_radio_ext_response, self);
self->indication = gbinder_servicemanager_new_local_object(sm,
QTI_RADIO_INDICATION_1_0, qti_radio_ext_indication, self);
#define REQUEST_CALLBACK(iface) \
self->client = gbinder_client_new2(remote, \
radio_iface_info, G_N_ELEMENTS(radio_iface_info)); \
self->response = gbinder_servicemanager_new_local_object(sm, \
QTI_RADIO_RESPONSE_##iface, qti_radio_ext_response, self); \
self->indication = gbinder_servicemanager_new_local_object(sm, \
QTI_RADIO_INDICATION_##iface, qti_radio_ext_indication, self); \
req = gbinder_client_new_request2(self->client, code); \
gbinder_local_request_init_writer(req, &writer); \
gbinder_writer_append_local_object(&writer, self->response); \
gbinder_writer_append_local_object(&writer, self->indication); \
qti_radio_ext_log_req(self, code, 0 /*serial*/); \
qti_radio_ext_dump_request(req); \
gbinder_remote_reply_unref(gbinder_client_transact_sync_reply(self->client, \
code, req, &status)); \
gbinder_local_request_unref(req);
req = gbinder_client_new_request2(self->client, code);
gbinder_local_request_init_writer(req, &writer);
gbinder_writer_append_local_object(&writer, self->response);
gbinder_writer_append_local_object(&writer, self->indication);
REQUEST_CALLBACK(1_2);
qti_radio_ext_log_req(self, code, 0 /*serial*/);
qti_radio_ext_dump_request(req);
gbinder_remote_reply_unref(gbinder_client_transact_sync_reply(self->client,
code, req, &status));
#undef REQUEST_CALLBACK
DBG("setResponseFunctions status %d", status);
gbinder_local_request_unref(req);
return self;
}
@@ -773,7 +794,7 @@ qti_radio_ext_new(
GBinderServiceManager* sm = gbinder_servicemanager_new(dev);
if (sm) {
char* fqname = g_strconcat(QTI_RADIO_1_0, "/", slot, NULL);
char* fqname = g_strconcat(QTI_RADIO_1_2, "/", slot, NULL);
GBinderRemoteObject* obj = /* autoreleased */
gbinder_servicemanager_get_service_sync(sm, fqname, NULL);

View File

@@ -37,6 +37,10 @@
#define QTI_RADIO_INDICATION_1_1 QTI_RADIO_IFACE_1_1(QTI_RADIO_INDICATION_IFACE)
#define QTI_RADIO_INDICATION_1_2 QTI_RADIO_IFACE_1_2(QTI_RADIO_INDICATION_IFACE)
#define QTI_RADIO_REQ_LAST_1_0 40
#define QTI_RADIO_REQ_LAST_1_1 41
#define QTI_RADIO_REQ_LAST_1_2 47
/*
enum RegState : int32_t {
REGISTERED,
@@ -182,6 +186,20 @@ typedef enum qti_radio_call_domain {
QTI_RADIO_CALL_DOMAIN_INVALID = 5,
} QTI_RADIO_CALL_DOMAIN;
/*
enum RttMode : int32_t {
RTT_MODE_DISABLED,
RTT_MODE_FULL,
RTT_MODE_INVALID,
};
*/
typedef enum qti_radio_rtt_mode {
QTI_RADIO_RTT_MODE_DISABLED = 0,
QTI_RADIO_RTT_MODE_FULL = 1,
QTI_RADIO_RTT_MODE_INVALID = 2,
} QTI_RADIO_RTT_MODE;
/*
struct RegistrationInfo {
@@ -389,34 +407,64 @@ typedef struct qti_radio_dial_request {
guint8 is_encrypted RADIO_ALIGNED(1);
} RADIO_ALIGNED(8) QtiRadioDialRequest;
/*
struct HangupRequestInfo {
uint32_t connIndex;
bool hasMultiParty;
bool multiParty;
string connUri;
uint32_t conf_id;
bool hasFailCauseResponse;
CallFailCauseResponse failCauseResponse;
};
*/
typedef struct qti_radio_hangup_request_info {
guint32 conn_index RADIO_ALIGNED(4);
guint8 has_multi_party RADIO_ALIGNED(1);
guint8 multi_party RADIO_ALIGNED(1);
GBinderHidlString conn_uri RADIO_ALIGNED(8);
guint32 conf_id RADIO_ALIGNED(4);
guint8 has_fail_cause_response RADIO_ALIGNED(1);
QtiRadioCallFailCauseResponse fail_cause_response RADIO_ALIGNED(8);
} RADIO_ALIGNED(8) QtiRadioHangupRequestInfo;
/* c(req, resp, callName, CALL_NAME) */
#define QTI_RADIO_EXT_IMS_CALL_1_0(c) \
c(2, 1, dail, DAIL) \
c(4, 11, getImsRegistrationState, GET_IMS_REG_STATE) \
c(5, 2, answer, ANSWER) \
c(6, 3, hangup, HANGUP) \
c(7, 4, requestRegistrationChange, REQ_REG_CHANGE) \
c(31, 28, setSuppServiceNotification, SET_SUPP_SVC_NOTIFICATION)
c(31, 28, setSuppServiceNotification, SET_SUPP_SVC_NOTIFICATION) \
c(40, 29, cancelModifyCall, CANCEL_MODIFY_CALL) \
#define QTI_RADIO_EXT_IMS_CALL_1_1(c) \
c(41, 3, hangup_1_1, HANGUP_1_1)
c(41, 103, hangup_1_1, HANGUP_1_1)
#define QTI_RADIO_EXT_IMS_CALL_1_2(c) \
c(42, 3, hangup_1_2, HANGUP_1_2) \
c(42, 203, hangup_1_2, HANGUP_1_2) \
c(43, 37, sendImsSms, SEND_IMS_SMS) \
c(1, 1, acknowledgeSms, ACK_SMS)
c(44, 38, acknowledgeSms, ACK_SMS) \
c(45, 39, acknowledgeSmsReport, ACK_SMS_REPORT) \
c(46, 40, getSmsFormat, GET_SMS_FORMAT) \
c(47, 41, sendGeolocationInfo_1_2, SEND_GEOLOCATION_INFO_1_2) \
typedef enum qti_radio_req {
/* vendor.mediatek.hardware.qtiradioex@1.0::IqtiRadioExt */
QTI_RADIO_REQ_SET_CALLBACK = 1, /* setCallback */
#define QTI_RADIO_REQ_(req,resp,Name,NAME) QTI_RADIO_REQ_##NAME = req,
QTI_RADIO_EXT_IMS_CALL_1_0(QTI_RADIO_REQ_)
QTI_RADIO_EXT_IMS_CALL_1_1(QTI_RADIO_REQ_)
QTI_RADIO_EXT_IMS_CALL_1_2(QTI_RADIO_REQ_)
#undef QTI_RADIO_REQ_
} QTI_RADIO_REQ;
typedef enum ims_radio_resp {
/* vendor.mediatek.hardware.qtiradioex@3.0::IImsRadioResponse */
#define QTI_RADIO_RESP_(req,resp,Name,NAME) QTI_RADIO_RESP_##NAME = resp,
QTI_RADIO_EXT_IMS_CALL_1_0(QTI_RADIO_RESP_)
QTI_RADIO_EXT_IMS_CALL_1_1(QTI_RADIO_RESP_)
QTI_RADIO_EXT_IMS_CALL_1_2(QTI_RADIO_RESP_)
#undef QTI_RADIO_RESP_
} IMS_RADIO_RESP;
@@ -427,12 +475,21 @@ typedef enum ims_radio_resp {
e(3, onRingbackTone, RINGBACK_TONE_INDICATION) \
e(4, onRegistrationChanged, REG_STATE_INDICATION) \
e(5, onHandover, HANDOVER_INDICATION) \
e(6, onServiceStatusChanged, SVC_STATUS_INDICATION)
e(6, onServiceStatusChanged, SVC_STATUS_INDICATION) \
e(7, radioStateChanged, RADIO_STATE_CHANGED_INDICATION)
#define QTI_RADIO_IND_1_1(e) \
e(23, callStateChanged_1_1, CALL_STATE_INDICATION_1_1)
#define QTI_RADIO_IND_1_2(e) \
e(24, callStateChanged_1_2, CALL_STATE_INDICATION_1_2)
typedef enum ims_radio_ind {
/* vendor.mediatek.hardware.qtiradioex@3.0::IImsRadioIndication */
#define QTI_RADIO_IND_(code, name, NAME) QTI_RADIO_IND_##NAME = code,
QTI_RADIO_IND_1_0(QTI_RADIO_IND_)
QTI_RADIO_IND_1_1(QTI_RADIO_IND_)
QTI_RADIO_IND_1_2(QTI_RADIO_IND_)
#undef QTI_RADIO_IND_
} IMS_RADIO_IND;