Skip to contentSkip to conversation

radio-settings: handling of dual mode technology preference

PATCH In review Antara Borwankar 1 participant 1 message May 13, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 radio-settings: handling of dual mode technology preference

Handled two new dual mode technology preferences
"umts,gsm" and "lte,umts".

---
 src/radio-settings.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
src/radio-settings.c +14 -2
index 7fd92df..7283aa9 100644
@@ -71,9 +71,15 @@ static const char *radio_access_mode_to_string(enum ofono_radio_access_mode m)
 		return "umts";
 	case OFONO_RADIO_ACCESS_MODE_LTE:
 		return "lte";
-	default:
-		return NULL;
 	}
+
+	if (m == (OFONO_RADIO_ACCESS_MODE_UMTS|OFONO_RADIO_ACCESS_MODE_GSM))
+		return "umts,gsm";
+
+	if (m == (OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_UMTS))
+		return "lte,umts";
+
+	return NULL;
 }
 
 static gboolean radio_access_mode_from_string(const char *str,
@@ -92,6 +98,12 @@ static gboolean 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, "umts,gsm")) {
+		*mode = OFONO_RADIO_ACCESS_MODE_UMTS|OFONO_RADIO_ACCESS_MODE_GSM;
+		return TRUE;
+	} else if (g_str_equal(str, "lte,umts")) {
+		*mode = OFONO_RADIO_ACCESS_MODE_LTE|OFONO_RADIO_ACCESS_MODE_UMTS;
+		return TRUE;
 	}
 
 	return FALSE;
Signature · 1 line
1.9.1