blob: 198bfbbaed9919ace02074cce550b52b0a8b2c5b [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
tkchin9eeb6242016-04-27 01:54:20 -070011#import "RTCDataChannelConfiguration+Private.h"
hjonda2183c2016-01-27 13:42:28 -080012
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020013#import "helpers/NSString+StdString.h"
hjonda2183c2016-01-27 13:42:28 -080014
15@implementation RTCDataChannelConfiguration
16
17@synthesize nativeDataChannelInit = _nativeDataChannelInit;
18
19- (BOOL)isOrdered {
20 return _nativeDataChannelInit.ordered;
21}
22
23- (void)setIsOrdered:(BOOL)isOrdered {
24 _nativeDataChannelInit.ordered = isOrdered;
25}
26
tkchin8b9ca952016-03-31 12:08:03 -070027- (NSInteger)maxRetransmitTimeMs {
28 return self.maxPacketLifeTime;
29}
30
31- (void)setMaxRetransmitTimeMs:(NSInteger)maxRetransmitTimeMs {
32 self.maxPacketLifeTime = maxRetransmitTimeMs;
33}
34
hjonda2183c2016-01-27 13:42:28 -080035- (int)maxPacketLifeTime {
Harald Alvestrandf3736ed2019-04-08 13:09:30 +020036 return *_nativeDataChannelInit.maxRetransmitTime;
hjonda2183c2016-01-27 13:42:28 -080037}
38
39- (void)setMaxPacketLifeTime:(int)maxPacketLifeTime {
40 _nativeDataChannelInit.maxRetransmitTime = maxPacketLifeTime;
41}
42
43- (int)maxRetransmits {
Harald Alvestrandf3736ed2019-04-08 13:09:30 +020044 if (_nativeDataChannelInit.maxRetransmits) {
45 return *_nativeDataChannelInit.maxRetransmits;
46 } else {
47 return -1;
48 }
hjonda2183c2016-01-27 13:42:28 -080049}
50
51- (void)setMaxRetransmits:(int)maxRetransmits {
52 _nativeDataChannelInit.maxRetransmits = maxRetransmits;
53}
54
55- (NSString *)protocol {
56 return [NSString stringForStdString:_nativeDataChannelInit.protocol];
57}
58
59- (void)setProtocol:(NSString *)protocol {
60 _nativeDataChannelInit.protocol = [NSString stdStringForString:protocol];
61}
62
63- (BOOL)isNegotiated {
64 return _nativeDataChannelInit.negotiated;
65}
66
67- (void)setIsNegotiated:(BOOL)isNegotiated {
68 _nativeDataChannelInit.negotiated = isNegotiated;
69}
70
71- (int)streamId {
tkchin8b9ca952016-03-31 12:08:03 -070072 return self.channelId;
hjonda2183c2016-01-27 13:42:28 -080073}
74
75- (void)setStreamId:(int)streamId {
tkchin8b9ca952016-03-31 12:08:03 -070076 self.channelId = streamId;
hjonda2183c2016-01-27 13:42:28 -080077}
78
tkchin8b9ca952016-03-31 12:08:03 -070079- (int)channelId {
80 return _nativeDataChannelInit.id;
81}
82
83- (void)setChannelId:(int)channelId {
84 _nativeDataChannelInit.id = channelId;
85}
86
87@end