hjon | da2183c | 2016-01-27 13:42:28 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
tkchin | 9eeb624 | 2016-04-27 01:54:20 -0700 | [diff] [blame] | 11 | #import "RTCDataChannelConfiguration+Private.h" |
hjon | da2183c | 2016-01-27 13:42:28 -0800 | [diff] [blame] | 12 | |
tkchin | 9eeb624 | 2016-04-27 01:54:20 -0700 | [diff] [blame] | 13 | #import "NSString+StdString.h" |
hjon | da2183c | 2016-01-27 13:42:28 -0800 | [diff] [blame] | 14 | |
| 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 | |
tkchin | 8b9ca95 | 2016-03-31 12:08:03 -0700 | [diff] [blame] | 27 | - (NSInteger)maxRetransmitTimeMs { |
| 28 | return self.maxPacketLifeTime; |
| 29 | } |
| 30 | |
| 31 | - (void)setMaxRetransmitTimeMs:(NSInteger)maxRetransmitTimeMs { |
| 32 | self.maxPacketLifeTime = maxRetransmitTimeMs; |
| 33 | } |
| 34 | |
hjon | da2183c | 2016-01-27 13:42:28 -0800 | [diff] [blame] | 35 | - (int)maxPacketLifeTime { |
| 36 | return _nativeDataChannelInit.maxRetransmitTime; |
| 37 | } |
| 38 | |
| 39 | - (void)setMaxPacketLifeTime:(int)maxPacketLifeTime { |
| 40 | _nativeDataChannelInit.maxRetransmitTime = maxPacketLifeTime; |
| 41 | } |
| 42 | |
| 43 | - (int)maxRetransmits { |
| 44 | return _nativeDataChannelInit.maxRetransmits; |
| 45 | } |
| 46 | |
| 47 | - (void)setMaxRetransmits:(int)maxRetransmits { |
| 48 | _nativeDataChannelInit.maxRetransmits = maxRetransmits; |
| 49 | } |
| 50 | |
| 51 | - (NSString *)protocol { |
| 52 | return [NSString stringForStdString:_nativeDataChannelInit.protocol]; |
| 53 | } |
| 54 | |
| 55 | - (void)setProtocol:(NSString *)protocol { |
| 56 | _nativeDataChannelInit.protocol = [NSString stdStringForString:protocol]; |
| 57 | } |
| 58 | |
| 59 | - (BOOL)isNegotiated { |
| 60 | return _nativeDataChannelInit.negotiated; |
| 61 | } |
| 62 | |
| 63 | - (void)setIsNegotiated:(BOOL)isNegotiated { |
| 64 | _nativeDataChannelInit.negotiated = isNegotiated; |
| 65 | } |
| 66 | |
| 67 | - (int)streamId { |
tkchin | 8b9ca95 | 2016-03-31 12:08:03 -0700 | [diff] [blame] | 68 | return self.channelId; |
hjon | da2183c | 2016-01-27 13:42:28 -0800 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | - (void)setStreamId:(int)streamId { |
tkchin | 8b9ca95 | 2016-03-31 12:08:03 -0700 | [diff] [blame] | 72 | self.channelId = streamId; |
hjon | da2183c | 2016-01-27 13:42:28 -0800 | [diff] [blame] | 73 | } |
| 74 | |
tkchin | 8b9ca95 | 2016-03-31 12:08:03 -0700 | [diff] [blame] | 75 | - (int)channelId { |
| 76 | return _nativeDataChannelInit.id; |
| 77 | } |
| 78 | |
| 79 | - (void)setChannelId:(int)channelId { |
| 80 | _nativeDataChannelInit.id = channelId; |
| 81 | } |
| 82 | |
| 83 | @end |