James Kuszmaul | 6439136 | 2021-01-17 11:32:00 -0800 | [diff] [blame^] | 1 | #include <rawrtcdc/data_channel.h> |
| 2 | |
| 3 | /* |
| 4 | * Get the corresponding name for a data channel state. |
| 5 | */ |
| 6 | char 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 | } |