multiplayer pong game for LPC 1768
Dependencies: mbed MbedJSONValue mbed-rtos Adafruit_ST7735 Adafruit_GFX EthernetInterface DebouncedInterrupt
Diff: network.cpp
- Revision:
- 11:d0a105f6743f
- Child:
- 13:95d44f7855ca
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/network.cpp Tue Nov 10 02:32:49 2020 +0000 @@ -0,0 +1,13 @@ +#include "network.h" + +void initEthernet(EthernetInterface *eth, UDPSocket *sock, Endpoint *nist) { + eth->init(); //Use DHCP + eth->connect(); + sock->init(); + nist->set_address(AWS_IP, PORT); +} + +void cleanupEthernet(EthernetInterface *eth, UDPSocket *sock) { + sock->close(); + eth->disconnect(); +}