summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLGlobals.h
blob: 42b0cf9273dbd63006a9f6d360ad1f329efffea3 (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
//
//  SDLGlobals.h
//  SmartDeviceLink-iOS
//
//  Created by Joel Fischer on 8/5/15.
//  Copyright (c) 2015 smartdevicelink. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "SDLProtocolConstants.h"

@class SDLProtocolHeader;
@class SDLVersion;

NS_ASSUME_NONNULL_BEGIN

#define SDL_SYSTEM_VERSION_LESS_THAN(version) ([[[UIDevice currentDevice] systemVersion] compare:version options:NSNumericSearch] == NSOrderedAscending)
#define SDL_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(version) ([[[UIDevice currentDevice] systemVersion] compare:version options:NSNumericSearch] != NSOrderedAscending)
#define BLOCK_RETURN return

extern NSString *const SDLMaxProxyProtocolVersion;
extern NSString *const SDLMaxProxyRPCVersion;

extern NSUInteger const SDLDefaultMTUSize;
extern NSUInteger const SDLV1MTUSize;
extern NSUInteger const SDLV3MTUSize;

extern void *const SDLProcessingQueueName;
extern void *const SDLConcurrentQueueName;

@interface SDLGlobals : NSObject

@property (copy, nonatomic, readonly) SDLVersion *protocolVersion;
@property (strong, nonatomic) SDLVersion *rpcVersion;
@property (copy, nonatomic) SDLVersion *maxHeadUnitProtocolVersion;

@property (copy, nonatomic) dispatch_queue_t sdlProcessingQueue;
@property (copy, nonatomic) dispatch_queue_t sdlConcurrentQueue;

+ (instancetype)sharedGlobals;

- (void)setDynamicMTUSize:(NSUInteger)maxMTUSize forServiceType:(SDLServiceType)serviceType;
- (NSUInteger)mtuSizeForServiceType:(SDLServiceType)serviceType;

+ (void)runSyncOnSerialSubQueue:(dispatch_queue_t)queue block:(void (^)(void))block;

@end

NS_ASSUME_NONNULL_END