DataSourceContext
Objective-C
@interface DataSourceContext : NSObject
Swift
class DataSourceContext : NSObject
This class handles the data source context.
-
Init the data source context from live sensors.
Declaration
Objective-C
- (nonnull instancetype)init;
Swift
init()
Return Value
The newly created data source context.
-
Create a dummy playback datasource.
Declaration
Objective-C
- (nullable instancetype)initDummyPlayback;
Swift
init?(dummyPlayback: ())
Return Value
The newly created data source context. Nil in case of error.
-
Init the data source context from log file.
Declaration
Objective-C
- (nullable instancetype)initWithFilePath:(nonnull NSString *)filePath;
Swift
init?(filePath: String)
Parameters
filePath
The log file path.
Return Value
The newly created data source context. Nil in case of error.
-
Init the data source context from a route ( a route simulation data source ).
Declaration
Objective-C
- (nullable instancetype)initWithRoute:(nonnull RouteObject *)route;
Swift
init?(route: RouteObject)
Parameters
route
The route used for generating data source data.
Return Value
The newly created data source context. Nil in case of error.
-
Init the data source context from an external data source. @details The resulting data source will be able to provide improved positions for the navigation service
Declaration
Objective-C
- (nullable instancetype)initWithExternalSource: (nonnull DataSourceContext *)dataSource;
Swift
init?(externalSource dataSource: DataSourceContext)
Parameters
dataSource
The external data source.
Return Value
The newly created data source context. Nil in case of error.
-
Init the data source context from an external data source. @details The resulting data source will be able to provide improved positions for the navigation service
Declaration
Objective-C
- (nullable instancetype)initWithExternalDataTypes: (nonnull NSArray<NSNumber *> *)dataTypes;
Swift
init?(externalDataTypes dataTypes: [NSNumber])
Parameters
dataTypes
The data types ( array of DataType ) that will be pushed into the data source.
Return Value
The newly created data source context. Nil in case of error.
-
Returns the model data.
Declaration
Objective-C
- (nonnull void *)getModelData;
-
The delegate for the data source context.
Declaration
Objective-C
@property (nonatomic, weak) NSObject<DataSourceContextDelegate> *_Nullable delegate;
Swift
weak var delegate: (any DataSourceContextDelegate)? { get set }
-
Updates the configuration for the specified type.
Declaration
Objective-C
- (BOOL)setConfiguration:(nonnull DataSourceConfigurationObject *)configuration forType:(DataType)type;
Swift
func setConfiguration(_ configuration: DataSourceConfigurationObject, for type: DataType) -> Bool
Parameters
configuration
The configuration to be applied.
type
Type of the data.
-
Start the data source.
Declaration
Objective-C
- (BOOL)start;
Swift
func start() -> Bool
-
Stop the data source.
Declaration
Objective-C
- (BOOL)stop;
Swift
func stop() -> Bool
-
Check if source is paused.
Declaration
Objective-C
- (BOOL)isStopped;
Swift
func isStopped() -> Bool
-
Returns the data source type.
Declaration
Objective-C
- (DataSourceType)getDataSourceType;
Swift
func getDataSourceType() -> DataSourceType
-
Returns the log path if the data source is of type playback.
Declaration
Objective-C
- (nonnull NSString *)getLogPath;
Swift
func getLogPath() -> String
-
Returns the available data types.
Declaration
Objective-C
- (nonnull NSArray<NSNumber *> *)getAvailableDataTypes;
Swift
func getAvailableDataTypes() -> [NSNumber]
-
If data source produces such a data type then it returns the data object.
Declaration
Objective-C
- (nullable DataObject *)getLatestData:(DataType)type;
Swift
func getLatestData(_ type: DataType) -> DataObject?
Parameters
type
The data type.
-
Stop delegate notification for all available data types.
Declaration
Objective-C
- (void)stopDelegateNotifications;
Swift
func stopDelegateNotifications()
-
Returns the origin of the data source.
-
Tells if the device is in portrait orientation. Valid only if DataTypeMountInformation is available.
Declaration
Objective-C
- (BOOL)isPortraitMode;
Swift
func isPortraitMode() -> Bool
-
Tells if the device is mounted for camera use ( in a fixed vertical mount, in a car) . Valid only if DataTypeMountInformation is available.
Declaration
Objective-C
- (BOOL)isMountedForCameraUse;
Swift
func isMountedForCameraUse() -> Bool
-
Returns the device temperature level.
Declaration
Objective-C
- (TemperatureLevel)getTemperatureLevel;
Swift
func getTemperatureLevel() -> TemperatureLevel
-
Returns the approximate temperature degree.
Declaration
Objective-C
- (double)getTemperatureDegrees;
Swift
func getTemperatureDegrees() -> Double
-
Seeking log file for DataSourceType Playback.
Declaration
Objective-C
- (void)seekTo:(NSInteger)valueMs;
Swift
func seek(to valueMs: Int)
-
Returns current position log for DataSourceType Playback. The value is in milliseconds.
Declaration
Objective-C
- (NSInteger)getCurrentPosition;
Swift
func getCurrentPosition() -> Int
-
Returns the log duration for DataSourceType Playback. The value is in milliseconds.
Declaration
Objective-C
- (NSInteger)getDuration;
Swift
func getDuration() -> Int
-
Play log continuously.
Declaration
Objective-C
- (void)setLoopMode:(BOOL)value;
Swift
func setLoopMode(_ value: Bool)
-
Set mock data position for testing purpose.
Declaration
Objective-C
- (SDKErrorCode)setMockDataWithPosition: (nullable MockPositionObject *)positionObject;
Swift
func setMockDataWithPosition(_ positionObject: MockPositionObject?) -> SDKErrorCode
Parameters
positionObject
The mock position object. If nil mock data will reset to default.
-
Test if this is an SDK instance.
Declaration
Objective-C
- (BOOL)isSDKInstance;
Swift
func isSDKInstance() -> Bool
-
Push new data.
Declaration
Objective-C
- (BOOL)pushData:(nonnull DataObject *)dataObject;
Swift
func pushData(_ dataObject: DataObject) -> Bool
Parameters
data
The data object to be pushed.
Return Value
false if the push data type is not available.