| 50 | } |
| 51 | |
| 52 | bool UdpConnection::connect(IpAddress ip, uint16_t port) |
| 53 | { |
| 54 | if(udp == nullptr) { |
| 55 | if(!initialize()) { |
| 56 | return false; |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | if(udp->local_port == 0) { |
| 61 | udp_bind(udp, IP_ADDR_ANY, 0); |
| 62 | debug_d("UDP LocalPort: %d", udp->local_port); |
| 63 | } |
| 64 | |
| 65 | debug_d("UDP connect to %s:%d", ip.toString().c_str(), port); |
| 66 | err_t res = udp_connect(udp, ip, port); |
| 67 | return res == ERR_OK; |
| 68 | } |
| 69 | |
| 70 | bool UdpConnection::send(const char* data, int length) |
| 71 | { |
nothing calls this directly
no test coverage detected