blob: 4a1dcb061c84ddb4ec205080ef8e166d7005ad26 [file] [log] [blame]
hjonda2183c2016-01-27 13:42:28 -08001/*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#import "RTCDataChannelConfiguration.h"
12
13#import "webrtc/api/objc/RTCDataChannelConfiguration+Private.h"
14#import "webrtc/base/objc/NSString+StdString.h"
15
16@implementation RTCDataChannelConfiguration
17
18@synthesize nativeDataChannelInit = _nativeDataChannelInit;
19
20- (BOOL)isOrdered {
21 return _nativeDataChannelInit.ordered;
22}
23
24- (void)setIsOrdered:(BOOL)isOrdered {
25 _nativeDataChannelInit.ordered = isOrdered;
26}
27
tkchin8b9ca952016-03-31 12:08:03 -070028- (NSInteger)maxRetransmitTimeMs {
29 return self.maxPacketLifeTime;
30}
31
32- (void)setMaxRetransmitTimeMs:(NSInteger)maxRetransmitTimeMs {
33 self.maxPacketLifeTime = maxRetransmitTimeMs;
34}
35
hjonda2183c2016-01-27 13:42:28 -080036- (int)maxPacketLifeTime {
37 return _nativeDataChannelInit.maxRetransmitTime;
38}
39
40- (void)setMaxPacketLifeTime:(int)maxPacketLifeTime {
41 _nativeDataChannelInit.maxRetransmitTime = maxPacketLifeTime;
42}
43
44- (int)maxRetransmits {
45 return _nativeDataChannelInit.maxRetransmits;
46}
47
48- (void)setMaxRetransmits:(int)maxRetransmits {
49 _nativeDataChannelInit.maxRetransmits = maxRetransmits;
50}
51
52- (NSString *)protocol {
53 return [NSString stringForStdString:_nativeDataChannelInit.protocol];
54}
55
56- (void)setProtocol:(NSString *)protocol {
57 _nativeDataChannelInit.protocol = [NSString stdStringForString:protocol];
58}
59
60- (BOOL)isNegotiated {
61 return _nativeDataChannelInit.negotiated;
62}
63
64- (void)setIsNegotiated:(BOOL)isNegotiated {
65 _nativeDataChannelInit.negotiated = isNegotiated;
66}
67
68- (int)streamId {
tkchin8b9ca952016-03-31 12:08:03 -070069 return self.channelId;
hjonda2183c2016-01-27 13:42:28 -080070}
71
72- (void)setStreamId:(int)streamId {
tkchin8b9ca952016-03-31 12:08:03 -070073 self.channelId = streamId;
hjonda2183c2016-01-27 13:42:28 -080074}
75
tkchin8b9ca952016-03-31 12:08:03 -070076- (int)channelId {
77 return _nativeDataChannelInit.id;
78}
79
80- (void)setChannelId:(int)channelId {
81 _nativeDataChannelInit.id = channelId;
82}
83
84@end