blob: 31ab581d8c38d94d6771bfe2c923ff8fcf769f24 [file] [log] [blame]
James Kuszmaul64391362021-01-17 11:32:00 -08001#include <rawrtcdc/data_channel.h>
2
3/*
4 * Get the corresponding name for a data channel state.
5 */
6char const* rawrtc_data_channel_state_to_name(enum rawrtc_data_channel_state const state) {
7 switch (state) {
8 case RAWRTC_DATA_CHANNEL_STATE_CONNECTING:
9 return "connecting";
10 case RAWRTC_DATA_CHANNEL_STATE_OPEN:
11 return "open";
12 case RAWRTC_DATA_CHANNEL_STATE_CLOSING:
13 return "closing";
14 case RAWRTC_DATA_CHANNEL_STATE_CLOSED:
15 return "closed";
16 default:
17 return "???";
18 }
19}