I would rather have a different way of configuring the communication layer. A way which would not require modifiying the er-coap application. Maybe more like a "disable udp" communication layer thing. And overwrite with something else.