summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLNavigationCapability.m
blob: 7f536bc5ac1f275d1b1deeef11e6ef00ed89e81a (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 {
    [self.store sdl_setObject:sendLocationEnabled forName:SDLRPCParameterNameSendLocationEnabled];
}

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

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

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

@end

NS_ASSUME_NONNULL_END