setLiveDataSource method
Set the position service current datasource to live.
Returns
- GemError.success on success
- GemError.invalidInput if the datasource could not be created (missing permissions, no position provider, etc.)
- GemError.exist if the datasource is already set
Throws
- An exception if it fails.
Implementation
GemError setLiveDataSource() {
final String resultString = GemKitPlatform.instance.callObjectMethod(
jsonEncode(<String, dynamic>{
'id': 0,
'class': 'PositionService',
'method': 'selectPositionDataSource',
'senseDataSourceType': 'live',
}),
);
final dynamic result = jsonDecode(resultString);
final int errCode = result['gemApiError'];
return GemErrorExtension.fromCode(errCode);
}