summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLNavigationCapability.m
blob: 60c2034d41749b13170f3359c647e9fab41a8990 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
//  SDLNavigationCapability.m
//  SmartDeviceLink-iOS
//
//  Created by Joel Fischer on 7/11/17.
//  Copyright © 2017 smartdevicelink. All rights reserved.
//

#import "SDLNavigationCapability.h"

#import "NSMutableDictionary+Store.h"
#import "SDLRPCParameterNames.h"

NS_ASSUME_NONNULL_BEGIN

@implementation SDLNavigationCapability

- (instancetype)initWithSendLocation:(BOOL)sendLocationEnabled waypoints:(BOOL)waypointsEnabled {
    self = [self init];
    if (!self) {
        return self;
    }

    self.sendLocationEnabled = @(sendLocationEnabled);
    self.getWayPointsEnabled = @(waypointsEnabled);

    return self;
}

- (void)setSendLocationEnabled:(nullable NSNumber *)sendLocationEnabled {
    [store sdl_setObject:sendLocationEnabled forName:SDLRPCParameterNameSendLocationEnabled];
}

- (nullable NSNumber *)sendLocationEnabled {
    return [store sdl_objectForName:SDLRPCParameterNameSendLocationEnabled ofClass:NSNumber.class error:nil];
}

- (void)setGetWayPointsEnabled:(nullable NSNumber *)getWayPointsEnabled {
    [store sdl_setObject:getWayPointsEnabled forName:SDLRPCParameterNameGetWayPointsEnabled];
}

- (nullable NSNumber *)getWayPointsEnabled {
    return [store sdl_objectForName:SDLRPCParameterNameGetWayPointsEnabled ofClass:NSNumber.class error:nil];
}

@end

NS_ASSUME_NONNULL_END