#define MS_CLASS "RTC::IceCandidate"
#include "RTC/IceCandidate.hpp"
#include "Logger.hpp"
namespace RTC
{
void IceCandidate::FillJson(json& jsonObject) const
{
MS_TRACE();
jsonObject["foundation"] = this->foundation;
jsonObject["priority"] = this->priority;
jsonObject["ip"] = this->ip;
switch (this->protocol)
{
case Protocol::UDP:
jsonObject["protocol"] = "udp";
break;
case Protocol::TCP:
jsonObject["protocol"] = "tcp";
break;
}
jsonObject["port"] = this->port;
switch (this->type)
{
case CandidateType::HOST:
jsonObject["type"] = "host";
break;
}
if (this->protocol == Protocol::TCP)
{
switch (this->tcpType)
{
case TcpCandidateType::PASSIVE:
jsonObject["tcpType"] = "passive";
break;
}
}
}
}