Merge pull request #40 from sailfishos/jb58763
[ofono] Add support for NR networks. JB#58763
This commit is contained in:
		@@ -23,14 +23,17 @@ extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <ofono/types.h>
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
 | 
			
		||||
enum ofono_cell_type {
 | 
			
		||||
	OFONO_CELL_TYPE_GSM,
 | 
			
		||||
	OFONO_CELL_TYPE_WCDMA,
 | 
			
		||||
	OFONO_CELL_TYPE_LTE
 | 
			
		||||
	OFONO_CELL_TYPE_LTE,
 | 
			
		||||
	OFONO_CELL_TYPE_NR /* Since 1.29+git8 */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define OFONO_CELL_INVALID_VALUE (INT_MAX)
 | 
			
		||||
#define OFONO_CELL_INVALID_VALUE_INT64 (INT64_MAX)
 | 
			
		||||
 | 
			
		||||
struct ofono_cell_info_gsm {
 | 
			
		||||
	int mcc;            /* Mobile Country Code (0..999) */
 | 
			
		||||
@@ -70,6 +73,22 @@ struct ofono_cell_info_lte {
 | 
			
		||||
	int timingAdvance;  /* (Distance = 300m/us) TS 36.321 */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Since 1.29+git8 */
 | 
			
		||||
struct ofono_cell_info_nr {
 | 
			
		||||
	int mcc;            /* Mobile Country Code (0..999) */
 | 
			
		||||
	int mnc;            /* Mobile Network Code (0..999) */
 | 
			
		||||
	int64_t nci;        /* NR Cell Identity */
 | 
			
		||||
	int pci;            /* Physical cell id (0..1007) */
 | 
			
		||||
	int tac;            /* Tracking area code */
 | 
			
		||||
	int nrarfcn;        /* 22-bit NR Absolute RC Channel Number */
 | 
			
		||||
	int ssRsrp;         /* SS Reference Signal Receive Power TS 38.215 */
 | 
			
		||||
	int ssRsrq;         /* SS Reference Signal Receive Quality TS 38.215 and 38.133 */
 | 
			
		||||
	int ssSinr;         /* SS Reference Signal-to-Noise Ratio TS 38.215 and 38.133*/
 | 
			
		||||
	int csiRsrp;        /* CSI Reference Signal Receive Power TS 38.215 */
 | 
			
		||||
	int csiRsrq;        /* CSI Reference Signal Receive Quality TS 38.215 */
 | 
			
		||||
	int csiSinr;        /* CSI Reference Signal-to-Noise Ratio TS 38.215 and 38.133 */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef struct ofono_cell {
 | 
			
		||||
	enum ofono_cell_type type;
 | 
			
		||||
	ofono_bool_t registered;
 | 
			
		||||
@@ -77,6 +96,7 @@ typedef struct ofono_cell {
 | 
			
		||||
		struct ofono_cell_info_gsm gsm;
 | 
			
		||||
		struct ofono_cell_info_wcdma wcdma;
 | 
			
		||||
		struct ofono_cell_info_lte lte;
 | 
			
		||||
		struct ofono_cell_info_nr nr; /* Since 1.29+git8 */
 | 
			
		||||
	} info;
 | 
			
		||||
} *ofono_cell_ptr;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -34,6 +34,7 @@ enum ofono_radio_access_mode {
 | 
			
		||||
	OFONO_RADIO_ACCESS_MODE_GSM	= 0x1,
 | 
			
		||||
	OFONO_RADIO_ACCESS_MODE_UMTS	= 0x2,
 | 
			
		||||
	OFONO_RADIO_ACCESS_MODE_LTE	= 0x4,
 | 
			
		||||
	OFONO_RADIO_ACCESS_MODE_NR	= 0x8, /* Since 1.29+git8 */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum ofono_radio_band_gsm {
 | 
			
		||||
 
 | 
			
		||||
@@ -57,7 +57,11 @@ enum ofono_access_technology {
 | 
			
		||||
	OFONO_ACCESS_TECHNOLOGY_UTRAN_HSDPA_HSUPA = 6,
 | 
			
		||||
	OFONO_ACCESS_TECHNOLOGY_EUTRAN = 7,
 | 
			
		||||
	OFONO_ACCESS_TECHNOLOGY_NB_IOT_M1 = 8,
 | 
			
		||||
	OFONO_ACCESS_TECHNOLOGY_NB_IOT_NB1 = 9
 | 
			
		||||
	OFONO_ACCESS_TECHNOLOGY_NB_IOT_NB1 = 9,
 | 
			
		||||
	OFONO_ACCESS_TECHNOLOGY_EUTRA_5GCN = 10, /* Since 1.29+git8 */
 | 
			
		||||
	OFONO_ACCESS_TECHNOLOGY_NR_5GCN = 11, /* Since 1.29+git8 */
 | 
			
		||||
	OFONO_ACCESS_TECHNOLOGY_NG_RAN = 12, /* Since 1.29+git8 */
 | 
			
		||||
	OFONO_ACCESS_TECHNOLOGY_EUTRA_NR = 13, /* Since 1.29+git8 */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* 27.007 Section 6.2 */
 | 
			
		||||
 
 | 
			
		||||
@@ -57,14 +57,19 @@ struct cell_property {
 | 
			
		||||
	const char *name;
 | 
			
		||||
	glong off;
 | 
			
		||||
	int flag;
 | 
			
		||||
	int type;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define CELL_GSM_PROPERTY(value,name) \
 | 
			
		||||
	{ #name, G_STRUCT_OFFSET(struct ofono_cell_info_gsm,name), value }
 | 
			
		||||
	{ #name, G_STRUCT_OFFSET(struct ofono_cell_info_gsm,name), value, DBUS_TYPE_INT32 }
 | 
			
		||||
#define CELL_WCDMA_PROPERTY(value,name) \
 | 
			
		||||
	{ #name, G_STRUCT_OFFSET(struct ofono_cell_info_wcdma,name), value }
 | 
			
		||||
	{ #name, G_STRUCT_OFFSET(struct ofono_cell_info_wcdma,name), value, DBUS_TYPE_INT32 }
 | 
			
		||||
#define CELL_LTE_PROPERTY(value,name) \
 | 
			
		||||
	{ #name, G_STRUCT_OFFSET(struct ofono_cell_info_lte,name), value }
 | 
			
		||||
	{ #name, G_STRUCT_OFFSET(struct ofono_cell_info_lte,name), value, DBUS_TYPE_INT32 }
 | 
			
		||||
#define CELL_NR_PROPERTY(value,name) \
 | 
			
		||||
	{ #name, G_STRUCT_OFFSET(struct ofono_cell_info_nr,name), value, DBUS_TYPE_INT32 }
 | 
			
		||||
#define CELL_NR_PROPERTY64(value,name) \
 | 
			
		||||
	{ #name, G_STRUCT_OFFSET(struct ofono_cell_info_nr,name), value, DBUS_TYPE_INT64 }
 | 
			
		||||
 | 
			
		||||
static const struct cell_property cell_gsm_properties [] = {
 | 
			
		||||
	CELL_GSM_PROPERTY(0x001,mcc),
 | 
			
		||||
@@ -104,6 +109,21 @@ static const struct cell_property cell_lte_properties [] = {
 | 
			
		||||
	CELL_LTE_PROPERTY(0x800,timingAdvance)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const struct cell_property cell_nr_properties [] = {
 | 
			
		||||
	CELL_NR_PROPERTY(0x001,mcc),
 | 
			
		||||
	CELL_NR_PROPERTY(0x002,mnc),
 | 
			
		||||
	CELL_NR_PROPERTY64(0x004,nci),
 | 
			
		||||
	CELL_NR_PROPERTY(0x008,pci),
 | 
			
		||||
	CELL_NR_PROPERTY(0x010,tac),
 | 
			
		||||
	CELL_NR_PROPERTY(0x020,nrarfcn),
 | 
			
		||||
	CELL_NR_PROPERTY(0x040,ssRsrp),
 | 
			
		||||
	CELL_NR_PROPERTY(0x080,ssRsrq),
 | 
			
		||||
	CELL_NR_PROPERTY(0x100,ssSinr),
 | 
			
		||||
	CELL_NR_PROPERTY(0x200,csiRsrp),
 | 
			
		||||
	CELL_NR_PROPERTY(0x400,csiRsrq),
 | 
			
		||||
	CELL_NR_PROPERTY(0x800,csiSinr),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define CELL_PROPERTY_REGISTERED 0x1000
 | 
			
		||||
 | 
			
		||||
typedef void (*cell_info_dbus_append_fn)(DBusMessageIter *it,
 | 
			
		||||
@@ -124,6 +144,8 @@ static const char *cell_info_dbus_cell_type_str(enum ofono_cell_type type)
 | 
			
		||||
		return "wcdma";
 | 
			
		||||
	case OFONO_CELL_TYPE_LTE:
 | 
			
		||||
		return "lte";
 | 
			
		||||
	case OFONO_CELL_TYPE_NR:
 | 
			
		||||
		return "nr";
 | 
			
		||||
	default:
 | 
			
		||||
		return "unknown";
 | 
			
		||||
	}
 | 
			
		||||
@@ -142,6 +164,9 @@ static const struct cell_property *cell_info_dbus_cell_properties
 | 
			
		||||
	case OFONO_CELL_TYPE_LTE:
 | 
			
		||||
		*count = G_N_ELEMENTS(cell_lte_properties);
 | 
			
		||||
		return cell_lte_properties;
 | 
			
		||||
	case OFONO_CELL_TYPE_NR:
 | 
			
		||||
		*count = G_N_ELEMENTS(cell_nr_properties);
 | 
			
		||||
		return cell_nr_properties;
 | 
			
		||||
	default:
 | 
			
		||||
		*count = 0;
 | 
			
		||||
		return NULL;
 | 
			
		||||
@@ -202,10 +227,18 @@ static void cell_info_dbus_append_properties(DBusMessageIter *it,
 | 
			
		||||
 | 
			
		||||
	dbus_message_iter_open_container(it, DBUS_TYPE_ARRAY, "{sv}", &dict);
 | 
			
		||||
	for (i = 0; i < n; i++) {
 | 
			
		||||
		gint32 value = G_STRUCT_MEMBER(int, &cell->info, prop[i].off);
 | 
			
		||||
		if (value != OFONO_CELL_INVALID_VALUE) {
 | 
			
		||||
			ofono_dbus_dict_append(&dict, prop[i].name,
 | 
			
		||||
				DBUS_TYPE_INT32, &value);
 | 
			
		||||
		if (prop[i].type == DBUS_TYPE_INT64) {
 | 
			
		||||
			gint64 value = G_STRUCT_MEMBER(gint64, &cell->info, prop[i].off);
 | 
			
		||||
			if (value != OFONO_CELL_INVALID_VALUE_INT64) {
 | 
			
		||||
				ofono_dbus_dict_append(&dict, prop[i].name,
 | 
			
		||||
					DBUS_TYPE_INT64, &value);
 | 
			
		||||
			}
 | 
			
		||||
		} else {
 | 
			
		||||
			gint32 value = G_STRUCT_MEMBER(int, &cell->info, prop[i].off);
 | 
			
		||||
			if (value != OFONO_CELL_INVALID_VALUE) {
 | 
			
		||||
				ofono_dbus_dict_append(&dict, prop[i].name,
 | 
			
		||||
					DBUS_TYPE_INT32, &value);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	dbus_message_iter_close_container(it, &dict);
 | 
			
		||||
@@ -375,11 +408,20 @@ static int cell_info_dbus_compare(const struct ofono_cell *c1,
 | 
			
		||||
 | 
			
		||||
		for (i = 0; i < n; i++) {
 | 
			
		||||
			const glong offset = prop[i].off;
 | 
			
		||||
			gint32 v1 = G_STRUCT_MEMBER(int, &c1->info, offset);
 | 
			
		||||
			gint32 v2 = G_STRUCT_MEMBER(int, &c2->info, offset);
 | 
			
		||||
			if (prop[i].type == DBUS_TYPE_INT64) {
 | 
			
		||||
				gint64 v1 = G_STRUCT_MEMBER(gint64, &c1->info, offset);
 | 
			
		||||
				gint64 v2 = G_STRUCT_MEMBER(gint64, &c2->info, offset);
 | 
			
		||||
 | 
			
		||||
			if (v1 != v2) {
 | 
			
		||||
				mask |= prop[i].flag;
 | 
			
		||||
				if (v1 != v2) {
 | 
			
		||||
					mask |= prop[i].flag;
 | 
			
		||||
				}
 | 
			
		||||
			} else  {
 | 
			
		||||
				gint32 v1 = G_STRUCT_MEMBER(int, &c1->info, offset);
 | 
			
		||||
				gint32 v2 = G_STRUCT_MEMBER(int, &c2->info, offset);
 | 
			
		||||
 | 
			
		||||
				if (v1 != v2) {
 | 
			
		||||
					mask |= prop[i].flag;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -427,7 +469,7 @@ static void cell_info_dbus_property_changed(CellInfoDBus *dbus,
 | 
			
		||||
			ofono_dbus_clients_signal_property_changed(
 | 
			
		||||
				dbus->clients, entry->path,
 | 
			
		||||
				CELL_DBUS_INTERFACE, prop[i].name,
 | 
			
		||||
				DBUS_TYPE_INT32,
 | 
			
		||||
				prop[i].type,
 | 
			
		||||
				G_STRUCT_MEMBER_P(&cell->info, prop[i].off));
 | 
			
		||||
			mask &= ~prop[i].flag;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -70,6 +70,23 @@ int ofono_cell_compare_location(const struct ofono_cell *c1,
 | 
			
		||||
			} else {
 | 
			
		||||
				return l1->tac - l2->tac;
 | 
			
		||||
			}
 | 
			
		||||
		} else if (c1->type == OFONO_CELL_TYPE_NR) {
 | 
			
		||||
			const struct ofono_cell_info_nr *n1 =
 | 
			
		||||
				&c1->info.nr;
 | 
			
		||||
			const struct ofono_cell_info_nr *n2 =
 | 
			
		||||
				&c2->info.nr;
 | 
			
		||||
 | 
			
		||||
			if (n1->mcc != n2->mcc) {
 | 
			
		||||
				return n1->mcc - n2->mcc;
 | 
			
		||||
			} else if (n1->mnc != n2->mnc) {
 | 
			
		||||
				return n1->mnc - n2->mnc;
 | 
			
		||||
			} else if (n1->nci != n2->nci) {
 | 
			
		||||
				return n1->nci - n2->nci;
 | 
			
		||||
			} else if (n1->pci != n2->pci) {
 | 
			
		||||
				return n1->pci - n2->pci;
 | 
			
		||||
			} else {
 | 
			
		||||
				return n1->tac - n2->tac;
 | 
			
		||||
			}
 | 
			
		||||
		} else {
 | 
			
		||||
			ofono_warn("Unexpected cell type");
 | 
			
		||||
			return 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -710,6 +710,12 @@ const char *registration_tech_to_string(enum ofono_access_technology tech)
 | 
			
		||||
		return "lte-cat-m1";
 | 
			
		||||
	case ACCESS_TECHNOLOGY_NB_IOT_NB1:
 | 
			
		||||
		return "lte-cat-nb1";
 | 
			
		||||
	case ACCESS_TECHNOLOGY_EUTRA_5GCN:
 | 
			
		||||
		return "lte";
 | 
			
		||||
	case ACCESS_TECHNOLOGY_NR_5GCN:
 | 
			
		||||
	case ACCESS_TECHNOLOGY_NG_RAN:
 | 
			
		||||
	case ACCESS_TECHNOLOGY_EUTRA_NR:
 | 
			
		||||
		return "nr";
 | 
			
		||||
	case OFONO_ACCESS_TECHNOLOGY_NONE:
 | 
			
		||||
		break;
 | 
			
		||||
	default:
 | 
			
		||||
 
 | 
			
		||||
@@ -46,6 +46,14 @@
 | 
			
		||||
  OFONO_ACCESS_TECHNOLOGY_NB_IOT_M1 /* 8 */
 | 
			
		||||
#define ACCESS_TECHNOLOGY_NB_IOT_NB1 \
 | 
			
		||||
  OFONO_ACCESS_TECHNOLOGY_NB_IOT_NB1 /* 9 */
 | 
			
		||||
#define ACCESS_TECHNOLOGY_EUTRA_5GCN \
 | 
			
		||||
  OFONO_ACCESS_TECHNOLOGY_EUTRA_5GCN /* 10 */
 | 
			
		||||
#define ACCESS_TECHNOLOGY_NR_5GCN \
 | 
			
		||||
  OFONO_ACCESS_TECHNOLOGY_NR_5GCN /* 11 */
 | 
			
		||||
#define ACCESS_TECHNOLOGY_NG_RAN \
 | 
			
		||||
  OFONO_ACCESS_TECHNOLOGY_NG_RAN /* 12 */
 | 
			
		||||
#define ACCESS_TECHNOLOGY_EUTRA_NR \
 | 
			
		||||
  OFONO_ACCESS_TECHNOLOGY_EUTRA_NR /* 13 */
 | 
			
		||||
 | 
			
		||||
/* 27.007 Section 7.2 <stat> */
 | 
			
		||||
#define NETWORK_REGISTRATION_STATUS_NOT_REGISTERED \
 | 
			
		||||
 
 | 
			
		||||
@@ -65,7 +65,9 @@ struct ofono_radio_settings {
 | 
			
		||||
enum ofono_radio_access_mode ofono_radio_access_max_mode(
 | 
			
		||||
					enum ofono_radio_access_mode mask)
 | 
			
		||||
{
 | 
			
		||||
	return	(mask & OFONO_RADIO_ACCESS_MODE_LTE) ?
 | 
			
		||||
	return	(mask & OFONO_RADIO_ACCESS_MODE_NR) ?
 | 
			
		||||
					OFONO_RADIO_ACCESS_MODE_NR :
 | 
			
		||||
		(mask & OFONO_RADIO_ACCESS_MODE_LTE) ?
 | 
			
		||||
					OFONO_RADIO_ACCESS_MODE_LTE :
 | 
			
		||||
		(mask & OFONO_RADIO_ACCESS_MODE_UMTS) ?
 | 
			
		||||
					OFONO_RADIO_ACCESS_MODE_UMTS :
 | 
			
		||||
@@ -86,6 +88,8 @@ const char *ofono_radio_access_mode_to_string(enum ofono_radio_access_mode m)
 | 
			
		||||
		return "umts";
 | 
			
		||||
	case OFONO_RADIO_ACCESS_MODE_LTE:
 | 
			
		||||
		return "lte";
 | 
			
		||||
	case OFONO_RADIO_ACCESS_MODE_NR:
 | 
			
		||||
		return "nr";
 | 
			
		||||
	default:
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
@@ -110,6 +114,9 @@ ofono_bool_t ofono_radio_access_mode_from_string(const char *str,
 | 
			
		||||
	} else if (g_str_equal(str, "lte")) {
 | 
			
		||||
		*mode = OFONO_RADIO_ACCESS_MODE_LTE;
 | 
			
		||||
		return TRUE;
 | 
			
		||||
	} else if (g_str_equal(str, "nr")) {
 | 
			
		||||
		*mode = OFONO_RADIO_ACCESS_MODE_NR;
 | 
			
		||||
		return TRUE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return FALSE;
 | 
			
		||||
@@ -438,7 +445,7 @@ static void radio_available_rats_query_callback(const struct ofono_error *error,
 | 
			
		||||
	struct ofono_radio_settings *rs = data;
 | 
			
		||||
 | 
			
		||||
	if (error->type == OFONO_ERROR_TYPE_NO_ERROR)
 | 
			
		||||
		rs->available_rats = available_rats & 0x7;
 | 
			
		||||
		rs->available_rats = available_rats & 0xF;
 | 
			
		||||
	else
 | 
			
		||||
		DBG("Error while querying available rats");
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -318,6 +318,28 @@ static struct ofono_cell *test_cell_init_lte(struct ofono_cell *cell)
 | 
			
		||||
	return cell;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static struct ofono_cell *test_cell_init_nr(struct ofono_cell *cell)
 | 
			
		||||
{
 | 
			
		||||
	struct ofono_cell_info_nr *nr = &cell->info.nr;
 | 
			
		||||
 | 
			
		||||
	memset(cell, 0, sizeof(*cell));
 | 
			
		||||
	cell->type = OFONO_CELL_TYPE_NR;
 | 
			
		||||
	cell->registered = TRUE;
 | 
			
		||||
	nr->mcc = 244;
 | 
			
		||||
	nr->mnc = 91;
 | 
			
		||||
	nr->nci = 36591883;
 | 
			
		||||
	nr->pci = 309;
 | 
			
		||||
	nr->tac = 4030;
 | 
			
		||||
	nr->nrarfcn = INT_MAX;
 | 
			
		||||
	nr->ssRsrp = 106;
 | 
			
		||||
	nr->ssRsrq = 6;
 | 
			
		||||
	nr->ssSinr = INT_MAX;
 | 
			
		||||
	nr->csiRsrp = 106;
 | 
			
		||||
	nr->csiRsrq = 6;
 | 
			
		||||
	nr->csiSinr = INT_MAX;
 | 
			
		||||
	return cell;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* ==== Misc ==== */
 | 
			
		||||
 | 
			
		||||
static void test_misc(void)
 | 
			
		||||
@@ -540,6 +562,13 @@ static void test_get_all4(void)
 | 
			
		||||
{
 | 
			
		||||
	struct ofono_cell cell;
 | 
			
		||||
 | 
			
		||||
	test_get_all(test_cell_init_nr(&cell), "nr");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void test_get_all5(void)
 | 
			
		||||
{
 | 
			
		||||
	struct ofono_cell cell;
 | 
			
		||||
 | 
			
		||||
	/* Invalid cell */
 | 
			
		||||
	memset(&cell, 0xff, sizeof(cell));
 | 
			
		||||
	test_get_all(&cell, "unknown");
 | 
			
		||||
@@ -1145,6 +1174,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
	g_test_add_func(TEST_("GetAll2"), test_get_all2);
 | 
			
		||||
	g_test_add_func(TEST_("GetAll3"), test_get_all3);
 | 
			
		||||
	g_test_add_func(TEST_("GetAll4"), test_get_all4);
 | 
			
		||||
	g_test_add_func(TEST_("GetAll5"), test_get_all5);
 | 
			
		||||
	g_test_add_func(TEST_("GetInterfaceVersion"), test_get_version);
 | 
			
		||||
	g_test_add_func(TEST_("GetType"), test_get_type);
 | 
			
		||||
	g_test_add_func(TEST_("GetRegistered"), test_get_registered);
 | 
			
		||||
 
 | 
			
		||||
@@ -226,6 +226,35 @@ static void test_compare(void)
 | 
			
		||||
	c2 = c1; c2.info.lte.timingAdvance++;
 | 
			
		||||
	g_assert(!ofono_cell_compare_location(&c1, &c2));
 | 
			
		||||
 | 
			
		||||
	/* NR */
 | 
			
		||||
	c1.type = OFONO_CELL_TYPE_NR;
 | 
			
		||||
	c2 = c1;
 | 
			
		||||
	g_assert(!ofono_cell_compare_location(&c1, &c2));
 | 
			
		||||
	c2 = c1; c2.info.nr.mcc++;
 | 
			
		||||
	g_assert(ofono_cell_compare_location(&c1, &c2) < 0);
 | 
			
		||||
	c2 = c1; c2.info.nr.mnc++;
 | 
			
		||||
	g_assert(ofono_cell_compare_location(&c1, &c2) < 0);
 | 
			
		||||
	c2 = c1; c2.info.nr.nci++;
 | 
			
		||||
	g_assert(ofono_cell_compare_location(&c1, &c2) < 0);
 | 
			
		||||
	c2 = c1; c2.info.nr.pci++;
 | 
			
		||||
	g_assert(ofono_cell_compare_location(&c1, &c2) < 0);
 | 
			
		||||
	c2 = c1; c2.info.nr.tac++;
 | 
			
		||||
	g_assert(ofono_cell_compare_location(&c1, &c2) < 0);
 | 
			
		||||
	/* Other attributes are not being compared */
 | 
			
		||||
	c2 = c1; c2.info.nr.nrarfcn++;
 | 
			
		||||
	g_assert(!ofono_cell_compare_location(&c1, &c2));
 | 
			
		||||
	c2 = c1; c2.info.nr.ssRsrp++;
 | 
			
		||||
	g_assert(!ofono_cell_compare_location(&c1, &c2));
 | 
			
		||||
	c2 = c1; c2.info.nr.ssRsrq++;
 | 
			
		||||
	g_assert(!ofono_cell_compare_location(&c1, &c2));
 | 
			
		||||
	c2 = c1; c2.info.nr.ssSinr++;
 | 
			
		||||
	g_assert(!ofono_cell_compare_location(&c1, &c2));
 | 
			
		||||
	c2 = c1; c2.info.nr.csiRsrp++;
 | 
			
		||||
	g_assert(!ofono_cell_compare_location(&c1, &c2));
 | 
			
		||||
	c2 = c1; c2.info.nr.csiRsrq++;
 | 
			
		||||
	g_assert(!ofono_cell_compare_location(&c1, &c2));
 | 
			
		||||
	c2 = c1; c2.info.nr.csiSinr++;
 | 
			
		||||
	g_assert(!ofono_cell_compare_location(&c1, &c2));
 | 
			
		||||
	/* Unknown type */
 | 
			
		||||
	c1.type = c2.type = (enum ofono_cell_type)-1;
 | 
			
		||||
	g_assert(!ofono_cell_compare_location(&c1, &c2));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user