summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLGetFileResponse.m
blob: 14e86e8ce9fea76c88cc2b5d8f18de8711b30bc3 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//
//  SDLGetFileResponse.m
//  SmartDeviceLink
//
//  Created by Nicole on 2/7/19.
//  Copyright © 2019 smartdevicelink. All rights reserved.
//

#import "SDLGetFileResponse.h"

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

NS_ASSUME_NONNULL_BEGIN

@implementation SDLGetFileResponse

- (instancetype)init {
    if (self = [super initWithName:SDLRPCFunctionNameGetFile]) {
    }
    return self;
}

- (instancetype)initWithOffset:(UInt32)offset length:(UInt32)length fileType:(nullable SDLFileType)fileType crc:(UInt32)crc {
    self = [self init];
    if (!self) {
        return nil;
    }

    self.offset = @(offset);
    self.length = @(length);
    self.fileType = fileType;
    self.crc = @(crc);

    return self;
}

- (void)setOffset:(nullable NSNumber<SDLUInt> *)offset {
    [parameters sdl_setObject:offset forName:SDLRPCParameterNameOffset];
}

- (nullable NSNumber<SDLUInt> *)offset {
    return [parameters sdl_objectForName:SDLRPCParameterNameOffset ofClass:NSNumber.class error:nil];
}

- (void)setLength:(nullable NSNumber<SDLUInt> *)length {
    [parameters sdl_setObject:length forName:SDLRPCParameterNameLength];
}

- (nullable NSNumber<SDLUInt> *)length {
    return [parameters sdl_objectForName:SDLRPCParameterNameLength ofClass:NSNumber.class error:nil];
}

- (void)setFileType:(nullable SDLFileType)fileType {
    [parameters sdl_setObject:fileType forName:SDLRPCParameterNameFileType];
}

- (nullable SDLFileType)fileType {
    return [parameters sdl_enumForName:SDLRPCParameterNameFileType error:nil];
}

- (void)setCrc:(nullable NSNumber<SDLUInt> *)crc {
    [parameters sdl_setObject:crc forName:SDLRPCParameterNameCRC];
}

- (nullable NSNumber<SDLUInt> *)crc {
    return [parameters sdl_objectForName:SDLRPCParameterNameCRC ofClass:NSNumber.class error:nil];
}

@end

NS_ASSUME_NONNULL_END