void print()
{
stack ethernetPort port = ethernetPort::Ethernet1::Port1;
stack enum EthernetPhyConnector connector;
if (ethGetPhyConnector(port, connector) != 0)
{
printConnector(connector);
}
}
void printConnector(enum EthernetPhyConnector connector)
{
char str[64];
switch (connector)
{
case kEthernetPhyConnectorDefault:
strncpy(str, "kEthernetPhyConnectorDefault", elcount(str));
break;
case kEthernetPhyConnectorRJ45:
strncpy(str, "kEthernetPhyConnectorRJ45", elcount(str));
break;
case kEthernetPhyConnectorDSub:
strncpy(str, "kEthernetPhyConnectorUnknown", elcount(str));
break;
default:
write("error");
return;
}
write("connector: %s", str);
}