setMockData method
Set mock position data
Can be used to set custom data in a live data source. Not relevant for other types of data sources.
Parameters
- IN type The data type to be set
- IN senseData The data type for which the data is requested.
Returns
- GemError.success on success
- GemError.notSupported if the data source does not support mock data (it is not live) or if type is not DataType.position.
- Other GemError values on failure
Throws
- An exception if it fails
Implementation
GemError setMockData(final DataType type, final SenseData senseData) {
if (senseData is! SenseDataImpl) {
return GemError.invalidInput;
}
final OperationResult resultString = objectMethod(
_pointerId,
'DataSourceContainer',
'setMockData',
args: <String, Object>{'type': type.id, 'data': senseData.toJson()},
);
return GemErrorExtension.fromCode(resultString['result']);
}