Class Garmin.PluginUtils
Garmin.PluginUtils
Defined in: GarminPluginUtils.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Plugin-specific utility functions.
|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
Garmin.PluginUtils.getDeviceErrorMessage(xml)
Best effort to convert XML error message to a String.
|
| <static> |
Garmin.PluginUtils.isDeviceErrorXml(xml)
Is this a device XML error message.
|
| <static> |
Garmin.PluginUtils.parseDeviceXml(garminPlugin, getDetailedDeviceData)
Parse device xml string into device objects.
|
Method Detail
<static>
{String}
Garmin.PluginUtils.getDeviceErrorMessage(xml)
Best effort to convert XML error message to a String.
- Parameters:
- {String} xml
- string or Error instance with embedded xml
- Returns:
- Human readable interpretation of XML message
<static>
{Boolean}
Garmin.PluginUtils.isDeviceErrorXml(xml)
Is this a device XML error message.
- Parameters:
- {String} xml
- string or Error instance with embedded xml
- Returns:
- true if error is device-generared error
<static>
{Array}
Garmin.PluginUtils.parseDeviceXml(garminPlugin, getDetailedDeviceData)
Parse device xml string into device objects.
Each device object contains the following:
1) device display name
2) device number
3) device XML as an XML document
- Parameters:
- garminPlugin
- - the GarminDevicePlugin object having access to the device XML data.
- getDetailedDeviceData
- - boolean indicating if you want to get the entire device XML as an XML document (rather than the few essentials)
- Returns:
- {Array} an array of Garmin.Device objects