Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NerfUS_cmake_add_library_from_mbed NerfUS NerfUSGameCoordinator
source/EthernetMagJack.cpp
- Committer:
- Eric Matte
- Date:
- 2017-02-28
- Revision:
- 4:e17cc31660ad
File content as of revision 4:e17cc31660ad:
/** @file EthernetMagJack.cpp @brief Allow communication with a server using a specific websocket. @poject NerfUS, Team P5 */ #include "EthernetMagJack.hpp" EthernetMagJack::EthernetMagJack(char *url) : ws(url) { eth.init(); //Use DHCP eth.connect(); printf("IP Address is %s\n\r", eth.getIPAddress()); ws.connect(); } void EthernetMagJack::send(char *buffer) { return ws.send(buffer); } void EthernetMagJack::onMessage(char *buffer) { return ws.read(buffer); } EthernetMagJack::~EthernetInterface() { ws.close(); eth.disconnect(); }