Commit be1d25e1 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Support new and old driver XML file formats

parent 3f689156
......@@ -986,7 +986,7 @@ void DriverManager::processXMLDriver(QString & driverName)
char errmsg[ERRMSG_SIZE];
char c;
LilXML *xmlParser = newLilXML();
XMLEle *root = NULL;
XMLEle *root = NULL, *ep=NULL;
if (driverName.endsWith("drivers.xml"))
driverSource = PRIMARY_XML;
......@@ -999,8 +999,21 @@ void DriverManager::processXMLDriver(QString & driverName)
if (root)
{
if (!buildDeviceGroup(root, errmsg))
prXMLEle(stderr, root, 0);
// If the XML file is using the INDI Library v1.3+ format
if (!strcmp(tagXMLEle(root), "driversList"))
{
for (ep = nextXMLEle(root, 1) ; ep != NULL ; ep = nextXMLEle(root, 0))
{
if (!buildDeviceGroup(ep, errmsg))
prXMLEle(stderr, ep, 0);
}
}
// If using the older format
else
{
if (!buildDeviceGroup(root, errmsg))
prXMLEle(stderr, root, 0);
}
delXMLEle(root);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment