Merge pull request #11 from d-grigorev/jb54258
Add support for android.hardware.radio@1.4
This commit is contained in:
@@ -49,6 +49,8 @@ typedef enum radio_interface {
|
||||
RADIO_INTERFACE_1_0,
|
||||
RADIO_INTERFACE_1_1,
|
||||
RADIO_INTERFACE_1_2,
|
||||
RADIO_INTERFACE_1_3,
|
||||
RADIO_INTERFACE_1_4,
|
||||
RADIO_INTERFACE_COUNT
|
||||
} RADIO_INTERFACE; /* Since 1.2.0 */
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Jolla Ltd.
|
||||
* Copyright (C) 2018-2021 Slava Monich <slava.monich@jolla.com>
|
||||
* Copyright (C) 2021 Open Mobile Platform LLC.
|
||||
*
|
||||
* You may use this file under the terms of the BSD license as follows:
|
||||
*
|
||||
@@ -416,6 +417,15 @@ typedef struct radio_card_status_1_2 {
|
||||
} RADIO_ALIGNED(8) RadioCardStatus_1_2; /* Since 1.2.3 */
|
||||
G_STATIC_ASSERT(sizeof(RadioCardStatus_1_2) == 80);
|
||||
|
||||
typedef struct radio_card_status_1_4 {
|
||||
RadioCardStatus base RADIO_ALIGNED(8);
|
||||
gint32 physicalSlotId RADIO_ALIGNED(4);
|
||||
GBinderHidlString atr RADIO_ALIGNED(8);
|
||||
GBinderHidlString iccid RADIO_ALIGNED(8);
|
||||
GBinderHidlString eid RADIO_ALIGNED(8);
|
||||
} RADIO_ALIGNED(8) RadioCardStatus_1_4; /* Since 1.4.0 */
|
||||
G_STATIC_ASSERT(sizeof(RadioCardStatus_1_4) == 96);
|
||||
|
||||
typedef struct radio_app_status {
|
||||
RADIO_APP_TYPE appType RADIO_ALIGNED(4);
|
||||
RADIO_APP_STATE appState RADIO_ALIGNED(4);
|
||||
@@ -812,6 +822,22 @@ typedef struct radio_data_reg_state_result_1_2 {
|
||||
} RADIO_ALIGNED(8) RadioDataRegStateResult_1_2; /* Since 1.2.4 */
|
||||
G_STATIC_ASSERT(sizeof(RadioDataRegStateResult_1_2) == 104);
|
||||
|
||||
typedef struct radio_data_reg_lte_vops_info {
|
||||
guint32 isVopsSupported RADIO_ALIGNED(4);
|
||||
guint32 isEmcBearerSupported RADIO_ALIGNED(4);
|
||||
} RADIO_ALIGNED(4) RadioDataRegLteVopsInfo; /* Since 1.4.0 */
|
||||
G_STATIC_ASSERT(sizeof(RadioDataRegLteVopsInfo) == 8);
|
||||
|
||||
typedef struct radio_data_reg_state_result_1_4 {
|
||||
RADIO_REG_STATE regState RADIO_ALIGNED(4);
|
||||
RADIO_TECH rat RADIO_ALIGNED(4);
|
||||
gint32 reasonDataDenied RADIO_ALIGNED(4);
|
||||
gint32 maxDataCalls RADIO_ALIGNED(4);
|
||||
RadioCellIdentity_1_2 cellIdentity RADIO_ALIGNED(8);
|
||||
RadioDataRegLteVopsInfo lteVopsInfo RADIO_ALIGNED(4);
|
||||
} RADIO_ALIGNED(8) RadioDataRegStateResult_1_4; /* Since 1.4.0 */
|
||||
G_STATIC_ASSERT(sizeof(RadioDataRegStateResult_1_4) == 112);
|
||||
|
||||
typedef struct radio_signal_strength_gsm {
|
||||
guint32 signalStrength RADIO_ALIGNED(4);
|
||||
guint32 bitErrorRate RADIO_ALIGNED(4);
|
||||
@@ -982,9 +1008,9 @@ typedef struct radio_cell_info_nr {
|
||||
G_STATIC_ASSERT(sizeof(RadioCellInfoNr) == 112);
|
||||
|
||||
typedef struct radio_cell_info_1_4 {
|
||||
guint32 registered RADIO_ALIGNED(1);
|
||||
guint32 connectionStatus RADIO_ALIGNED(4);
|
||||
guint8 cellInfoType RADIO_ALIGNED(1);
|
||||
guint8 registered RADIO_ALIGNED(1);
|
||||
RADIO_CELL_CONNECTION_STATUS connectionStatus RADIO_ALIGNED(4);
|
||||
union {
|
||||
RadioCellInfoGsm_1_2 gsm RADIO_ALIGNED(8);
|
||||
RadioCellInfoCdma_1_2 cdma RADIO_ALIGNED(8);
|
||||
@@ -994,7 +1020,7 @@ typedef struct radio_cell_info_1_4 {
|
||||
RadioCellInfoNr nr RADIO_ALIGNED(8);
|
||||
} info RADIO_ALIGNED(8);
|
||||
} RADIO_ALIGNED(8) RadioCellInfo_1_4; /* Since 1.2.5 */
|
||||
G_STATIC_ASSERT(sizeof(RadioCellInfo_1_4) == 128);
|
||||
G_STATIC_ASSERT(sizeof(RadioCellInfo_1_4) == 136);
|
||||
|
||||
typedef struct radio_gsm_broadcast_sms_config {
|
||||
gint32 fromServiceId RADIO_ALIGNED(4);
|
||||
|
||||
@@ -93,24 +93,33 @@ static GHashTable* radio_instance_table = NULL;
|
||||
#define DEFAULT_INTERFACE RADIO_INTERFACE_1_0
|
||||
|
||||
static const GBinderClientIfaceInfo radio_iface_info[] = {
|
||||
{RADIO_1_4, RADIO_1_4_REQ_LAST },
|
||||
{RADIO_1_3, RADIO_1_3_REQ_LAST },
|
||||
{RADIO_1_2, RADIO_1_2_REQ_LAST },
|
||||
{RADIO_1_1, RADIO_1_1_REQ_LAST },
|
||||
{RADIO_1_0, RADIO_1_0_REQ_LAST }
|
||||
};
|
||||
G_STATIC_ASSERT(G_N_ELEMENTS(radio_iface_info) == RADIO_INTERFACE_COUNT);
|
||||
|
||||
static const char* const radio_indication_ifaces[] = {
|
||||
RADIO_INDICATION_1_4,
|
||||
RADIO_INDICATION_1_3,
|
||||
RADIO_INDICATION_1_2,
|
||||
RADIO_INDICATION_1_1,
|
||||
RADIO_INDICATION_1_0,
|
||||
NULL
|
||||
};
|
||||
G_STATIC_ASSERT(G_N_ELEMENTS(radio_indication_ifaces) == RADIO_INTERFACE_COUNT + 1);
|
||||
|
||||
static const char* const radio_response_ifaces[] = {
|
||||
RADIO_RESPONSE_1_4,
|
||||
RADIO_RESPONSE_1_3,
|
||||
RADIO_RESPONSE_1_2,
|
||||
RADIO_RESPONSE_1_1,
|
||||
RADIO_RESPONSE_1_0,
|
||||
NULL
|
||||
};
|
||||
G_STATIC_ASSERT(G_N_ELEMENTS(radio_response_ifaces) == RADIO_INTERFACE_COUNT + 1);
|
||||
|
||||
typedef struct radio_interface_desc {
|
||||
RADIO_INTERFACE version;
|
||||
@@ -119,24 +128,21 @@ typedef struct radio_interface_desc {
|
||||
const char* const* resp_ifaces;
|
||||
} RadioInterfaceDesc;
|
||||
|
||||
#define RADIO_INTERFACE_INDEX(x) (RADIO_INTERFACE_COUNT - x - 1)
|
||||
|
||||
#define RADIO_INTERFACE_DESC(v) \
|
||||
RADIO_INTERFACE_##v, RADIO_##v, \
|
||||
radio_indication_ifaces + RADIO_INTERFACE_INDEX(RADIO_INTERFACE_##v), \
|
||||
radio_response_ifaces + RADIO_INTERFACE_INDEX(RADIO_INTERFACE_##v)
|
||||
|
||||
static const RadioInterfaceDesc radio_interfaces[] = {
|
||||
{
|
||||
RADIO_INTERFACE_1_2,
|
||||
RADIO_1_2,
|
||||
radio_indication_ifaces + 0,
|
||||
radio_response_ifaces + 0,
|
||||
},{
|
||||
RADIO_INTERFACE_1_1,
|
||||
RADIO_1_1,
|
||||
radio_indication_ifaces + 1,
|
||||
radio_response_ifaces + 1
|
||||
},{
|
||||
RADIO_INTERFACE_1_0,
|
||||
RADIO_1_0,
|
||||
radio_indication_ifaces + 2,
|
||||
radio_response_ifaces + 2
|
||||
}
|
||||
{ RADIO_INTERFACE_DESC(1_4) },
|
||||
{ RADIO_INTERFACE_DESC(1_3) },
|
||||
{ RADIO_INTERFACE_DESC(1_2) },
|
||||
{ RADIO_INTERFACE_DESC(1_1) },
|
||||
{ RADIO_INTERFACE_DESC(1_0) }
|
||||
};
|
||||
G_STATIC_ASSERT(G_N_ELEMENTS(radio_interfaces) == RADIO_INTERFACE_COUNT);
|
||||
|
||||
/*==========================================================================*
|
||||
* Implementation
|
||||
|
||||
Reference in New Issue
Block a user