Skip to contentSkip to conversation

udevng/gobi: rework mandatory and optional interfaces

PATCH New Alexander Couzens 1 participant 1 message May 16, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 udevng/gobi: rework mandatory and optional interfaces

Mandatory interfaces are QMI and net.
Optional interfaces are GPS, Modem, Diag.
---

Hi Denis,

I'm not sure how you want this patch ;). I can also split it in two parts or you just drop the part you don't like.

Best,
lynxis

 plugins/udevng.c | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)
plugins/udevng.c +25 -3
index aa28bcb8..072c727d 100644
@@ -232,16 +232,38 @@ static gboolean setup_gobi(struct modem_info *modem)
 		}
 	}
 
-	if (qmi == NULL || mdm == NULL || net == NULL)
+	if (!qmi) {
+		DBG("mandatory qmi interface missing");
 		return FALSE;
+	}
+
+	if (!net) {
+		DBG("mandatory net interface missing");
+		return FALSE;
+	}
 
 	DBG("qmi=%s net=%s mdm=%s gps=%s diag=%s", qmi, net, mdm, gps, diag);
 
+	/* mandatory interface */
 	ofono_modem_set_string(modem->modem, "Device", qmi);
-	ofono_modem_set_string(modem->modem, "Modem", mdm);
-	ofono_modem_set_string(modem->modem, "Diag", diag);
 	ofono_modem_set_string(modem->modem, "NetworkInterface", net);
 
+	/* optional */
+	if (diag)
+		ofono_modem_set_string(modem->modem, "Diag", diag);
+	else
+		DBG("optional diag interface missing");
+
+	if (mdm)
+		ofono_modem_set_string(modem->modem, "Modem", mdm);
+	else
+		DBG("optional mdm interface missing");
+
+	if (gps)
+		ofono_modem_set_string(modem->modem, "GPS", gps);
+	else
+		DBG("optional gps interface missing");
+
 	return TRUE;
 }
 
Signature · 1 line
2.13.0