Browse Source

Added DataChannel::id() getter

Paul-Louis Ageneau 4 years ago
parent
commit
8cb00f81ee
2 changed files with 3 additions and 0 deletions
  1. 1 0
      include/rtc/datachannel.hpp
  2. 2 0
      src/datachannel.cpp

+ 1 - 0
include/rtc/datachannel.hpp

@@ -42,6 +42,7 @@ public:
 	            string protocol, Reliability reliability);
 	virtual ~DataChannel();
 
+	uint16_t id() const;
 	unsigned int stream() const;
 	string label() const;
 	string protocol() const;

+ 2 - 0
src/datachannel.cpp

@@ -81,6 +81,8 @@ DataChannel::DataChannel(weak_ptr<PeerConnection> pc, unsigned int stream, strin
 
 DataChannel::~DataChannel() { close(); }
 
+uint16_t DataChannel::id() const { return uint16_t(mStream); }
+
 unsigned int DataChannel::stream() const { return mStream; }
 
 string DataChannel::label() const { return mLabel; }